Merge branch 'mika/efi'
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 96-apt-listbugs
1 #!/bin/bash
2 # Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/96-apt-listbugs
3 # Purpose:       retreive list of bugreports of installed packages inside chroot
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 set -u
10 set -e
11
12 if [ -r $target/etc/apt/apt.conf.d/10apt-listbugs ] ; then
13   if [ -x $target/usr/sbin/apt-listbugs ] ; then
14     sed -i 's#//DPkg::#DPkg::#' $target/etc/apt/apt.conf.d/10apt-listbugs
15   fi
16 fi
17
18 set +u
19 if ifclass RELEASE ; then
20 set -u
21   HOSTNAME=''
22   [ -r /etc/grml/grml-live.conf ]  && . /etc/grml/grml-live.conf
23   [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
24   [ -n "$HOSTNAME" ] || HOSTNAME=grml
25
26   if [ -x $target/usr/sbin/apt-listbugs -a -x $target/usr/bin/apt-show-source ] && \
27      [ -x $target/etc/apt/grml/listbugs ] ; then
28      for severity in critical grave serious ; do
29          SEVERITY=$severity $ROOTCMD /etc/apt/grml/listbugs > \
30          /var/log/fai/$HOSTNAME/last/bugs.${severity} || true # make sure it does not fail
31      done
32   fi
33
34 fi
35
36 ## END OF FILE #################################################################
37 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2