You've already forked linuxdeploy
mirror of
https://github.com/encounter/linuxdeploy.git
synced 2026-07-10 12:18:44 -07:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a952b57f9 | |||
| 8fbe191d7a |
@@ -11,6 +11,7 @@
|
||||
|
||||
// local headers
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "linuxdeploy/util/util.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -48,10 +49,16 @@ namespace linuxdeploy {
|
||||
auto output = subprocess::check_output({pluginPath.c_str(), "--plugin-api-version"});
|
||||
std::string stdoutOutput = output.buf.data();
|
||||
|
||||
// only interpret last line (fixes issues with --appimage-extract-and-run, where the runtime
|
||||
// prints all the paths it extracts out to stdout)
|
||||
const auto& lines = util::splitLines(stdoutOutput);
|
||||
const auto& lastLine = lines.back();
|
||||
|
||||
try {
|
||||
auto apiLevel = std::stoi(stdoutOutput);
|
||||
return apiLevel;
|
||||
const auto pluginApiLevel = std::stoi(lastLine);
|
||||
return pluginApiLevel;
|
||||
} catch (const std::invalid_argument&) {
|
||||
ldLog() << LD_DEBUG << "Failed to understand plugin response:" << lastLine << std::endl;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -87,7 +94,12 @@ namespace linuxdeploy {
|
||||
|
||||
if (d->apiLevel != API_LEVEL) {
|
||||
std::stringstream msg;
|
||||
msg << "This class only supports API level " << API_LEVEL << ", not " << d->apiLevel;
|
||||
if (d->apiLevel < 0) {
|
||||
msg << "Could not read plugin API level";
|
||||
} else {
|
||||
msg << "This class only supports API level " << API_LEVEL << ", not " << d->apiLevel;
|
||||
}
|
||||
|
||||
throw WrongApiLevelError(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,6 +580,16 @@ namespace linuxdeploy {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool makeExecutable(const bf::path& path) {
|
||||
try {
|
||||
ldLog() << LD_DEBUG << "Making" << path << "executable" << std::endl;
|
||||
bf::permissions(path, bf::add_perms | bf::owner_exe | bf::group_exe | bf::others_exe);
|
||||
return true;
|
||||
} catch (const bf::filesystem_error& e) {
|
||||
ldLog() << LD_ERROR << "Could not set permissions for path" << path << LD_NO_SPACE << ":" << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
AppDir::AppDir(const bf::path& path) {
|
||||
@@ -764,6 +774,8 @@ namespace linuxdeploy {
|
||||
|
||||
if (!d->copyFile(customAppRunPath, path() / "AppRun"))
|
||||
return false;
|
||||
if (!d->makeExecutable(path() / "AppRun"))
|
||||
return false;
|
||||
} else {
|
||||
// check if there is a custom AppRun already
|
||||
// in that case, skip deployment of symlink
|
||||
|
||||
Reference in New Issue
Block a user