diff options
Diffstat (limited to 'source/ap/slackpkg/files/slackpkg')
-rw-r--r-- | source/ap/slackpkg/files/slackpkg | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/ap/slackpkg/files/slackpkg b/source/ap/slackpkg/files/slackpkg index f606574a1..cc95bb08f 100644 --- a/source/ap/slackpkg/files/slackpkg +++ b/source/ap/slackpkg/files/slackpkg @@ -222,7 +222,7 @@ while [ -n "$1" ] ; do CMD=$1 shift if [ -n "$1" ]; then - if echo $1 | egrep -q "^\.{0,2}/" ; then + if echo $1 | grep -Eq "^\.{0,2}/" ; then if [ -e $1 ]; then INPUTLIST=$(cat $1 | tr "\n" " ") else @@ -328,11 +328,11 @@ case "$CMD" in check-updates) # output to stdout if no change, or stderr if changes. Will cause # cron jobs to notify system admin - if checkchangelog 1>/dev/null 2>/dev/null ; then + if checkchangelog 1>/dev/null 2>/dev/null && [ "$UPDATED" != "1" ] ; then 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) @@ -356,7 +356,6 @@ case "$CMD" in cleanup fi fi - echo "Updating the package lists..." updatefilelists ;; install) @@ -368,6 +367,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 +379,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 +392,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 +406,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 +427,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 +437,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 +453,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 +473,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 |