r2628 - dists/trunk/live-helper/functions

daniel at alioth.debian.org daniel at alioth.debian.org
Sun Jul 29 13:29:22 UTC 2007


Author: daniel
Date: 2007-07-29 13:29:22 +0000 (Sun, 29 Jul 2007)
New Revision: 2628

Added:
   dists/trunk/live-helper/functions/packages.sh
   dists/trunk/live-helper/functions/packageslists.sh
Removed:
   dists/trunk/live-helper/functions/package.sh
   dists/trunk/live-helper/functions/packagelist.sh
Log:


Deleted: dists/trunk/live-helper/functions/package.sh
===================================================================
--- dists/trunk/live-helper/functions/package.sh	2007-07-29 09:46:45 UTC (rev 2627)
+++ dists/trunk/live-helper/functions/package.sh	2007-07-29 13:29:22 UTC (rev 2628)
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-# packages.sh - handle packages installation
-# Copyright (C) 2006-2007 Daniel Baumann <daniel at debian.org>
-#
-# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-set -e
-
-Check_package ()
-{
-	ITEM="${1}"
-	PACKAGE="${2}"
-
-	case "${LIVE_CHROOT_BUILD}" in
-		enabled)
-			if [ ! -d "${ITEM}" ] && [ ! -f "${ITEM}" ]
-			then
-				PACKAGES="${PACKAGES} ${PACKAGE}"
-			fi
-			;;
-
-		disabled)
-			ITEM="`echo ${ITEM} | sed -e 's/chroot//'`"
-
-			if [ ! -d "${ITEM}" ] && [ ! -f "${ITEM}" ]
-			then
-				Echo_error "You need to install ${PACKAGE} on your host system."
-				exit 1
-			fi
-			;;
-	esac
-}
-
-Install_package ()
-{
-	if [ -n "${PACKAGES}" ] && [ "${LIVE_CHROOT_BUILD}" != "disabled" ]
-	then
-		case "${LH_APT}" in
-			apt|apt-get)
-				Chroot "apt-get install --yes ${PACKAGES}"
-				;;
-
-			aptitude)
-				Chroot "aptitude install --assume-yes ${PACKAGES}"
-				;;
-		esac
-	fi
-}
-
-Remove_package ()
-{
-	if [ -n "${PACKAGES}" ] && [ "${LIVE_CHROOT_BUILD}" != "disabled" ]
-	then
-		case "${LH_APT}" in
-			apt|apt-get)
-				Chroot "apt-get remove --purge --yes ${PACKAGES}"
-				;;
-
-			aptitude)
-				Chroot "aptitude purge --assume-yes ${PACKAGES}"
-				;;
-		esac
-	fi
-}

Deleted: dists/trunk/live-helper/functions/packagelist.sh
===================================================================
--- dists/trunk/live-helper/functions/packagelist.sh	2007-07-29 09:46:45 UTC (rev 2627)
+++ dists/trunk/live-helper/functions/packagelist.sh	2007-07-29 13:29:22 UTC (rev 2628)
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-# packagelists.sh - expands package list includes
-# Copyright (C) 2006-2007 Daniel Baumann <daniel at debian.org>
-#
-# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
-# This is free software, and you are welcome to redistribute it
-# under certain conditions; see COPYING for details.
-
-set -e
-
-Expand_packagelist ()
-{
-	# ${1} List name
-	# ${2} Default path to search
-	# ${3} Fallback path to search (optional)
-
-	# Does list exist in default path?
-	if [ -e "${2}/${1}" ];
-	then
-		Expand_packagelist_file "${2}/${1}" "${@}"
-	else
-		# If list exists in fallback, include it.
-		if [ -n "${3}" ] && [ -e "${3}/${1}" ]
-		then
-			Expand_packagelist_file "${3}/${1}" "${@}"
-		fi
-	fi
-}
-
-Expand_packagelist_file ()
-{
-	local FILE="${1}"
-	shift
-	shift
-
-	for INCLUDE in `sed -ne 's/^#<include> \(.*\)/\1/gp' "${FILE}"`;
-	do
-		Expand_packagelist "${INCLUDE}" "${@}"
-	done
-	sed -ne 's/^\([^#].*\)/\1\n/gp' "${FILE}"
-}

