@@ -98,6 +98,7 @@ namespace linuxdeploy {
9898 class AppDir ::PrivateData {
9999 public:
100100 bf::path appDirPath;
101+ std::vector<std::string> excludeLibraryPatterns;
101102
102103 // store deferred operations
103104 // these can be executed by calling excuteDeferredOperations
@@ -121,7 +122,7 @@ namespace linuxdeploy {
121122 bool disableCopyrightFilesDeployment = false ;
122123
123124 public:
124- PrivateData () : copyOperationsStorage(), stripOperations(), setElfRPathOperations(), visitedFiles(), appDirPath() {
125+ PrivateData () : copyOperationsStorage(), stripOperations(), setElfRPathOperations(), visitedFiles(), appDirPath(), excludeLibraryPatterns() {
125126 copyrightFilesManager = copyright::ICopyrightFilesManager::getInstance ();
126127 };
127128
@@ -392,8 +393,8 @@ namespace linuxdeploy {
392393 return false ;
393394 }
394395
395- static auto isInExcludelist = [](const bf::path& fileName) {
396- for (const auto & excludePattern : generatedExcludelist ) {
396+ static auto isInExcludelist = [](const bf::path& fileName, const std::vector<std::string> &excludeList ) {
397+ for (const auto & excludePattern : excludeList ) {
397398 // simple string match is faster than using fnmatch
398399 if (excludePattern == fileName)
399400 return true ;
@@ -413,7 +414,7 @@ namespace linuxdeploy {
413414 return false ;
414415 };
415416
416- if (!forceDeploy && isInExcludelist (path.filename ())) {
417+ if (!forceDeploy && ( isInExcludelist (path.filename (), generatedExcludelist) || isInExcludelist (path. filename (), excludeLibraryPatterns ))) {
417418 ldLog () << " Skipping deployment of blacklisted library" << path << std::endl;
418419
419420 // mark file as visited
@@ -639,6 +640,10 @@ namespace linuxdeploy {
639640
640641 AppDir::AppDir (const std::string& path) : AppDir(bf::path(path)) {}
641642
643+ void AppDir::setExcludeLibraryPatterns (const std::vector<std::string> &excludeLibraryPatterns) {
644+ d->excludeLibraryPatterns = excludeLibraryPatterns;
645+ }
646+
642647 bool AppDir::createBasicStructure () const {
643648 std::vector<std::string> dirPaths = {
644649 " usr/bin/" ,
0 commit comments