zshrc: do not unconditionally overwrite $COLORTERM
[grml-etc-core.git] / etc / apt / grml / listbugs
1 #!/bin/sh
2 # Filename:      /etc/apt/listbugs
3 # Purpose:       display bugs of currently running system (used inside grml-live)
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 ################################################################################
8
9 [ -n "$SEVERITY" ] || SEVERITY="critical,grave,serious"
10
11 if ! [ -x /usr/sbin/apt-listbugs ] ; then
12    echo "Error: /usr/sbin/apt-listbugs not available. Exiting."
13    exit 1
14 fi
15
16 if ! [ -x /usr/bin/apt-show-source ] ; then
17    echo "Error: /usr/bin/apt-show-source not available. Exiting."
18    exit 1
19 fi
20
21 if ! [ -x /usr/bin/dpkg-query ] ; then
22    echo "Error: /usr/bin/dpkg-query not available. Exiting."
23    exit 1
24 fi
25
26 if apt-show-source 1>/dev/null 2>&1 ; then
27    apt-listbugs -q -n -s $SEVERITY list \
28       $(apt-show-source | grep -v -e 'not installed' -e '--------------' -e \
29       'Version' | awk '{print $4;}' | grep -v '^[() ]*$'| sort | uniq)
30 else
31    apt-listbugs -q -n -s $SEVERITY list $(dpkg-query -W --showformat='${Package}\n')
32 fi
33
34 # $ROOTCMD apt-listbugs -s $SEVERITY list \
35 #          $(dpkg --get-selections| grep '       install' | awk '{print $1})
36
37 ## END OF FILE #################################################################