[Fai-commit] r3729 - in trunk: bin lib

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Fri Aug 4 20:06:57 UTC 2006


Author: lange
Date: 2006-08-02 12:40:28 +0000 (Wed, 02 Aug 2006)
New Revision: 3729

Modified:
   trunk/bin/fai-debconf
   trunk/lib/fai-debconf-pipe
Log:
name of pipe must depend on existing directory


Modified: trunk/bin/fai-debconf
===================================================================
--- trunk/bin/fai-debconf	2006-08-02 11:02:59 UTC (rev 3728)
+++ trunk/bin/fai-debconf	2006-08-02 12:40:28 UTC (rev 3729)
@@ -59,10 +59,10 @@
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 reconfigure_packages() {
 
-     local packages p
+     local packages p pipe
 
      [ -s $LOGDIR/debconf.data ] || return # nothing to do if is size 0 or missing
-     if [ -x $target/usr/bin/debconf-get-selections -a -r $LOGDIR/debconf.old ] ; then
+     if [ -r $LOGDIR/debconf.old ] ; then
        $ROOTCMD debconf-get-selections > $LOGDIR/debconf.new
        diff --changed-group-format="%>" --unchanged-line-format="" \
          $LOGDIR/debconf.old $LOGDIR/debconf.new > $LOGDIR/debconf.data
@@ -73,7 +73,12 @@
 	 if [ -f $target/var/lib/dpkg/info/$p.list ]; then
 	     echo "Reconfiguring package $p"
        /usr/lib/fai/fai-debconf-pipe $p &
-       DEBCONF_PIPE=/var/run/fai/debconf.pipe DEBIAN_FRONTEND=passthrough $ROOTCMD dpkg-reconfigure $p
+       if [ -d $target/var/run/fai/ ]; then
+	   pipe=/tmp/debconf.pipe
+       else
+	   pipe=$target/var/run/fai/debconf.pipe
+       fi
+       DEBCONF_PIPE=$pipe DEBIAN_FRONTEND=passthrough $ROOTCMD dpkg-reconfigure $p
 	 else
 	     :
 	     # for debugging only
@@ -86,7 +91,7 @@
 
     local ex=$1
     cat <<-EOF
-    fai-debconf $version. Copyright (C) 2005 Thomas Lange
+    fai-debconf $version. Copyright (C) 2005-2006 Thomas Lange
     Report bugs to <fai at informatik.uni-koeln.de>.
 
     Usage: fai-debconf [OPTION] DIRECTORY
@@ -115,6 +120,6 @@
     exit 9
 fi
 
-[ $forcereconf -eq 0 ] && $ROOTCMD debconf-get-selections > $LOGDIR/debconf.old
+[ $forcereconf -eq 0 -a -x $target/usr/bin/debconf-get-selections ] && $ROOTCMD debconf-get-selections > $LOGDIR/debconf.old
 call_conf # add data to debconf database
 [ $reconf -eq 1 ] && reconfigure_packages

Modified: trunk/lib/fai-debconf-pipe
===================================================================
--- trunk/lib/fai-debconf-pipe	2006-08-02 11:02:59 UTC (rev 3728)
+++ trunk/lib/fai-debconf-pipe	2006-08-02 12:40:28 UTC (rev 3729)
@@ -24,7 +24,8 @@
 
 my $debug = $ENV{"debug"};
 
-my $PIPEFILE = $ENV{"target"}."/var/run/fai/debconf.pipe";
+# use /tmp if directory is not available
+my $PIPEFILE = (-d "$ENV{'target'}/var/run/fai/") ? "/tmp/debconf.pipe" : "$ENV{'target'}/var/run/fai/debconf.pipe";
 
 die "No package name given!\n" unless $ARGV[0];
 my $packagename = shift @ARGV;




More information about the Fai-commit mailing list