[Debian-live-changes] r2488 - in dists/trunk/live-helper: docs functions helpers

otavio at alioth.debian.org otavio at alioth.debian.org
Sat Jul 14 21:10:44 UTC 2007


Author: otavio
Date: 2007-07-14 21:10:43 +0000 (Sat, 14 Jul 2007)
New Revision: 2488

Modified:
   dists/trunk/live-helper/docs/ChangeLog
   dists/trunk/live-helper/functions/templates.sh
   dists/trunk/live-helper/helpers/lh_binary_grub
   dists/trunk/live-helper/helpers/lh_binary_syslinux
   dists/trunk/live-helper/helpers/lh_binary_yaboot
Log:
Export TEMPLATE variable pointing to the final template path

There're a lot of places where we currently check for
LIVE_TEMPLATES/<something> and it's much easier to read and flexible
to use only TEMPLATE also because we already check for a specific item
on the templates directory.


Modified: dists/trunk/live-helper/docs/ChangeLog
===================================================================
--- dists/trunk/live-helper/docs/ChangeLog	2007-07-14 18:53:24 UTC (rev 2487)
+++ dists/trunk/live-helper/docs/ChangeLog	2007-07-14 21:10:43 UTC (rev 2488)
@@ -1,3 +1,13 @@
+2007-07-15  Otavio Salvador  <otavio at debian.org>
+
+	* functions/templates.sh:
+	  - Changed whole code to export TEMPLATES for the item beeing
+	    checked.
+	* helpers/lh_binary_grub, helpers/lh_binary_syslinux,
+	  helpers/lh_binary_yaboot:
+	  - Changed code to use the new TEMPLATES variable and avoid
+	    hardcoding the path.
+
 2007-07-14  Daniel Baumann  <daniel at debian.org>
 
 	* helpers/lh_binary_debian-installer:

Modified: dists/trunk/live-helper/functions/templates.sh
===================================================================
--- dists/trunk/live-helper/functions/templates.sh	2007-07-14 18:53:24 UTC (rev 2487)
+++ dists/trunk/live-helper/functions/templates.sh	2007-07-14 21:10:43 UTC (rev 2488)
@@ -11,22 +11,25 @@
 
 Check_templates ()
 {
-	PROGRAM="${1}"
+	ITEM="${1}"
 
-	# Check local templates
-	if [ -d config/templates/"${PROGRAM}" ]
+	# Check user defined templates directory
+	if [ ! -d "${LIVE_TEMPLATES}" ]
 	then
-		LIVE_TEMPLATES="config/templates"
+		if [ -d config/templates ]
+		then
+			LIVE_TEMPLATES=config/templates
+		else
+			Echo_error "templates not accessible in ${LIVE_TEMPLATES} nor config/templates"
+			exit 1
+		fi
 	fi
 
-	# Checking user templates
-	if [ ! -d "${LIVE_TEMPLATES}" ]
+	if [ -d "${LIVE_TEMPLATES}/${ITEM}" ]
 	then
-		Echo_error "user specified templates not accessible in ${LIVE_TEMPLATES}"
+		TEMPLATES="${LIVE_TEMPLATES}/${ITEM}"
+	else
+		Echo_error "${ITEM} templates not accessible in ${LIVE_TEMPLATES}"
 		exit 1
-	elif [ ! -d "${LIVE_TEMPLATES}/${PROGRAM}" ]
-	then
-		Echo_error "${PROGRAM} templates not accessible in ${LIVE_TEMPLATES}"
-		exit 1
 	fi
 }

Modified: dists/trunk/live-helper/helpers/lh_binary_grub
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_grub	2007-07-14 18:53:24 UTC (rev 2487)
+++ dists/trunk/live-helper/helpers/lh_binary_grub	2007-07-14 21:10:43 UTC (rev 2488)
@@ -234,7 +234,7 @@
 
 # Copying templates
 mkdir -p binary/boot/grub
-cp -r "${LIVE_TEMPLATES}"/grub/* binary/boot/grub
+cp -r "${TEMPLATES}"/* binary/boot/grub
 
 # Copying grub
 case ${LIVE_BINARY_IMAGES} in

Modified: dists/trunk/live-helper/helpers/lh_binary_syslinux
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_syslinux	2007-07-14 18:53:24 UTC (rev 2487)
+++ dists/trunk/live-helper/helpers/lh_binary_syslinux	2007-07-14 21:10:43 UTC (rev 2488)
@@ -321,7 +321,7 @@
 		# Copying syslinux
 		mkdir -p binary/isolinux
 		cp chroot/usr/lib/syslinux/isolinux.bin binary/isolinux
-		cp -r "${LIVE_TEMPLATES}"/syslinux/* binary/isolinux
+		cp -r "${TEMPLATES}"/* binary/isolinux
 		mv binary/isolinux/syslinux.cfg binary/isolinux/isolinux.cfg
 
 		# Copying local configuration file
@@ -382,7 +382,7 @@
 		# Copying syslinux
 		cp chroot/usr/lib/syslinux/pxelinux.0 tftpboot
 		mkdir -p tftpboot/pxelinux.cfg
-		cp -r "${LIVE_TEMPLATES}"/syslinux/* tftpboot/pxelinux.cfg
+		cp -r "${TEMPLATES}"/* tftpboot/pxelinux.cfg
 		mv tftpboot/pxelinux.cfg/syslinux.cfg tftpboot/pxelinux.cfg/default
 
 		# Copying local configuration file
@@ -440,7 +440,8 @@
 		# Copying syslinux
 		mkdir -p "${DESTDIR}"
 		cp chroot/usr/lib/syslinux/isolinux.bin "${DESTDIR}"/syslinux.bin
-		cp -r "${LIVE_TEMPLATES}"/syslinux/* "${DESTDIR}"
+		cp -r "${TEMPLATES}"/* "${DESTDIR}"
+		mv "${DESTDIR}"/isolinux.cfg "${DESTDIR}"/syslinux.cfg
 
 		# Copying local configuration file
 		if [ -f config/binary_syslinux/syslinux.cfg ]

Modified: dists/trunk/live-helper/helpers/lh_binary_yaboot
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_yaboot	2007-07-14 18:53:24 UTC (rev 2487)
+++ dists/trunk/live-helper/helpers/lh_binary_yaboot	2007-07-14 21:10:43 UTC (rev 2488)
@@ -240,7 +240,7 @@
 		# Copying yaboot
 		mkdir -p binary/yaboot
 		cp chroot/usr/lib/yaboot/yaboot binary/yaboot
-		cp -r "${LIVE_TEMPLATES}"/yaboot/* binary/yaboot
+		cp -r "${TEMPLATES}"/* binary/yaboot
 
 		if [ "${LIVE_BINARY_IMAGES}" = "usb-hdd" ]
 		then




More information about the Debian-live-changes mailing list