X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fpackaging%2Funinstall-rpm.sh;h=0b339a86f2224707bece5ef501198f3ee1e61590;hb=6d6d1587319565527cf6de0677a7e34b83a12c6e;hp=1d62ede1b41f44d732f99c064259b13e03ad359b;hpb=2e87f7f4dde62e5341bf155c0c3b0020c56a934e;p=releng%2Fbuilder.git diff --git a/jjb/packaging/uninstall-rpm.sh b/jjb/packaging/uninstall-rpm.sh index 1d62ede1b..0b339a86f 100644 --- a/jjb/packaging/uninstall-rpm.sh +++ b/jjb/packaging/uninstall-rpm.sh @@ -6,14 +6,31 @@ # -o pipefail: Fail on errors in scripts this calls, give stacktrace set -ex -o pipefail -# Uninstall ODL -sudo yum remove -y opendaylight +if [ -f /usr/bin/yum ]; then + # Uninstall ODL + sudo yum remove -y opendaylight -# Verify ODL not installed -if yum list installed opendaylight; then - # Fail if exit code 0, ie ODL is still installed - echo "OpenDaylight unexpectedly still installed" - exit 1 + # Verify ODL not installed + if yum list installed opendaylight; then + # Fail if exit code 0, ie ODL is still installed + echo "OpenDaylight unexpectedly still installed" + exit 1 + else + echo "OpenDaylight not installed, as expected" + fi +elif [ -f /usr/bin/zypper ]; then + # Uninstall ODL + sudo zypper -n remove opendaylight + + # Verify ODL not installed + if zypper search --installed-only opendaylight; then + # Fail if exit code 0, ie ODL is still installed + echo "OpenDaylight unexpectedly still installed" + exit 1 + else + echo "OpenDaylight not installed, as expected" + fi else - echo "OpenDaylight not installed, as expected" + echo "The package manager is not supported (not yum or zypper)" + exit 1 fi