[Fai-commit] r3899 - trunk/bin
fai-commit at lists.alioth.debian.org
fai-commit at lists.alioth.debian.org
Fri Sep 8 12:18:44 UTC 2006
Author: lange
Date: 2006-09-08 12:18:44 +0000 (Fri, 08 Sep 2006)
New Revision: 3899
Modified:
trunk/bin/fai-debconf
Log:
use read-only temp file instead of pipe
Modified: trunk/bin/fai-debconf
===================================================================
--- trunk/bin/fai-debconf 2006-09-08 12:18:21 UTC (rev 3898)
+++ trunk/bin/fai-debconf 2006-09-08 12:18:44 UTC (rev 3899)
@@ -26,7 +26,7 @@
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#*********************************************************************
-version="version 1.2.2, 1-september-2006"
+version="version 1.3, 8-september-2006"
# variables needed: $classes, $ROOTCMD, $LOGDIR, $target
@@ -59,7 +59,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
reconfigure_packages() {
- local packages p pipe
+ local packages p tmpdb
[ -s $LOGDIR/debconf.data ] || return # nothing to do if is size 0 or missing
if [ -r $LOGDIR/debconf.old ] ; then
@@ -68,23 +68,21 @@
$LOGDIR/debconf.old $LOGDIR/debconf.new > $LOGDIR/debconf.data
fi
packages=$(awk '{print $1}' $LOGDIR/debconf.data | sort | uniq)
+ # backup database
+ tmpdb=$($ROOTCMD mktemp)
+ $ROOTCMD debconf-copydb configdb faidb --config=Name:faidb --config=Driver:File --config=Filename:$tmpdb
for p in $packages; do
# test if package is installed
if [ -f $target/var/lib/dpkg/info/$p.list ]; then
echo "Reconfiguring package $p"
- if [ ! -d $target/var/run/fai/ ]; then
- pipe=/tmp/debconf.pipe
- else
- pipe=/var/run/fai/debconf.pipe
- fi
- DEBCONF_PIPE=$pipe /usr/lib/fai/fai-debconf-pipe $p &
- DEBCONF_PIPE=$pipe DEBIAN_FRONTEND=passthrough $ROOTCMD dpkg-reconfigure $p
+ DEBCONF_DB_OVERRIDE="File{$tmpdb readonly:true}" DEBIAN_FRONTEND=noninteractive $ROOTCMD /usr/sbin/dpkg-reconfigure $p
else
:
# for debugging only
# echo "Package $p is not yet installed. Skipping reconfiguration."
fi
done
+ rm $target/$tmpdb
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
usage() {
More information about the Fai-commit
mailing list