1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/bin/bash
set -e
set -o pipefail
usage() {
cat << EOF
Usage: openqa-continous-update
Trigger system update if devel:openQA is stable and contains updates
Options:
-h, --help display this help
EOF
exit "$1"
}
opts=$(getopt -o h --long help -n "$0" -- "$@") || usage 1
eval set -- "$opts"
while true; do
case "$1" in
-h | --help) usage 0 ;;
--)
shift
break
;;
*) break ;;
esac
done
# check for new packages
# note: Avoiding using a pipe here as it can lead to `[zypper] main.cc(testPipe):72 FD(1) pipe is broken`
# and `main.cc(signal_nopipe):88 Exiting on SIGPIPE..`.
repo_name=${DEVEL_OPENQA_REPOSITORY:-devel_openQA}
ref=$(zypper -n ref -r "$repo_name")
if echo "$ref" | grep -q 'is up to date' && "$(dirname "${BASH_SOURCE[0]}")"/openqa-check-devel-repo; then
# call ref independently of dup to avoid unintended vendor changes in case ref fails (see poo#112595)
zypper -n ref
zypper -n --no-refresh dup --auto-agree-with-licenses --download-in-advance
fi
|