File fix-disable-self-update.patch of Package AppImageUpdate
diff -ruNp a/src/cli/main.cpp b/src/cli/main.cpp
--- a/src/cli/main.cpp
+++ b/src/cli/main.cpp
@@ -28,7 +28,6 @@ int main(const int argc, const char** ar
{"overwriteOldFile", {"-O", "--overwrite"}, "Overwrite existing file. If not specified, a new file will be created, and the old one will remain untouched."},
{"removeOldFile", {"-r", "--remove-old"}, "Remove old AppImage after successful update."},
{"updateInfo", {"-u", "--update-info"}, "Manually override update information in the AppImage.", 1},
- {"selfUpdate", {"--self-update"}, "Update this AppImage."},
}};
argagg::parser_results args;
@@ -66,33 +65,6 @@ int main(const int argc, const char** ar
return optional<string>();
}();
- // if a self-update is requested, check whether the path argument has been passed, and show an error
- // otherwise check whether path has been passed on the CLI, otherwise show file chooser
- if (args["selfUpdate"]) {
- if (pathToAppImage.has_value()) {
- cerr << "Error: --self-update does not take a path." << endl;
- showUsage();
- return EXIT_FAILURE;
- } else {
- auto* APPIMAGE = getenv("APPIMAGE");
-
- if (APPIMAGE == nullptr) {
- cerr << "Error: self update requested but could not determine path to AppImage "
- << "($APPIMAGE environment variable missing)."
- << endl;
- return 1;
- }
-
- if (!isFile(APPIMAGE)) {
- cerr << "Error: $APPIMAGE pointing to non-existing file:\n"
- << APPIMAGE << endl;
- return 1;
- }
-
- pathToAppImage = APPIMAGE;
- }
- }
-
if (!pathToAppImage.has_value()) {
showUsage();
return EXIT_FAILURE;
diff -ruNp a/src/qt-ui/main.cpp b/src/qt-ui/main.cpp
--- a/src/qt-ui/main.cpp
+++ b/src/qt-ui/main.cpp
@@ -41,9 +41,6 @@ int main(int argc, char** argv) {
);
parser.addOption(checkForUpdate);
- QCommandLineOption selfUpdate("self-update", "Update the tool itself and exit.");
- parser.addOption(selfUpdate);
-
parser.addPositionalArgument("path", "Path to AppImage that should be updated", "<path>");
QStringList arguments;
@@ -63,23 +60,6 @@ int main(int argc, char** argv) {
appimage::update::qt::QtUpdater* updater;
- // if a self-update is requested, check whether the path argument has been passed, and show an error
- // otherwise check whether path has been passed on the CLI, otherwise show file chooser
- if (parser.isSet(selfUpdate)) {
- if (!parser.positionalArguments().empty()) {
- cerr << "Error: --self-update does not take a path." << endl;
- parser.showHelp(1);
- } else {
- updater = appimage::update::qt::QtUpdater::fromEnv();
-
- if (updater == nullptr) {
- cerr << "Error: self update requested but could not determine path to AppImage "
- << "($APPIMAGE environment variable missing)."
- << endl;
- return 1;
- }
- }
- } else {
if (!parser.positionalArguments().empty()) {
pathToAppImage = parser.positionalArguments().front();
} else {
@@ -99,7 +79,6 @@ int main(int argc, char** argv) {
pathToAppImage = QFileInfo(pathToAppImage).absoluteFilePath();
updater = new appimage::update::qt::QtUpdater(pathToAppImage);
- }
if (parser.isSet(checkForUpdate))
return updater->checkForUpdates(true);