From 8bead81e18aba908a20e560233210d39f4f2a1ab Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 14 Oct 2007 11:50:25 +0200 Subject: [PATCH] /etc/apt/grml/listbugs: support non-apt-show-versions --- debian/changelog | 7 +++++++ etc/apt/grml/listbugs | 19 ++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index b20670f..14eac25 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-etc-core (0.3.34) unstable; urgency=low + + * /etc/apt/grml/listbugs: support non-apt-show-versions variant + as well. + + -- Michael Prokop Sun, 14 Oct 2007 11:49:59 +0200 + grml-etc-core (0.3.33) unstable; urgency=low * Rename /etc/apt/listbugs into /etc/apt/grml/listbugs so it diff --git a/etc/apt/grml/listbugs b/etc/apt/grml/listbugs index ea20560..942ba89 100755 --- a/etc/apt/grml/listbugs +++ b/etc/apt/grml/listbugs @@ -1,10 +1,10 @@ #!/bin/sh # Filename: /etc/apt/listbugs -# Purpose: display bugs of current running system (e.g. used inside grml-live) +# Purpose: display bugs of currently running system (used inside grml-live) # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Son Okt 14 00:21:54 CEST 2007 [mika] +# Latest change: Son Okt 14 11:49:36 CEST 2007 [mika] ################################################################################ [ -n "$SEVERITY" ] || SEVERITY="critical,grave,serious" @@ -19,9 +19,18 @@ if ! [ -x /usr/bin/apt-show-source ] ; then exit 1 fi -apt-listbugs -s $SEVERITY list \ - $(apt-show-source | grep -v -e 'not installed' -e '--------------' -e \ - 'Version' | awk '{print $4;}' | grep -v '^[() ]*$'| sort | uniq) +if ! [ -x /usr/bin/dpkg-query ] ; then + echo "Error: /usr/bin/dpkg-query not available. Exiting." + exit 1 +fi + +if apt-show-source 1>/dev/null 2>&1 ; then + apt-listbugs -q -n -s $SEVERITY list \ + $(apt-show-source | grep -v -e 'not installed' -e '--------------' -e \ + 'Version' | awk '{print $4;}' | grep -v '^[() ]*$'| sort | uniq) +else + apt-listbugs -q -n -s $SEVERITY list $(dpkg-query -W --showformat='${Package}\n') +fi # $ROOTCMD apt-listbugs -s $SEVERITY list \ # $(dpkg --get-selections| grep ' install' | awk '{print $1}) -- 2.1.4