Fix deployLibrary destinationPath construction.

This commit is contained in:
Alexis Lopez Zubieta
2018-07-18 13:34:20 -05:00
parent 144fd2deb0
commit 03cae41d55

View File

@@ -333,7 +333,7 @@ namespace linuxdeploy {
return patchelfPath;
}
bool deployLibrary(const bf::path& path, int recursionLevel = 0, bool forceDeploy = false, const bf::path& destination = bf::path()) {
bool deployLibrary(const bf::path& path, int recursionLevel = 0, bool forceDeploy = false,const bf::path &destination = bf::path()) {
auto logPrefix = getLogPrefix(recursionLevel);
if (!forceDeploy && hasBeenVisitedAlready(path)) {
@@ -341,6 +341,7 @@ namespace linuxdeploy {
return true;
}
static auto isInExcludelist = [&logPrefix](const bf::path& fileName) {
for (const auto& excludePattern : generatedExcludelist) {
// simple string match is faster than using fnmatch
@@ -378,6 +379,12 @@ namespace linuxdeploy {
auto destinationPath = destination.empty() ? appDirPath / "usr/lib/" : destination;
// not sure whether this is 100% bullet proof, but it simulates the cp command behavior
if (destinationPath.string().back() == '/' || bf::is_directory(destinationPath)) {
destinationPath /= path.filename();
}
deployFile(path, destinationPath);
deployCopyrightFiles(path, logPrefix);
@@ -399,8 +406,9 @@ namespace linuxdeploy {
rpath = "$ORIGIN/" + relPath.string() + ":$ORIGIN";
}
setElfRPathOperations[destinationPath / path.filename()] = rpath;
stripOperations.insert(destinationPath / path.filename());
setElfRPathOperations[destinationPath] = rpath;
stripOperations.insert(destinationPath);
if (!deployElfDependencies(path, recursionLevel))
return false;