[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debconf/frontend versus DEBIAN_FRONTEND



Am Mi, 22. Sep 2004, 18:59:02 +0200 schrieb Jö Fahlke:
> My plan is to not automagically set any variables if the corresponding
> debconf option is set in the database.  Since these variables are set
> from scripts in run-parts-style directories it's probably easiest to
> use a seperate skript which tests if a single debconf option is set.
> Is that kind of skript already available?

Patch for DEBCONF_FRONTEND is attached.

I'ts totally untested at the moment since my I don't want to test it
on my work machine and the sparc box is not installed, so I can't
build d-i there.

I had to create debconf-fget in packages/debian-installer/utils,
shamelessly copying from debconf-get.  Since I don't see how
debconf-get is installed in di-utils, I assume it happens
automagically and that the same magic will pickup debconf-fget as
well...

Jö.

-- 
Of all the things I've lost, I miss my mind the most.
Index: packages/rootskel/src/lib/debian-installer.d/S60frontend
===================================================================
--- packages/rootskel/src/lib/debian-installer.d/S60frontend	(revision 21951)
+++ packages/rootskel/src/lib/debian-installer.d/S60frontend	(working copy)
@@ -1,9 +1,9 @@
-if [ -z "$DEBIAN_FRONTEND" ] ; then
-    for frontend in gtk newt slang text ; do
-        if [ -e "/usr/lib/cdebconf/frontend/$frontend.so" ] ; then
-            DEBIAN_FRONTEND=$frontend
-            break
+if [ "x`debconf-fget debconf/frontend seen`" != xtrue ]
+then for frontend in "`debconf-get debconf/frontend`" gtk newt slang text
+     # try debconf default and some others
+     do if [ -e "/usr/lib/cdebconf/frontend/$frontend.so" ]
+        then debconf-set debconf/frontend "frontend"
+	     break
         fi
-    done
+     done
 fi
-export DEBIAN_FRONTEND
Index: packages/debian-installer-utils/debconf-fget
===================================================================
--- packages/debian-installer-utils/debconf-fget	(revision 0)
+++ packages/debian-installer-utils/debconf-fget	(revision 0)
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+# TODO move to cdebconf, reimplement so it's not shite
+
+if [ -n "$TO_GET" ] && [ -n "$FLAG" ]; then
+	. /usr/share/debconf/confmodule
+	db_fget "$TO_GET" "$FLAG"
+	echo $RET 1>&2
+else
+	(TO_GET="$1" FLAG="$2" "$0" >/dev/null) 2>&1
+fi

Property changes on: packages/debian-installer-utils/debconf-fget
___________________________________________________________________
Name: svn:executable
   + *

Attachment: signature.asc
Description: Digital signature


Reply to: