Adjust grml-buildd for new logdir structure
[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: Mon Nov 19 12:49:27 CET 2007 [mika]
8 ################################################################################
9
10 set -e
11
12 # Defaults:
13 #apt-listchanges apt-listchanges/confirm boolean false
14 #apt-listchanges apt-listchanges/email-address   string  root
15 #apt-listchanges apt-listchanges/which   select  news
16 #apt-listchanges apt-listchanges/frontend        select  pager
17 #apt-listchanges apt-listchanges/save-seen       boolean true
18 if [ -x $target/usr/bin/apt-listchanges ] ; then
19    echo 'apt-listchanges apt-listchanges/confirm boolean true' | $ROOTCMD debconf-set-selections
20    echo 'apt-listchanges apt-listchanges/which   select  both' | $ROOTCMD debconf-set-selections
21 fi
22
23 if [ -r $target/etc/apt/apt.conf.d/10apt-listbugs ] ; then
24    if [ -x $target/usr/sbin/apt-listbugs ] ; then
25       sed -i 's#//DPkg::#DPkg::#' $target/etc/apt/apt.conf.d/10apt-listbugs
26    fi
27 fi
28
29 if ifclass RELEASE ; then
30
31   HOSTNAME=''
32   [ -r /etc/grml/grml-live.conf ]  && . /etc/grml/grml-live.conf
33   [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
34   [ -n "$HOSTNAME" ] || HOSTNAME=grml
35
36   if [ -r /etc/resolv.conf ] ; then
37      if [ -r $target/etc/resolvconf/run/resolv.conf ] ; then
38         cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
39      else
40         cat /etc/resolv.conf >> $target/etc/resolv.conf
41      fi
42   fi
43
44   if [ -x $target/usr/sbin/apt-listbugs -a -x $target/usr/bin/apt-show-source ] && \
45      [ -x $target/etc/apt/grml/listbugs ] ; then
46      for severity in critical grave serious ; do
47          SEVERITY=$severity $ROOTCMD /etc/apt/grml/listbugs > \
48          /var/log/fai/$HOSTNAME/last/bugs.${severity} || true # make sure it does not fail
49      done
50   fi
51
52 fi
53
54 ## END OF FILE #################################################################