Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 542edaf

Browse filesBrowse files
committed
Allow disabling copyright files deployment for debugging
1 parent e683561 commit 542edaf
Copy full SHA for 542edaf

3 files changed

+20Lines changed: 20 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎include/linuxdeploy/core/appdir.h‎

Copy file name to clipboardExpand all lines: include/linuxdeploy/core/appdir.h
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ namespace linuxdeploy {
9191
// calling this function can turn sure file trees created by make install commands into working
9292
// AppDirs
9393
bool deployDependenciesForExistingFiles();
94+
95+
// disable deployment of copyright files for this instance
96+
bool setDisableCopyrightFilesDeployment(bool disable);
9497
};
9598
}
9699
}
Collapse file

‎src/core/appdir.cpp‎

Copy file name to clipboardExpand all lines: src/core/appdir.cpp
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ namespace linuxdeploy {
4747
// used to automatically rename resources to improve the UX, e.g. icons
4848
std::string appName;
4949

50+
// platform dependent implementation of copyright files deployment
5051
std::shared_ptr<copyright::ICopyrightFilesManager> copyrightFilesManager;
5152

53+
// decides whether copyright files deployment is performed
54+
bool disableCopyrightFilesDeployment = false;
55+
5256
public:
5357
PrivateData() : copyOperations(), stripOperations(), setElfRPathOperations(), visitedFiles(), appDirPath(), appName() {
5458
copyrightFilesManager = copyright::ICopyrightFilesManager::getInstance();
@@ -228,6 +232,9 @@ namespace linuxdeploy {
228232

229233
// search for copyright file for file and deploy it to AppDir
230234
bool deployCopyrightFiles(const bf::path& from, const std::string& logPrefix = "") {
235+
if (disableCopyrightFilesDeployment)
236+
return true;
237+
231238
ldLog() << logPrefix << LD_NO_SPACE << "Deploying copyright files for file" << from << std::endl;
232239

233240
if (copyrightFilesManager == nullptr)
@@ -828,6 +835,10 @@ namespace linuxdeploy {
828835

829836
return true;
830837
}
838+
839+
bool AppDir::setDisableCopyrightFilesDeployment(bool disable) {
840+
d->disableCopyrightFilesDeployment = disable;
841+
}
831842
}
832843
}
833844
}
Collapse file

‎src/main.cpp‎

Copy file name to clipboardExpand all lines: src/main.cpp
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ int main(int argc, char** argv) {
9191

9292
appdir::AppDir appDir(appDirPath.Get());
9393

94+
// allow disabling copyright files deployment via environment variable
95+
if (getenv("DISABLE_COPYRIGHT_FILES_DEPLOYMENT") != nullptr) {
96+
ldLog() << std::endl << LD_WARNING << "Copyright files deployment disabled" << std::endl;
97+
appDir.setDisableCopyrightFilesDeployment(true);
98+
}
99+
94100
// initialize AppDir with common directories
95101
ldLog() << std::endl << "-- Creating basic AppDir structure --" << std::endl;
96102
if (!appDir.createBasicStructure()) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.