summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorK Jonathan Harker <jharker@suse.com>2017-11-03 10:14:30 -0700
committerK Jonathan Harker <code@gentlydownthe.net>2017-12-05 22:59:20 +0000
commit7470ee26e03e484c807e7b49a1ae6ad21242c3a2 (patch)
tree53bf2aad4bb7e6409a0497ab48ebaca5954b2940
parent3c8e42415081b6d25bf89cfb19d1e1cd8f999796 (diff)
zypper: fix package removal
zypper only supports the --no-recommends option during installs, giving the option during removals results in an error. When setting ACTION=remove, remove --no-recommends from EXTRA_ARGS, and set --clean-deps to also remove no-longer-needed dependencies. Rename EXTRA_ARGS to ACTION_ARGS for increased readability. Change-Id: Ifbd168992b1a20658b6b4a99ba175234f6c78f6d
Notes
Notes (review): Code-Review+2: Ian Wienand <iwienand@redhat.com> Code-Review+1: Dirk Mueller <dirk@dmllr.de> Workflow+1: Ian Wienand <iwienand@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 06 Dec 2017 05:42:28 +0000 Reviewed-on: https://review.openstack.org/517658 Project: openstack/diskimage-builder Branch: refs/heads/master
-rwxr-xr-xdiskimage_builder/elements/zypper/bin/install-packages8
1 files changed, 4 insertions, 4 deletions
diff --git a/diskimage_builder/elements/zypper/bin/install-packages b/diskimage_builder/elements/zypper/bin/install-packages
index 6d61d61..aa56c8d 100755
--- a/diskimage_builder/elements/zypper/bin/install-packages
+++ b/diskimage_builder/elements/zypper/bin/install-packages
@@ -20,9 +20,9 @@ fi
20set -eu 20set -eu
21set -o pipefail 21set -o pipefail
22 22
23EXTRA_ARGS="--no-recommends"
24MAP_ELEMENT= 23MAP_ELEMENT=
25ACTION=install 24ACTION=install
25ACTION_ARGS="--no-recommends"
26 26
27SCRIPTNAME=$(basename $0) 27SCRIPTNAME=$(basename $0)
28function show_options () { 28function show_options () {
@@ -48,8 +48,8 @@ eval set -- "$TEMP"
48while true ; do 48while true ; do
49 case "$1" in 49 case "$1" in
50 -u) run_zypper dist-upgrade --no-recommends; exit 0;; 50 -u) run_zypper dist-upgrade --no-recommends; exit 0;;
51 -e) ACTION="remove"; shift;; 51 -e) ACTION="remove"; ACTION_ARGS="--clean-deps"; shift;;
52 -d) EXTRA_ARGS="--download-only"; shift;; 52 -d) ACTION_ARGS="${ACTION_ARGS} --download-only"; shift;;
53 -m) MAP_ELEMENT=$2; shift 2;; 53 -m) MAP_ELEMENT=$2; shift 2;;
54 -h) show_options;; 54 -h) show_options;;
55 --) shift; break ;; 55 --) shift; break ;;
@@ -68,5 +68,5 @@ fi
68if [ -z "${PKGS}" ]; then 68if [ -z "${PKGS}" ]; then
69 echo "Not running install-packages $ACTION with empty packages list" 69 echo "Not running install-packages $ACTION with empty packages list"
70else 70else
71 run_zypper $ACTION $EXTRA_ARGS $PKGS 71 run_zypper $ACTION $ACTION_ARGS $PKGS
72fi 72fi