Copied: dists/trunk/live-helper/functions/packages.sh (from rev 2604, dists/trunk/live-helper/functions/package.sh)
===================================================================
--- dists/trunk/live-helper/functions/packages.sh	                        (rev 0)
+++ dists/trunk/live-helper/functions/packages.sh	2007-07-29 13:29:22 UTC (rev 2628)
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+# packages.sh - handle packages installation
+# Copyright (C) 2006-2007 Daniel Baumann <daniel at debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -e
+
+Check_package ()
+{
+	FILE="${1}"
+	PACKAGE="${2}"
+
+	case "${LIVE_CHROOT_BUILD}" in
+		enabled)
+			if ! `Chroot dpkg-query -s ${PACKAGE}`
+			then
+				PACKAGES="${PACKAGES} ${PACKAGE}"
+			fi
+			;;
+
+		disabled)
+			FILE="`echo ${FILE} | sed -e 's/chroot//'`"
+
+			if [ ! -f "${FILE}" ]
+			then
+				Echo_error "You need to install ${PACKAGE} on your host system."
+				exit 1
+			fi
+			;;
+	esac
+}
+
+Install_package ()
+{
+	if [ -n "${PACKAGES}" ] && [ "${LIVE_CHROOT_BUILD}" != "disabled" ]
+	then
+		case "${LH_APT}" in
+			apt|apt-get)
+				Chroot "apt-get install --yes ${PACKAGES}"
+				;;
+
+			aptitude)
+				Chroot "aptitude install --assume-yes ${PACKAGES}"
+				;;
+		esac
+	fi
+}
+
+Remove_package ()
+{
+	if [ -n "${PACKAGES}" ] && [ "${LIVE_CHROOT_BUILD}" != "disabled" ]
+	then
+		case "${LH_APT}" in
+			apt|apt-get)
+				Chroot "apt-get remove --purge --yes ${PACKAGES}"
+				;;
+
+			aptitude)
+				Chroot "aptitude purge --assume-yes ${PACKAGES}"
+				;;
+		esac
+	fi
+}

Copied: dists/trunk/live-helper/functions/packageslists.sh (from rev 2604, dists/trunk/live-helper/functions/packagelist.sh)
===================================================================
--- dists/trunk/live-helper/functions/packageslists.sh	                        (rev 0)
+++ dists/trunk/live-helper/functions/packageslists.sh	2007-07-29 13:29:22 UTC (rev 2628)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# packagelists.sh - expands package list includes
+# Copyright (C) 2006-2007 Daniel Baumann <daniel at debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -e
+
+Expand_packagelist ()
+{
+	# ${1} List name
+	# ${2} Default path to search
+	# ${3} Fallback path to search (optional)
+
+	# Does list exist in default path?
+	if [ -e "${2}/${1}" ];
+	then
+		Expand_packagelist_file "${2}/${1}" "${@}"
+	else
+		# If list exists in fallback, include it.
+		if [ -n "${3}" ] && [ -e "${3}/${1}" ]
+		then
+			Expand_packagelist_file "${3}/${1}" "${@}"
+		fi
+	fi
+}
+
+Expand_packagelist_file ()
+{
+	local FILE="${1}"
+	shift
+	shift
+
+	for INCLUDE in `sed -ne 's/^#<include> \(.*\)/\1/gp' "${FILE}"`;
+	do
+		Expand_packagelist "${INCLUDE}" "${@}"
+	done
+	sed -ne 's/^\([^#].*\)/\1\n/gp' "${FILE}"
+}




More information about the debian-live-changes mailing list