getPackageLibraries: replace some rather fragile string prefix matching code that broke when "HSstd" got renamed to "HSbase".