[SCM] live-helper branch, debian, updated. debian/2.0_a9-1-10-g17ed4f0

Daniel Baumann daniel at debian.org
Fri Apr 9 19:35:15 UTC 2010


The following commit has been merged in the debian branch:
commit 2b25d825faa06e6889f41122cf14706a473154b8
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Mar 21 09:37:24 2010 +0100

    Adding -r, --repositories option to select preconfigured third-party repositories more easily.

diff --git a/Makefile b/Makefile
index ba22671..0c6f6ed 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ build:
 install:
 	# Installing shared data
 	mkdir -p $(DESTDIR)/usr/share/live-helper
-	cp -r cgi data examples live-helper.sh functions helpers hooks includes lists templates $(DESTDIR)/usr/share/live-helper
+	cp -r cgi data examples live-helper.sh functions helpers hooks includes lists repositories templates $(DESTDIR)/usr/share/live-helper
 
 	# Installing executables
 	mkdir -p $(DESTDIR)/usr/bin
diff --git a/helpers/chroot_sources b/helpers/chroot_sources
index 8e456fd..d30ac73 100755
--- a/helpers/chroot_sources
+++ b/helpers/chroot_sources
@@ -120,6 +120,50 @@ case "${1}" in
 			done
 		fi
 
+		# Configure third-party repositories
+		if [ -n "${LH_REPOSITORIES}" ]
+		then
+			for REPOSITORY in ${LH_REPOSITORIES}
+			do
+				for PLACE in config/repositories "${LH_BASE}/repositories"
+				do
+					# Prefer repositories from the config tree
+					# over the global ones.
+					if ! ls "${PLACE}/${REPOSITORY}"* > /dev/null 2>&1
+					then
+						continue
+					fi
+
+					# Adding sources.list entries (chroot)
+					if [ -e "${PLACE}/${REPOSITORY}.chroot" ]
+					then
+						sed -e "s|@DISTRIBUTION@|${LH_DISTRIBUTION}|g" \
+						    -e "s|@ARCHIVE_AREAS@|${LH_ARCHIVE_AREAS}|g" \
+						"${PLACE}/${REPOSITORY}.chroot" > \
+						"chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
+					elif [ -e "${PLACE}/${REPOSITORY}" ]
+					then
+						sed -e "s|@DISTRIBUTION@|${LH_DISTRIBUTION}|g" \
+						    -e "s|@ARCHIVE_AREAS@|${LH_ARCHIVE_AREAS}|g" \
+						"${PLACE}/${REPOSITORY}" > \
+						"chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
+					fi
+
+					if [ "${LH_APT_SECURE}" != false ]
+					then
+						# Adding archive signing keys (chroot)
+						if [ -e "${PLACE}/${REPOSITORY}.chroot.gpg" ]
+						then
+							cat "${PLACE}/${REPOSITORY}.chroot.gpg" | Chroot chroot "apt-key add -"
+						elif [ -e "${PLACE}/${REPOSITORY}.gpg" ]
+						then
+							cat "${PLACE}/${REPOSITORY}.gpg" | Chroot chroot "apt-key add -"
+						fi
+					fi
+				done
+			done
+		fi
+
 		# Configure local package repository
 		if Find_files config/chroot_local-packages/*.deb
 		then
@@ -453,6 +497,53 @@ case "${1}" in
 			esac
 		fi
 
+		# Configure third-party repositories
+		if [ -n "${LH_REPOSITORIES}" ]
+		then
+			for REPOSITORY in ${LH_REPOSITORIES}
+			do
+				# Removing sources.list entries (chroot)
+				rm -f "chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
+
+				for PLACE in config/repositories "${LH_BASE}/repositories"
+				do
+					# Prefer repositories from the config tree
+					# over the global ones.
+					if ! ls "${PLACE}/${REPOSITORY}"* > /dev/null 2>&1
+					then
+						continue
+					fi
+
+					# Adding sources.list entries (binary)
+					if [ -e "${PLACE}/${REPOSITORY}.binary" ]
+					then
+						sed -e "s|@DISTRIBUTION@|${LH_DISTRIBUTION}|g" \
+						    -e "s|@ARCHIVE_AREAS@|${LH_ARCHIVE_AREAS}|g" \
+						"${PLACE}/${REPOSITORY}.binary" > \
+						"chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
+					elif [ -e "${PLACE}/${REPOSITORY}" ]
+					then
+						sed -e "s|@DISTRIBUTION@|${LH_DISTRIBUTION}|g" \
+						    -e "s|@ARCHIVE_AREAS@|${LH_ARCHIVE_AREAS}|g" \
+						"${PLACE}/${REPOSITORY}" > \
+						"chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
+					fi
+
+					if [ "${LH_APT_SECURE}" != false ]
+					then
+						# Adding archive signing keys (binary)
+						if [ -e "${PLACE}/${REPOSITORY}.binary.gpg" ]
+						then
+							cat "${PLACE}/${REPOSITORY}.binary.gpg" | Chroot chroot "apt-key add -"
+						elif [ -e "${PLACE}/${REPOSITORY}.gpg" ]
+						then
+							cat "${PLACE}/${REPOSITORY}.gpg" | Chroot chroot "apt-key add -"
+						fi
+					fi
+				done
+			done
+		fi
+
 		# Check local sources.list
 		if Find_files config/chroot_sources/*.binary
 		then
diff --git a/helpers/config b/helpers/config
index 9bb9201..d1c594d 100755
--- a/helpers/config
+++ b/helpers/config
@@ -109,6 +109,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
 \t    [-p|--packages-lists FILE]\n\
 \t    [--packages PACKAGE|\"PACKAGES\"]\n\
 \t    [--quiet]\n\
+\t    [-r|--repositories REPOSITORY|\"REPOSITORIES\"]\n\
 \t    [--root-command sudo]\n\
 \t    [--use-fakeroot true|false]\n\
 \t    [--archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\
@@ -135,7 +136,7 @@ Local_arguments ()
 	LONG_OPTIONS="apt:,apt-ftp-proxy:,apt-http-proxy:,apt-pdiffs:,apt-options:,aptitute-options:,
 		apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,
 		cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,dump,
-		initramfs:,fdisk:,losetup:,mode:,root-command:,use-fakeroot:,tasksel:,includes:,
+		initramfs:,fdisk:,losetup:,mode:,repositories:,root-command:,use-fakeroot:,tasksel:,includes:,
 		templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,clean,
 		distribution:,mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-chroot-volatile:,mirror-binary:,
 		mirror-binary-security:,mirror-binary-volatile:,mirror-debian-installer:,archive-areas:,chroot-filesystem:,exposed-root:,virtual-root-size:,
@@ -151,7 +152,7 @@ Local_arguments ()
 		help,ignore-system-defaults,quiet,usage,verbose,version"
 	# Remove spaces added by indentation
 	LONG_OPTIONS="$(echo ${LONG_OPTIONS} | tr -d ' ')"
-	ARGUMENTS="$(getopt --longoptions ${LONG_OPTIONS} --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}")"
+	ARGUMENTS="$(getopt --longoptions ${LONG_OPTIONS} --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:r:s:c:huv --shell sh -- "${@}")"
 
 	if [ "${?}" != "0" ]
 	then
@@ -330,6 +331,11 @@ Local_arguments ()
 				shift 2
 				;;
 
+			-r|--repositories)
+				LH_REPOSITORIES="${2}"
+				shift 2
+				;;
+
 			--root-command)
 				LH_ROOT_COMMAND="${2}"
 				shift 2
@@ -1072,6 +1078,10 @@ LH_LINUX_FLAVOURS="${LH_LINUX_FLAVOURS}"
 # (Default: autodetected)
 LH_LINUX_PACKAGES="${LH_LINUX_PACKAGES}"
 
+# \$LH_REPOSITORIES: enable available third-party repositories
+# (Default: empty)
+LH_REPOSITORIES="${LH_REPOSITORIES}"
+
 # \$LH_PACKAGES: set packages to install
 # (Default: empty)
 LH_PACKAGES="${LH_PACKAGES}"
diff --git a/manpages/lh_config.en.1 b/manpages/lh_config.en.1
index 9cf53c1..cbe5b63 100644
--- a/manpages/lh_config.en.1
+++ b/manpages/lh_config.en.1
@@ -160,6 +160,8 @@ lh_config \- create configuration for live\-helper
 .br
 	[\fB\-\-packages\fR \fIPACKAGE\fR|\fI"PACKAGES"\fR]
 .br
+	[\fB\-r, \-\-repositories \fIREPOSITORY\fR|\fI"REPOSITORIES"\fR]
+.br
 	[\fB\-\-root-command\fR sudo]
 .br
 	[\fB\-\-use-fakeroot\fR true|false]
@@ -369,6 +371,8 @@ defines the format of the netboot image. Choosing tar results in a not compresse
 defines which lists available in /usr/share/live-helper/lists should be used. By default, this is set to standard. Note that in case you have local packages lists, you don't need to list them here. Putting them into config/chroot_local-packageslists is enough (the filename needs to have the .list suffix though).
 .IP "\fB\-\-packages\fR \fIPACKAGE\fR|\fI""PACKAGES""\fR" 4
 defines one or more packages to be installed in the live system. This is a quick and convenient place to add a few packages when building an image (limited by the max length of shell). Packages that should be permanently installed should be put into a local packages list.
+.IP "\fB\-r, \-\-repositories\fR \fIREPOSITORY\fR|\fI""REPOSITORIES""\fR" 4
+enables one of available third-party repository configurations in /usr/share/live-helper/repositories.
 .IP "\fB\-\-root-command\fR sudo" 4
 controls if live-helper should use sudo internally to build the live image. Note that this is not well tested and that you should, when relying on sudo, call the individual live\-helper command with sudo itself.
 .IP "\fB\-\-use-fakeroot\fR true|false" 4
diff --git a/repositories/backports.debian-maintainers.org b/repositories/backports.debian-maintainers.org
new file mode 100644
index 0000000..8ba3e02
--- /dev/null
+++ b/repositories/backports.debian-maintainers.org
@@ -0,0 +1,3 @@
+# Backports Maintainers
+deb http://backports.debian-maintainers.org/ @DISTRIBUTION@/backports @ARCHIVE_AREAS@
+deb-src http://backports.debian-maintainers.org/ @DISTRIBUTION@/backports @ARCHIVE_AREAS@
diff --git a/examples/sources/debian-live_sid-snapshots.gpg b/repositories/backports.debian-maintainers.org.gpg
similarity index 96%
copy from examples/sources/debian-live_sid-snapshots.gpg
copy to repositories/backports.debian-maintainers.org.gpg
index e817812..7f9b836 100644
--- a/examples/sources/debian-live_sid-snapshots.gpg
+++ b/repositories/backports.debian-maintainers.org.gpg
@@ -1,5 +1,5 @@
 -----BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.10 (GNU/Linux)
+Version: GnuPG v1.4.9 (GNU/Linux)
 
 mQENBEtljiMBCADSIplButAWL0OuM4uvDtZYjBcPlQNjwQDZ/Dpg5QuRAgNSUdx7
 wBQOQXqC4LCi9ykpvYi8FEtz0bl60M9uJdc4n+130It8gSZs7Cn0WoFk7uo0S4IS
diff --git a/repositories/live.debian.net b/repositories/live.debian.net
new file mode 100644
index 0000000..54d1399
--- /dev/null
+++ b/repositories/live.debian.net
@@ -0,0 +1,3 @@
+# Debian Live Project
+deb http://live.debian.net/ @DISTRIBUTION at -snapshots @ARCHIVE_AREAS@
+deb-src http://live.debian.net/ @DISTRIBUTION at -snapshots @ARCHIVE_AREAS@
diff --git a/examples/sources/debian-live_sid-snapshots.gpg b/repositories/live.debian.net.gpg
similarity index 96%
copy from examples/sources/debian-live_sid-snapshots.gpg
copy to repositories/live.debian.net.gpg
index e817812..7f9b836 100644
--- a/examples/sources/debian-live_sid-snapshots.gpg
+++ b/repositories/live.debian.net.gpg
@@ -1,5 +1,5 @@
 -----BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.10 (GNU/Linux)
+Version: GnuPG v1.4.9 (GNU/Linux)
 
 mQENBEtljiMBCADSIplButAWL0OuM4uvDtZYjBcPlQNjwQDZ/Dpg5QuRAgNSUdx7
 wBQOQXqC4LCi9ykpvYi8FEtz0bl60M9uJdc4n+130It8gSZs7Cn0WoFk7uo0S4IS
diff --git a/repositories/unofficial.debian-maintainers.org b/repositories/unofficial.debian-maintainers.org
new file mode 100644
index 0000000..97093c4
--- /dev/null
+++ b/repositories/unofficial.debian-maintainers.org
@@ -0,0 +1,3 @@
+# Unofficial Maintainers
+deb http://unofficial.debian-maintainers.org/ @DISTRIBUTION@ @ARCHIVE_AREAS@ restricted
+deb-src http://unofficial.debian-maintainers.org/ @DISTRIBUTION@ @ARCHIVE_AREAS@ restricted
diff --git a/examples/sources/debian-live_sid-snapshots.gpg b/repositories/unofficial.debian-maintainers.org.gpg
similarity index 96%
copy from examples/sources/debian-live_sid-snapshots.gpg
copy to repositories/unofficial.debian-maintainers.org.gpg
index e817812..7f9b836 100644
--- a/examples/sources/debian-live_sid-snapshots.gpg
+++ b/repositories/unofficial.debian-maintainers.org.gpg
@@ -1,5 +1,5 @@
 -----BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.10 (GNU/Linux)
+Version: GnuPG v1.4.9 (GNU/Linux)
 
 mQENBEtljiMBCADSIplButAWL0OuM4uvDtZYjBcPlQNjwQDZ/Dpg5QuRAgNSUdx7
 wBQOQXqC4LCi9ykpvYi8FEtz0bl60M9uJdc4n+130It8gSZs7Cn0WoFk7uo0S4IS

-- 
live-helper



More information about the debian-live-changes mailing list