summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-11-09 21:10:25 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-11-09 21:10:25 +0000
commit6cb4daa56408c342d85df8e567581972fe7ba4c1 (patch)
tree99e420fb3f660de52b0a7bf80d1dadf9e232bcbd
parent9143739749bbabf33fcbf7d89667fc8ccf38d6a7 (diff)
refuse to install/uninstall/force-uninstall/search if no package name is given
-rw-r--r--src/backend/libsisyphus.py2
-rwxr-xr-xsrc/frontend/cli/sisyphus-cli.py20
2 files changed, 17 insertions, 5 deletions
diff --git a/src/backend/libsisyphus.py b/src/backend/libsisyphus.py
index 5f18bae..ae6bd93 100644
--- a/src/backend/libsisyphus.py
+++ b/src/backend/libsisyphus.py
@@ -235,7 +235,7 @@ def startInstall(pkgList):
portageExec.wait()
syncLocalDatabase()
else:
- sys.exit("\n" + "Nothing to install; quitting." + "\n")
+ sys.exit("\n" + "No such binary; quitting." + "\n")
def startUpgrade():
syncAll()
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py
index e7637cb..ff68593 100755
--- a/src/frontend/cli/sisyphus-cli.py
+++ b/src/frontend/cli/sisyphus-cli.py
@@ -8,11 +8,20 @@ pkgList = sys.argv[2:]
if "__main__" == __name__:
if sys.argv[1:]:
if "install" in sys.argv[1:]:
- startInstall(pkgList)
+ if not pkgList:
+ sys.exit("\n" + "Nothing to install, please give at least one package name; quitting" + "\n")
+ else:
+ startInstall(pkgList)
elif "uninstall" in sys.argv[1:]:
- startUninstall(pkgList)
+ if not pkgList:
+ sys.exit("\n" + "Nothing to uninstall, please give at least one package name; quitting" + "\n")
+ else:
+ startUninstall(pkgList)
elif "force-uninstall" in sys.argv[1:]:
- startUninstallForce(pkgList)
+ if not pkgList:
+ sys.exit("\n" + "Nothing to force uninstall, please give at least one package name; quitting" + "\n")
+ else:
+ startUninstallForce(pkgList)
elif "remove-orphans" in sys.argv[1:]:
removeOrphans()
elif "update" in sys.argv[1:]:
@@ -20,7 +29,10 @@ if "__main__" == __name__:
elif "upgrade" in sys.argv[1:]:
startUpgrade()
elif "search" in sys.argv[1:]:
- startSearch(pkgList)
+ if not pkgList:
+ sys.exit("\n" + "Nothing to search, please give at least one package name; quitting" + "\n")
+ else:
+ startSearch(pkgList)
elif "spmsync" in sys.argv[1:]:
startSyncSPM()
elif "rescue" in sys.argv[1:]: