summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@debian.org>2017-03-30 17:40:16 +0200
committerHolger Levsen <holger@layer-acht.org>2017-03-30 17:59:51 +0200
commit79c4c28f25c71ce9147530e16a11b3e7230d4b79 (patch)
tree039b8aab95c1344c843dc2c25bc8b0267d395a56
parent1f627b1f21be0286c879a90b75186a21493cef81 (diff)
downloadjenkins.debian.net-79c4c28f25c71ce9147530e16a11b3e7230d4b79.tar.xz
update_jdn: use dpkg-query instead of grepping dpkg -l output
Signed-off-by: Mattia Rizzolo <mattia@debian.org> Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-xupdate_jdn.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/update_jdn.sh b/update_jdn.sh
index 0ca153d1..aa0216cc 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -487,7 +487,7 @@ if [ -f /etc/debian_version ] ; then
$UP2DATE || ( sudo cp --preserve=mode,timestamps -r hosts/$HOSTNAME/etc/apt/sources.list /etc/apt ; sudo apt-get update )
$UP2DATE || sudo apt-get install $DEBS $MASTERDEBS
# dont (re-)install pbuilder if it's on hold
- if [ ! -n "$(dpkg -l pbuilder | egrep '^hi.*pbuilder')" ] ; then
+ if [ $(dpkg-query -W -f='${db:Status-Abbrev}\n' pbuilder) != hi ] ; then
case $HOSTNAME in
codethink*) $UP2DATE || sudo apt-get install -t jessie-backports pbuilder
;;
@@ -497,7 +497,7 @@ if [ -f /etc/debian_version ] ; then
esac
fi
# remove unattended-upgrades if it's installed
- if [ -n "$(dpkg -l unattended-upgrades 2>/dev/null|egrep 'ii.*unattended-upgrades')" ] ; then
+ if [ $(dpkg-query -W -f='${db:Status-Abbrev}\n' unattended-upgrades 2>/dev/null || true) = ii ] ; then
sudo apt-get -y purge unattended-upgrades
fi
# we need mock from bpo to build current fedora