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

Re: dashslashdash d-i patches



Joey Hess wrote:
> Philip Hands wrote:
> 
>>Of course, since going down this route, I've also created a script
>>(dsd_fetch_file) that includes the fetching code from preseed to allow
>>scripts to easily grab files from the same source as the preseed files -- I
>>think if we split the code in preseed out into a fetch_file script which
>>was then invoked by preseed.sh and also available for scripts, the need for
>>the horror of dsd:// urls might well evaporate.
> 
> preseed.sh is already a function library that such a script can source.

Makes sense.

I'll see if I can move my bits into preseed.sh in a generically useful way.

Other than that, I've switched over to using a new "preseed/run" setting to
 do what I was doing with the executable include files. (diff attached)

I've also added preseed/run_command (that works similarly to
preseed/include_command), but have not yet come up with a reason to use it.
 The code is just a cut&paste job, and includes the checksum code, which
I've not made any attempt to test.

I didn't call it preseed/run_script (as Joey had suggested) since there's
nothing stopping one from specifying an executable, so the "script" bit is
somewhat misleading.

BTW The diff also includes my patches to the kbd & locale choosers for
delaying  them until after the network comes up.

Cheers, Phil.
Index: kbd-chooser/debian/kbd-chooser.isinstallable
===================================================================
--- kbd-chooser/debian/kbd-chooser.isinstallable	(.../trunk/packages)	(revision 0)
+++ kbd-chooser/debian/kbd-chooser.isinstallable	(.../people/philh/etch/packages)	(revision 36093)
@@ -0,0 +1,4 @@
+#!/bin/sh
+. /usr/share/debconf/confmodule
+db_get dsd/awaiting_preseed && [ "$RET" = true ] && exit 1
+exit 0

Property changes on: kbd-chooser/debian/kbd-chooser.isinstallable
___________________________________________________________________
Name: svn:executable
   + *

Index: kbd-chooser/debian/changelog
===================================================================
--- kbd-chooser/debian/changelog	(.../trunk/packages)	(revision 36093)
+++ kbd-chooser/debian/changelog	(.../people/philh/etch/packages)	(revision 36093)
@@ -1,3 +1,11 @@
+kbd-chooser (1:1.25-0.hands.1) UNRELEASED; urgency=low
+
+  * add an isinstallable script to allow this to be delayed for 
+    preseeding
+  * add an epoch to prevent this being replaced by upstream upgrades
+
+ -- Philip Hands <phil@deasil.hands.com>  Tue, 21 Mar 2006 22:24:38 +0000
+
 kbd-chooser (1.25) unstable; urgency=low
 
   * No longer offer mac-usb keymaps; force any usb keyboard to use AT
Index: kbd-chooser/debian/rules
===================================================================
--- kbd-chooser/debian/rules	(.../trunk/packages)	(revision 36093)
+++ kbd-chooser/debian/rules	(.../people/philh/etch/packages)	(revision 36093)
@@ -30,6 +30,7 @@
 	dh_testdir
 	dh_testroot
 	dh_installdebconf
+	cp debian/kbd-chooser.isinstallable debian/kbd-chooser/DEBIAN/isinstallable
 	dh_link
 	dh_strip
 	dh_fixperms
Index: localechooser/debian/changelog
===================================================================
--- localechooser/debian/changelog	(.../trunk/packages)	(revision 36093)
+++ localechooser/debian/changelog	(.../people/philh/etch/packages)	(revision 36093)
@@ -1,3 +1,10 @@
+localechooser (1:1.09-0.hands.1) UNRELEASED; urgency=low
+
+  * add localchooser/delaypostinst to enable preseeding this
+  * use epoch to keep this from being overriden by upstream updates
+
+ -- Philip Hands <phil@hands.com>  Tue, 21 Mar 2006 20:58:19 +0000
+
 localechooser (1.09) UNRELEASED; urgency=low
 
   * Add Thai to the list of languages (commented)
Index: localechooser/debian/localechooser.isinstallable
===================================================================
--- localechooser/debian/localechooser.isinstallable	(.../trunk/packages)	(revision 0)
+++ localechooser/debian/localechooser.isinstallable	(.../people/philh/etch/packages)	(revision 36093)
@@ -0,0 +1,4 @@
+#!/bin/sh
+. /usr/share/debconf/confmodule
+db_get dsd/awaiting_preseed && [ "$RET" = true ] && exit 1
+exit 0

