diff options
author | Erich Eckner <git@eckner.net> | 2016-04-19 16:06:12 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-04-19 16:06:38 +0200 |
commit | fa2aed931e7de6bcd630fe55fc41953b8ea364ba (patch) | |
tree | 91e793c6d28670d26d4d33429980a97371a5d569 | |
parent | 42d11ae1dd138374d6b6e942262d45cb49a831e5 (diff) | |
download | archlinuxewe-fa2aed931e7de6bcd630fe55fc41953b8ea364ba.tar.xz |
archPackagesUpdate -r|--removeAdditionalPackages neu
-rwxr-xr-x | archPackagesUpdate | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/archPackagesUpdate b/archPackagesUpdate index b4ef1ab30..c97c581b0 100755 --- a/archPackagesUpdate +++ b/archPackagesUpdate @@ -15,6 +15,7 @@ updateMe=true abortOnMakepkgError=true cleanUnsigned=false checkDbSig='-v' +rmAddPkgs=false # print help screen usage() @@ -23,7 +24,7 @@ usage() >&2 echo 'Skript zum Updaten der selbsterstellten Archlinux-Pakete' >&2 echo '' >&2 echo 'Verwendung:' - >&2 echo ' '"$0"' [ -c|--cleanUnsigned ] [ -f|--force ] [ --ignore-wrong-db-signature ] [ --no-upload ] [ --no-selfUpdate ] [ --no-abortOnMakepkgError ] [ --only $package ]' + >&2 echo ' '"$0"' [ -c|--cleanUnsigned ] [ -f|--force ] [ --ignore-wrong-db-signature ] [ --no-upload ] [ --no-selfUpdate ] [ --no-abortOnMakepkgError ] [ --only $package ] [ -r|--removeAdditionalPackages ]' >&2 echo ' -c|--cleanUnsigned: remove unsigned Packages first' >&2 echo ' -f|--force: rebuild packages even if they look up to date' >&2 echo ' --ignore-wrong-db-signature: do not verify old database signature' @@ -37,7 +38,7 @@ usage() } echo 'parse arguments ...' -eval set -- "$(getopt -o cf --long cleanUnsigned,force,ignore-wrong-db-signature,no-upload,no-selfUpdate,no-abortOnMakepkgError,only: -n "$(basename "$0")" -- "$@" || echo "usage")" +eval set -- "$(getopt -o cfr --long cleanUnsigned,force,ignore-wrong-db-signature,no-upload,no-selfUpdate,no-abortOnMakepkgError,only:,removeAdditionalPackages -n "$(basename "$0")" -- "$@" || echo "usage")" args=("$@") while true @@ -72,6 +73,10 @@ do echo '"only" erkannt' onlyPackages[${#onlyPackages[@]}]="$1" ;; + -r|--removeAdditionalPackages) + echo '"removeAdditionalPackages" erkannt' + rmAddPkgs=true + ;; --) shift break @@ -252,6 +257,16 @@ then then >&2 echo 'zu viele Pakete in "'/opt/arch${chrootArch}'" installiert:' >&2 echo "${zuvielePakete}" + if ${rmAddPkgs} + then + echo ' + echo "'"${zuvielePakete}"'" | \ + xargs -n1 sudo pacman -Rs --noconfirm + exit + ' | \ + chrootUnpriv "${chrootArch}" + fi + err=true fi if [ -n "${zuwenigePakete}" ] |