diff options
author | Erich Eckner <git@eckner.net> | 2016-04-06 21:43:35 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-04-11 11:29:19 +0200 |
commit | baad9999d45fa6d0bef8747b8fc6527e49fe56f2 (patch) | |
tree | ab82b504e052ad1bc7f4dd003caa56ff4bda5e35 | |
parent | 1b2b0bad86f3d89dcb706469f89fac2605fef353 (diff) | |
download | archlinuxewe-baad9999d45fa6d0bef8747b8fc6527e49fe56f2.tar.xz |
Option zum Nichtabbrechen bei makepkg-Fehler
-rwxr-xr-x | archPackagesUpdate | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/archPackagesUpdate b/archPackagesUpdate index 9e53dddd5..57d70f020 100755 --- a/archPackagesUpdate +++ b/archPackagesUpdate @@ -11,6 +11,7 @@ pkgSrcDir="$(dirname $(readlink -f -n "$0"))" force=false upload=true updateMe=true +abortOnMakepkgError=true # print help screen usage() @@ -19,16 +20,17 @@ usage() >&2 echo 'Skript zum Updaten der selbsterstellten Archlinux-Pakete' >&2 echo '' >&2 echo 'Verwendung:' - >&2 echo ' '"$0"' [ -f|--force ] [ --no-upload ] [ --no-selfUpdate ]' - >&2 echo ' -f|--force: rebuild packages even if they look up to date' - >&2 echo ' --no-upload: do not upload built packages from rechenknecht to jeti100' - >&2 echo ' --no-selfUpdate: do not update this script from git' + >&2 echo ' '"$0"' [ -f|--force ] [ --no-upload ] [ --no-selfUpdate ] [ --no-abortOnMakepkgError ]' + >&2 echo ' -f|--force: rebuild packages even if they look up to date' + >&2 echo ' --no-upload: do not upload built packages from rechenknecht to jeti100' + >&2 echo ' --no-selfUpdate: do not update this script from git' + >&2 echo ' --no-abortOnMakepkgError: do not abort when makepkg returns non-zero' >&2 echo '' exit 1 } # parse arguments -eval set -- "$(getopt -o f --long force,no-upload,no-selfUpdate -n "$(basename "$0")" -- "$@" || echo "usage")" +eval set -- "$(getopt -o f --long force,no-upload,no-selfUpdate,no-abortOnMakepkgError -n "$(basename "$0")" -- "$@" || echo "usage")" while true do @@ -45,6 +47,10 @@ do updateMe=false shift ;; + --no-abortOnMakepkgError) + abortOnMakepkgError=false + shift + ;; --) shift break @@ -127,6 +133,7 @@ done if ${aufRechenknecht} then sudo pacman -Syy + err=0 # build packages for ((i=0; i<${#pakete[@]}; i++)) @@ -142,14 +149,18 @@ then then # 32-bit is built in chroot echo 'cd "'"${tmpDir}/${paket}"'" && makepkg -fcsr --noconfirm && exit' | \ - chrootUnpriv || exit $? + chrootUnpriv + tmpErr=$? else # everything else is built directly - makepkg -fcsr --noconfirm || exit $? + makepkg -fcsr --noconfirm + tmpErr=$? fi + ${abortOnMakepkgError} && [ ${tmpErr} -ne 0 ] && exit ${tmpErr} + [ ${tmpErr} -gt ${err} ] && err=${tmpErr} # upload packages - if ${upload} + if ${upload} && [ ${tmpErr} -eq 0 ] then scp ${tmpDir}/${paket}/${paket}-${vers}-${arch}.pkg.tar.xz paule@127.0.0.1:${pkgDir}/${arch}/ [ "${arch}" == "any" ] && ssh paule@127.0.0.1 '\ @@ -165,6 +176,8 @@ then fi done + [ ${err} -ne 0 ] && exit ${err} + # update packagedb if ${upload} then |