File: openqa-continuous-update

package info (click to toggle)
openqa 5.1764349525.ffb594867-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,264 kB
  • sloc: perl: 57,599; sql: 26,462; javascript: 8,466; xml: 2,229; sh: 1,705; makefile: 443; python: 249
file content (39 lines) | stat: -rwxr-xr-x 1,067 bytes parent folder | download | duplicates (4)
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