4d2051b86c41c93d9958cde9c32acdb450f8af6d
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 96-apt-listbugs
1 #!/bin/sh
2 # Filename:      /etc/grml/fai/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 # Latest change: Fri Dec 21 21:40:25 CET 2007 [mika]
8 ################################################################################
9
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 if ifclass RELEASE ; then
19
20   HOSTNAME=''
21   [ -r /etc/grml/grml-live.conf ]  && . /etc/grml/grml-live.conf
22   [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
23   [ -n "$HOSTNAME" ] || HOSTNAME=grml
24
25   if [ -r /etc/resolv.conf ] ; then
26      if [ -d $target/etc/resolvconf/run ] ; then
27         cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
28      elif [ ! -L $target/etc/resolv.conf ] ; then
29         cat /etc/resolv.conf >> $target/etc/resolv.conf
30      fi
31   fi
32
33   if [ -x $target/usr/sbin/apt-listbugs -a -x $target/usr/bin/apt-show-source ] && \
34      [ -x $target/etc/apt/grml/listbugs ] ; then
35      for severity in critical grave serious ; do
36          SEVERITY=$severity $ROOTCMD /etc/apt/grml/listbugs > \
37          /var/log/fai/$HOSTNAME/last/bugs.${severity} || true # make sure it does not fail
38      done
39   fi
40
41 fi
42
43 ## END OF FILE #################################################################