summaryrefslogtreecommitdiffstats
path: root/files/slackpkg
diff options
context:
space:
mode:
authorpiterpunk <piterpunk@slackware.com>2021-10-08 15:35:20 -0300
committerRobby Workman <rworkman@slackware.com>2021-10-12 00:34:27 -0500
commit13c79b1eb2b3d64a935d89c56d53776063b56820 (patch)
tree84b8f04f87c021bedfdf53747069620bf106703a /files/slackpkg
parent9862db7e31ba8a0bc02bf93b38ef5084d7616d28 (diff)
downloadslackpkg-13c79b1eb2b3d64a935d89c56d53776063b56820.tar.xz
New exit status for different situations
To make easier to do an unattended slackpkg update/upgrade process, this commit provides different exit codes to many situations: 0 Successful slackpkg execution. 1 Something wrong happened. 20 No package found to be downloaded, installed, reinstalled, upgraded, or removed. 50 Slackpkg itself was upgraded and you need to re-run it. 100 There are pending updates. Code and the main manpage are updated accordingly. In addition, this commit also: - removes the ChangeLog.txt in doinst.sh, so the needed 'slackpkg update' after Slackpkg upgrade won't says it's all OK and don't need to redo the package lists - removes AUTHORS from manpage. Nowadays there are code from many people in Slackpkg and shows a bit unfair to have only my and Evaldo's name listed there. Signed-off-by: Robby Workman <rworkman@slackware.com>
Diffstat (limited to 'files/slackpkg')
-rw-r--r--files/slackpkg13
1 files changed, 11 insertions, 2 deletions
diff --git a/files/slackpkg b/files/slackpkg
index f606574..de02d05 100644
--- a/files/slackpkg
+++ b/files/slackpkg
@@ -332,7 +332,7 @@ case "$CMD" in
echo "Slackpkg: No updated packages since last check."
else
echo "Slackpkg: Updated packages are available since last check." >&2
- PENDING_UPDATES=1
+ EXIT_CODE=100
fi
;;
show-changelog)
@@ -368,6 +368,7 @@ case "$CMD" in
echo -e "No packages match the pattern for install. Try:"
echo -e "\n\t$0 reinstall|upgrade $2\n"
POSTINST=off
+ EXIT_CODE=20
fi
;;
reinstall)
@@ -379,6 +380,7 @@ case "$CMD" in
echo -e "No packages match the pattern for reinstall. Try:"
echo -e "\n\t$0 install|upgrade $2\n"
POSTINST=off
+ EXIT_CODE=20
fi
;;
upgrade)
@@ -391,6 +393,7 @@ case "$CMD" in
echo -e "No packages match the pattern for upgrade. Try:"
echo -e "\n\t$0 install|reinstall $2\n"
POSTINST=off
+ EXIT_CODE=20
fi
;;
download)
@@ -404,12 +407,14 @@ case "$CMD" in
else
echo -e "No packages match the pattern for download."
POSTINST=off
+ EXIT_CODE=20
fi
;;
remove)
makelist $INPUTLIST
if [ "$LIST" = "" ]; then
echo -e "The file(s) $INPUTLIST can't be removed - package not installed.\n"
+ EXIT_CODE=20
cleanup
fi
showlist "$LIST" $CMD
@@ -423,6 +428,7 @@ case "$CMD" in
else
echo -e "No packages match the pattern for clean-system\n"
POSTINST=off
+ EXIT_CODE=20
fi
;;
upgrade-all)
@@ -432,6 +438,7 @@ case "$CMD" in
echo -e "No packages match the pattern for upgrade. Try:"
echo -e "\n\t$0 install|reinstall $2\n"
POSTINST=off
+ EXIT_CODE=20
else
showlist "$LIST" upgrade
if [ "$DOWNLOAD_ALL" = "on" ]; then
@@ -447,8 +454,9 @@ case "$CMD" in
if [ "$FOUND" != "" ]; then
getpkg $FOUND upgradepkg Upgrading
echo -e "slackpkg was upgraded - you will need start the upgrade process again...\n"
+ EXIT_CODE=50
cleanup
- exit 0
+ exit ${EXIT_CODE}
fi
for i in pkgtools aaa_glibc-solibs glibc-solibs aaa_libraries aaa_elflibs readline sed; do
FOUND=""
@@ -466,6 +474,7 @@ case "$CMD" in
echo -e "No packages match the pattern for install. Try:"
echo -e "\n\t$0 upgrade|reinstall $2\n"
POSTINST=off
+ EXIT_CODE=20
else
showlist "$LIST" install
install_pkg