Property changes on: localechooser/debian/localechooser.isinstallable
___________________________________________________________________
Name: svn:executable
   + *

Index: localechooser/debian/rules
===================================================================
--- localechooser/debian/rules	(.../trunk/packages)	(revision 36093)
+++ localechooser/debian/rules	(.../people/philh/etch/packages)	(revision 36093)
@@ -38,6 +38,7 @@
 	dh_testdir
 	dh_testroot
 	dh_installdebconf
+	cp debian/localechooser.isinstallable debian/localechooser/DEBIAN/isinstallable
 	dh_strip
 	dh_compress
 	dh_fixperms
Index: preseed/preseed.sh
===================================================================
--- preseed/preseed.sh	(.../trunk/packages)	(revision 36093)
+++ preseed/preseed.sh	(.../people/philh/etch/packages)	(revision 36093)
@@ -33,6 +33,8 @@
 
 	db_set preseed/include ""
 	db_set preseed/include_command ""
+	db_set preseed/run ""
+	db_set preseed/run_command ""
 	UNSEEN=
 	db_get preseed/interactive
 	if [ "$RET" = true ]; then
@@ -51,6 +53,27 @@
 
 	log "successfully loaded preseed file from $location"
 	local last_location="$location"
+
+	db_get preseed/run
+	local torun="$RET"
+	db_get preseed/run_command
+	if [ -n "$RET" ]; then
+		torun="$torun $(eval $RET)" || true # TODO error handling?
+	fi
+	for location in $torun; do
+		local tmp=/tmp/debconf-torun
+		local stderrlog=/var/log/$(echo "$location"|tr '/|' '_').stderr
+		if preseed_relative "$location"; then
+			# This works for urls too.
+			location="$(dirname $last_location)/$location"
+		fi
+  		preseed_fetch "$location" "$tmp"
+		chmod +x $tmp
+		if ! $tmp 2> $stderrlog ; then
+			error run_error "$location"
+		fi
+		rm -f $tmp
+	done
 	
 	db_get preseed/include
 	local include="$RET"
Index: preseed/debian/changelog
===================================================================
--- preseed/debian/changelog	(.../trunk/packages)	(revision 36093)
+++ preseed/debian/changelog	(.../people/philh/etch/packages)	(revision 36093)
@@ -1,3 +1,26 @@
+preseed (1:1.15-0.hands.3) UNRELEASED; urgency=low
+
+  * get rid of dsd:// code, and the optional & substitution flags in URLs
+    since the same can now be achieved with preseed/run commands
+
+ -- Philip Hands <phil@hands.com>  Mon,  3 Apr 2006 12:29:08 +0100
+
+preseed (1:1.15-0.hands.2) UNRELEASED; urgency=low
+
+  * add code to implement preseed/run{,_command} function
+  * make the dsd:// magic keep track of when it works, and save the
+    URL that worked so it doesn't have to keep trying pointlessly
+  * add an epoch to prevent this being replaced by upstream upgrades
+
+ -- Philip Hands <phil@hands.com>  Mon,  3 Apr 2006 12:03:23 +0100
+
+preseed (1.15-0.hands.1) UNRELEASED; urgency=low
+
+  * patched to work with the http://hands.com/d-i/ scripts
+    adds executable and optional preseed files
+
+ -- Philip Hands <phil@hands.com>  Mon, 20 Mar 2006 20:51:10 +0000
+
 preseed (1.15) unstable; urgency=low
 
   [ Geert Stappers ]
Index: preseed/debian/preseed-common.templates
===================================================================
--- preseed/debian/preseed-common.templates	(.../trunk/packages)	(revision 36093)
+++ preseed/debian/preseed-common.templates	(.../people/philh/etch/packages)	(revision 36093)
@@ -40,6 +40,21 @@
 # Not translatable because it's only to be preseeded.
 Description: shell command to run that may output a list of preseed files to load
 
+Template: preseed/run
+Type: string
+# Not translatable because it's only to be preseeded.
+Description: files to be obtained & run
+
+Template: preseed/run/checksum
+Type: string
+# Not translatable because it's only to be preseeded.
+Description: md5sums of files to be run
+
+Template: preseed/run_command
+Type: string
+# Not translatable because it's only to be preseeded.
+Description: shell command to run that may output a list of files to obtain & run
+
 Template: preseed/command_failed
 Type: error
 _Description: Failed to run preseeded command

Property changes on: 
___________________________________________________________________
Name: svn:ignore

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: