Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple deployers: Ignore .debug files #182

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/deployers/BasicPluginsDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ bool BasicPluginsDeployer::deployStandardQtPlugins(const std::vector<std::string
for (const auto &pluginName : plugins) {
ldLog() << "Deploying Qt" << pluginName << "plugins" << std::endl;
for (fs::directory_iterator i(qtPluginsPath / pluginName); i != fs::directory_iterator(); ++i) {
if (i->path().extension() == ".debug") {
ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl;
continue;
}
// add a trailing slash, so pluginName is used as a destination directory, not a file.
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins" / pluginName / ""))
return false;
Expand Down
32 changes: 1 addition & 31 deletions src/deployers/TextToSpeechPluginsDeployer.cpp
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@
// system headers
#include <filesystem>

// library headers
#include <linuxdeploy/core/log.h>

// local headers
#include "TextToSpeechPluginsDeployer.h"

using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::log;

namespace fs = std::filesystem;

bool TextToSpeechPluginsDeployer::doDeploy() {
// calling the default code is optional, but it won't hurt for now
if (!BasicPluginsDeployer::deploy())
return false;

const std::string pluginsName = "texttospeech";

ldLog() << "Deploying" << pluginsName << "plugins" << std::endl;

for (fs::directory_iterator i(qtPluginsPath / pluginsName); i != fs::directory_iterator(); ++i) {
if (i->path().extension() == ".debug") {
ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl;
continue;
}

// terminate with a "/" to make sure the deployer will deploy the file into the target directory properly
// has to be cast to string, unfortunately, as std::filesystem doesn't allow for adding a terminating /
const auto targetPath = (appDir.path() / "usr/plugins/" / pluginsName).string() + "/";
if (!appDir.deployLibrary(*i, targetPath))
return false;
}

return true;
return deployStandardQtPlugins({"texttospeech"});
}
4 changes: 4 additions & 0 deletions src/deployment.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ inline bool deployIntegrationPlugins(appdir::AppDir& appDir, const fs::path& qtP
// otherwise, when the directory doesn't exist, it might just copy all files to files called like
// destinationDir
auto destinationDir = appDir.path() / "usr/plugins" / subDir / "";
if (i->path().extension() == ".debug") {
ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl;
continue;
}

if (!appDir.deployLibrary(*i, destinationDir))
return false;
Expand Down