[Fai-commit] r3645 - in trunk: bin lib man
fai-commit at lists.alioth.debian.org
fai-commit at lists.alioth.debian.org
Sun Jul 23 09:48:30 UTC 2006
Author: lange
Date: 2006-07-23 09:48:27 +0000 (Sun, 23 Jul 2006)
New Revision: 3645
Added:
trunk/lib/fai-debconf-pipe
Modified:
trunk/bin/fai-debconf
trunk/man/fai-debconf.1
Log:
use DEBCONF_PIPE (which is a socket) for fai-debconf (closes: #307266)
Modified: trunk/bin/fai-debconf
===================================================================
--- trunk/bin/fai-debconf 2006-07-23 08:49:52 UTC (rev 3644)
+++ trunk/bin/fai-debconf 2006-07-23 09:48:27 UTC (rev 3645)
@@ -26,7 +26,7 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#*********************************************************************
-version="version 1.1, 27-mar-2006"
+version="version 1.2, 23-july-2006"
# variables needed: $classes, $ROOTCMD, $LOGDIR, $target
@@ -62,12 +62,18 @@
local packages p
[ -s $LOGDIR/debconf.data ] || return # nothing to do if is size 0 or missing
+ if [ -x /usr/bin/diff -a -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
+ fi
packages=$(awk '{print $1}' $LOGDIR/debconf.data | sort | uniq)
for p in $packages; do
# test if package is installed
if [ -f $target/var/lib/dpkg/info/$p.list ]; then
echo "Reconfiguring package $p"
- DEBCONF_FRONTEND=noninteractive $ROOTCMD dpkg-reconfigure $p
+ $ROOTCMD /usr/bin/fai-debconf-pipe $p &
+ DEBCONF_PIPE=/var/run/fai/debconf.pipe DEBIAN_FRONTEND=passthrough $ROOTCMD dpkg-reconfigure $p
else
:
# for debugging only
@@ -91,11 +97,13 @@
# main program
reconf=1 # call dpkg-reconfigure by default
-while getopts "hvs" opt ; do
+forcereconf=0 # don't call dpkg-reconfigure for unchanged packages
+while getopts "hvsf" opt ; do
case "$opt" in
h) usage 0 ;;
s) reconf=0 ;;
v) verbose=1 ;;
+ f) forcereconf=1 ;;
esac
done
shift $(($OPTIND - 1))
@@ -107,5 +115,6 @@
exit 9
fi
+[ $forcereconf -eq 0 ] && $ROOTCMD debconf-get-selections > $LOGDIR/debconf.old
call_conf # add data to debconf database
[ $reconf -eq 1 ] && reconfigure_packages
Copied: trunk/lib/fai-debconf-pipe (from rev 3644, people/michael/bugfixes/307266/scripts/fai-debconf-pipe)
Modified: trunk/man/fai-debconf.1
===================================================================
--- trunk/man/fai-debconf.1 2006-07-23 08:49:52 UTC (rev 3644)
+++ trunk/man/fai-debconf.1 2006-07-23 09:48:27 UTC (rev 3645)
@@ -1,5 +1,5 @@
.\" Hey, EMACS: -*- nroff -*-
-.TH fai-debconf 1 "10 march 2005" "FAI 2.7"
+.TH fai-debconf 1 "23 july 2006" "FAI 3"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -36,6 +36,10 @@
.TP
.B \-v
Create verbose output.
+.TP
+.B \-f
+Run dpkg-reconfigure for all packages FAI has information for, not only for
+those we modified the entries in the database.
.SH SEE ALSO
.BR debconf-get-selections (1),
.BR debconf-set-selections (1),
More information about the Fai-commit
mailing list