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

[PATCH 1/5] Add support to overwrite the archive keyring



From: Otavio Salvador <otavio@ossystems.com.br>

We need to support many different repositories with different
keyrings. This patch allow us to specify it by project basis while
keep backward compatibility with previous live-package releases.
---

 src/main.sh               |    9 +++++++--
 src/scripts/02defaults.sh |    6 ++++++
 src/scripts/14chroot.sh   |    2 +-
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/main.sh b/src/main.sh
index e768974..4c65028 100755
--- a/src/main.sh
+++ b/src/main.sh
@@ -41,7 +41,7 @@ do
 	. "${SCRIPT}"
 done
 
-USAGE="Usage: ${PROGRAM} [-a|--architecture ARCHITECTURE] [-b|--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [--clone DIRECTORY] [--config FILE] [-c|--chroot DIRECTORY] [-d|--distribution DISTRIBUTION] [--with-generic-indices] [--without-generic-indices] [--with-recommends] [--without-recommends] [--filesystem FILESYSTEM] [-f|--flavour BOOTSTRAP_FLAVOUR] [--hook COMMAND|\"COMMANDS\"] [--include-chroot FILE|DIRECTORY] [--include-image FILE|DIRECTORY] [-k|--kernel KERNEL_FLAVOUR] [--manifest PACKAGE] [-m|--mirror URL] [--mirror-security URL] [--packages PACKAGE|\"PACKAGES\"] [-p|--package-list LIST|FILE] [--preseed FILE] [--proxy-ftp URL] [--proxy-http URL] [--repositories NAME] [-r|--root DIRECTORY] [-s|--section SECTION|\"SECTIONS\"] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--templates DIRECTORY] [-t|--type TYPE]"
+USAGE="Usage: ${PROGRAM} [-a|--architecture ARCHITECTURE] [-b|--bootappend KERNEL_PARAMETER|\"KERNEL_PARAMETERS\"] [--clone DIRECTORY] [--config FILE] [-c|--chroot DIRECTORY] [-d|--distribution DISTRIBUTION] [--with-generic-indices] [--without-generic-indices] [--with-recommends] [--without-recommends] [--filesystem FILESYSTEM] [-f|--flavour BOOTSTRAP_FLAVOUR] [--hook COMMAND|\"COMMANDS\"] [--include-chroot FILE|DIRECTORY] [--include-image FILE|DIRECTORY] [-k|--kernel KERNEL_FLAVOUR] [--manifest PACKAGE] [-m|--mirror URL] [-k|--keyring] [--mirror-security URL] [--packages PACKAGE|\"PACKAGES\"] [-p|--package-list LIST|FILE] [--preseed FILE] [--proxy-ftp URL] [--proxy-http URL] [--repositories NAME] [-r|--root DIRECTORY] [-s|--section SECTION|\"SECTIONS\"] [--server-address HOSTNAME|IP] [--server-path DIRECTORY] [--templates DIRECTORY] [-t|--type TYPE]"
 
 Help ()
 {
@@ -79,6 +79,7 @@ Help ()
 	echo "  --manifest: specifies the pivot package to create filesystem.manifest-desktop upon (mostly \"ubuntu-live\")."
 	echo "  -m, --mirror: specifies debian mirror."
 	echo "  --mirror-security: specifies debian security mirror."
+	echo "  --keyring: specifies keyring package."
 	echo "  --packages: specifies aditional packages."
 	echo "  -p, --package-list: specifies additonal package list."
 	echo "  --repositories: specifies custom repositories."
@@ -164,7 +165,7 @@ Configuration ()
 
 Main ()
 {
-	ARGUMENTS="`getopt --longoptions root:,type:,architecture:,bootappend:,clone:,config:,chroot:,distribution:,filesystem:,flavour:,bootstrap-config:,hook:,include-chroot:,include-image:,kernel:,manifest:,mirror:,mirror-security:,output:,packages:,package-list:,proxy-ftp:,preseed:,proxy-http:,repositories:,section:,server-address:,server-path:,templates:,with-generic-indices,without-generic-indices,with-recommends,without-recommends,with-source,without-source,help,usage,version --name=${PROGRAM} --options r:t:a:b:c:d:f:k:m:o:p:s:huv --shell sh -- "${@}"`"
+	ARGUMENTS="`getopt --longoptions root:,type:,architecture:,bootappend:,clone:,config:,chroot:,distribution:,filesystem:,flavour:,bootstrap-config:,hook:,include-chroot:,include-image:,kernel:,manifest:,mirror:,keyring:,mirror-security:,output:,packages:,package-list:,proxy-ftp:,preseed:,proxy-http:,repositories:,section:,server-address:,server-path:,templates:,with-generic-indices,without-generic-indices,with-recommends,without-recommends,with-source,without-source,help,usage,version --name=${PROGRAM} --options r:t:a:b:c:d:f:k:m:o:p:s:huv --shell sh -- "${@}"`"
 
 	if [ "${?}" != "0" ]
 	then
@@ -243,6 +244,10 @@ Main ()
 				LIVE_MIRROR="${2}"; shift 2
 				;;
 
+			--keyring)
+				LIVE_REPOSITORY_KEYRING="${2}"; shift 2
+				;;
+
 			--mirror-security)
 				LIVE_MIRROR_SECURITY="${2}"; shift 2
 				;;
diff --git a/src/scripts/02defaults.sh b/src/scripts/02defaults.sh
index faca476..fb071f1 100644
--- a/src/scripts/02defaults.sh
+++ b/src/scripts/02defaults.sh
@@ -154,6 +154,12 @@ Defaults ()
 		LIVE_MIRROR="http://ftp.debian.org/debian/";
 	fi
 
+	# Set debian keyring
+	if [ -z "${LIVE_REPOSITORY_KEYRING}" ]
+	then
+		LIVE_REPOSITORY_KEYRING="debian-archive-keyring"
+	fi
+
 	# Set debian security mirror
 	if [ -z "${LIVE_MIRROR_SECURITY}" ]
 	then
diff --git a/src/scripts/14chroot.sh b/src/scripts/14chroot.sh
index 2e2b489..2c8824a 100644
--- a/src/scripts/14chroot.sh
+++ b/src/scripts/14chroot.sh
@@ -42,7 +42,7 @@ Chroot ()
 		then
 			if [ "${LIVE_FLAVOUR}" != "minimal" ]
 			then
-				Chroot_exec "aptitude install --assume-yes debian-archive-keyring"
+				Chroot_exec "apt-get install --yes --force-yes ${LIVE_REPOSITORY_KEYRING}"
 
 				for NAME in ${LIVE_REPOSITORIES}
 				do


Reply to: