X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/7a1b1f8bd649113e99ecef0489e2f2194e283d1e..fb473b5ac9fb661004c5d25c276da74d05d08563:/dselect/install diff --git a/dselect/install b/dselect/install index 7c4237458..2481fcea1 100755 --- a/dselect/install +++ b/dselect/install @@ -5,14 +5,14 @@ CLEAN="auto" OPTS="-f" APTGET="/usr/bin/apt-get" DPKG="/usr/bin/dpkg" -sh -e +set -e RES=`apt-config shell CLEAN DSelect::Clean OPTS DSelect::Options \ DPKG Dir::Bin::dpkg APTGET Dir::Bin::apt-get` eval $RES -sh +e +set +e # Yes/No Prompter -function yesno() { +yesno() { # $1 = prompt # $2 = default(y) local ans def defp @@ -37,7 +37,7 @@ function yesno() { echo $ans | tr YN yn } -#$APTGET $OPTS dselect-upgrade +$APTGET $OPTS dselect-upgrade RES=$? # 1 means the user choose no at the prompt @@ -49,7 +49,10 @@ fi if [ $RES -eq 0 ]; then # Check the cleaning mode case `echo $CLEAN | tr '[:upper:]' '[:lower:]'` in - always|auto) + auto) + $APTGET autoclean && echo "Press enter to continue." && read RES && exit 0; + ;; + always) $APTGET clean && echo "Press enter to continue." && read RES && exit 0; ;; prompt)