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

debootstrap 1.0.93+nmu4



Hi,

 I've prepared next NMU for debootstrap, tiny changes, please review it.


-- 
Regards,

 Hideki Yamane     henrich @ debian.org/iijmio-mail.jp
>From 24a1f6056f6df54c7882b4bf689056bc0c36c043 Mon Sep 17 00:00:00 2001
From: Hideki Yamane <henrich@debian.org>
Date: Wed, 7 Mar 2018 21:15:14 +0900
Subject: [PATCH 1/3] escape spaces to fix debootstrap on path contains space
 fails

update Tianon Gravi <tianon@debian.org> 's patch to apply current debootstrap
code
---
 debian/changelog |  9 +++++++++
 debootstrap      |  4 ++--
 functions        | 50 +++++++++++++++++++++++++-------------------------
 3 files changed, 36 insertions(+), 27 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7c41262..c6e53fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+debootstrap (1.0.93+nmu4) UNRELEASED; urgency=medium
+
+  * Non-maintainer Upload.
+  * Escape spaces to fix debootstrap on path contains space fails
+    Thanks to Tianon Gravi <tianon@debian.org> for the based patch
+    (Closes: #586158, #762431)
+
+ -- Hideki Yamane <henrich@debian.org>  Wed, 07 Mar 2018 21:23:17 +0900
+
 debootstrap (1.0.93+nmu3) unstable; urgency=medium
 
   * Non-maintainer Upload.
diff --git a/debootstrap b/debootstrap
index 9b547ad..3e948fe 100755
--- a/debootstrap
+++ b/debootstrap
@@ -465,7 +465,7 @@ fi
 if [ "$TARGET" = "/" ]; then
 	CHROOT_CMD=""
 else
-	CHROOT_CMD="chroot $TARGET"
+	CHROOT_CMD="chroot \"$TARGET\""
 fi
 
 if [ -z "$SHA_SIZE" ]; then
@@ -618,7 +618,7 @@ if am_doing_phase dldebs; then
 fi
 
 if am_doing_phase maketarball; then
-	(cd $TARGET;
+	(cd "$TARGET";
 	 tar czf - var/lib/apt var/cache/apt) >$MAKE_TARBALL
 fi
 
diff --git a/functions b/functions
index b780488..7024fc9 100644
--- a/functions
+++ b/functions
@@ -614,7 +614,7 @@ download_release_indices () {
 
 	validate_suite "$reldest"
 
-	extract_release_components $reldest
+	extract_release_components "$reldest"
 
 	local totalpkgs=0
 	for c in $COMPONENTS; do
@@ -719,8 +719,8 @@ download_debs () {
 				local debdest="$($DLDEST deb "$p" "$ver" "$arc" "$m" "$fil")"
 				if get "$m/$fil" "$TARGET/$debdest" "$checksum" "$size"; then
 					dloaddebs="$(($dloaddebs + $size))"
-					echo >>$TARGET/debootstrap/deburis "$p $ver $m/$fil"
-					echo >>$TARGET/debootstrap/debpaths "$p $debdest"
+					echo >>"$TARGET/debootstrap/deburis" "$p $ver $m/$fil"
+					echo >>"$TARGET/debootstrap/debpaths" "$p $debdest"
 				else
 					warning COULDNTDL "Couldn't download package %s (ver %s arch %s)" "$p" "$ver" "$arc"
 					leftover="$leftover $p"
@@ -773,7 +773,7 @@ download_release () {
 	local dloaddebs=0
 
 	progress $dloaddebs $totaldebs DOWNDEBS "Downloading packages"
-	:>$TARGET/debootstrap/debpaths
+	:>"$TARGET/debootstrap/debpaths"
 
 	pkgs_to_get="$*"
 	for c in $COMPONENTS; do
@@ -820,7 +820,7 @@ download_main_indices () {
 download_main () {
 	local m1="${MIRRORS%% *}"
 
-	:>$TARGET/debootstrap/debpaths
+	:>"$TARGET/debootstrap/debpaths"
 	for p in "$@"; do
 	    for c in $COMPONENTS; do
 		local details=""
@@ -837,7 +837,7 @@ download_main () {
 			checksum="${details##* }"; details="${details% *}"
 			local debdest="$($DLDEST deb $details)"
 			if get "$m/${details##* }" "$TARGET/$debdest" "$checksum" "$size"; then
-				echo >>$TARGET/debootstrap/debpaths "$p $debdest"
+				echo >>"$TARGET/debootstrap/debpaths" "$p $debdest"
 				details="done"
 				break
 			fi
@@ -976,7 +976,7 @@ extract () { (
 ); }
 
 in_target_nofail () {
-	if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin $CHROOT_CMD "$@" 2>/dev/null; then
+	if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin eval "$CHROOT_CMD \"\$@\"" 2>/dev/null; then
 		true
 	fi
 	return 0
@@ -987,7 +987,7 @@ in_target_failmsg () {
 	local msg="$2"
 	local arg="$3"
 	shift; shift; shift
-	if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin $CHROOT_CMD "$@"; then
+	if ! PATH=/sbin:/usr/sbin:/bin:/usr/bin eval "$CHROOT_CMD \"\$@\""; then
 		warning "$code" "$msg" "$arg"
 		# Try to point user at actual failing package.
 		msg="See %s for details"
@@ -1091,7 +1091,7 @@ setup_proc () {
 		if [ "$HOST_OS" = kfreebsd ]; then
 			in_target mount -t linprocfs proc /proc
 		else
-			mount -t linprocfs proc $TARGET/proc
+			mount -t linprocfs proc "$TARGET/proc"
 		fi
 		;;
 	    hurd*)
@@ -1154,7 +1154,7 @@ setup_dynamic_devices () {
 	    kfreebsd*)
 		in_target mount -t devfs devfs /dev ;;
 	    freebsd)
-		mount -t devfs devfs $TARGET/dev ;;
+		mount -t devfs devfs "$TARGET/dev" ;;
 	    hurd*)
 	        # Use the setup-translators of the hurd package
 	        in_target /usr/lib/hurd/setup-translators -k ;;
@@ -1164,24 +1164,24 @@ setup_dynamic_devices () {
 setup_devices_simple () {
 	# The list of devices that can be created in a container comes from
 	# src/core/cgroup.c in the systemd source tree.
-	mknod -m 666 $TARGET/dev/null	c 1 3
-	mknod -m 666 $TARGET/dev/zero	c 1 5
-	mknod -m 666 $TARGET/dev/full	c 1 7
-	mknod -m 666 $TARGET/dev/random	c 1 8
-	mknod -m 666 $TARGET/dev/urandom	c 1 9
-	mknod -m 666 $TARGET/dev/tty	c 5 0
+	mknod -m 666 "$TARGET/dev/null"	c 1 3
+	mknod -m 666 "$TARGET/dev/zero"	c 1 5
+	mknod -m 666 "$TARGET/dev/full"	c 1 7
+	mknod -m 666 "$TARGET/dev/random"	c 1 8
+	mknod -m 666 "$TARGET/dev/urandom"	c 1 9
+	mknod -m 666 "$TARGET/dev/tty"	c 5 0
 	# To avoid pre-exist directory causes error, specify "-p" option
-	mkdir -p $TARGET/dev/pts/ $TARGET/dev/shm/
+	mkdir -p "$TARGET/dev/pts/" "$TARGET/dev/shm/"
 	# Inside a container, we might not be allowed to create /dev/ptmx.
 	# If not, do the next best thing.
-	if ! mknod -m 666 $TARGET/dev/ptmx c 5 2; then
+	if ! mknod -m 666 "$TARGET/dev/ptmx" c 5 2; then
 		warning MKNOD "Could not create /dev/ptmx, falling back to symlink. This chroot will require /dev/pts mounted with ptmxmode=666"
-		ln -s pts/ptmx $TARGET/dev/ptmx
+		ln -s pts/ptmx "$TARGET/dev/ptmx"
 	fi
-	ln -s /proc/self/fd   $TARGET/dev/fd
-	ln -s /proc/self/fd/0 $TARGET/dev/stdin
-	ln -s /proc/self/fd/1 $TARGET/dev/stdout
-	ln -s /proc/self/fd/2 $TARGET/dev/stderr
+	ln -s /proc/self/fd   "$TARGET/dev/fd"
+	ln -s /proc/self/fd/0 "$TARGET/dev/stdin"
+	ln -s /proc/self/fd/1 "$TARGET/dev/stdout"
+	ln -s /proc/self/fd/2 "$TARGET/dev/stderr"
 }
 
 setup_devices_fakechroot () {
@@ -1234,8 +1234,8 @@ setup_merged_usr() {
 
 	local dir
 	for dir in $link_dir; do
-		ln -s usr/$dir $TARGET/$dir
-		mkdir -p $TARGET/usr/$dir
+		ln -s usr/"$dir" "$TARGET/$dir"
+		mkdir -p "$TARGET/usr/$dir"
 	done
 }
 
-- 
2.16.2

>From 55419377c805d0d643602187bc1cf9830b06fec9 Mon Sep 17 00:00:00 2001
From: Hideki Yamane <henrich@debian.org>
Date: Thu, 8 Mar 2018 21:43:44 +0900
Subject: [PATCH 2/3] Add warning if file specified via --keyring does not
 exist

Closes: #754318, #775474
---
 debian/changelog | 3 +++
 debootstrap      | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index c6e53fb..31f1a08 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,9 @@ debootstrap (1.0.93+nmu4) UNRELEASED; urgency=medium
   * Escape spaces to fix debootstrap on path contains space fails
     Thanks to Tianon Gravi <tianon@debian.org> for the based patch
     (Closes: #586158, #762431)
+  * Add warning if file specified via --keyring does not exist
+    Thanks to jnqnfe <jnqnfe@gmail.com> for the patch
+    (Closes: #754318, #775474)
 
  -- Hideki Yamane <henrich@debian.org>  Wed, 07 Mar 2018 21:23:17 +0900
 
diff --git a/debootstrap b/debootstrap
index 3e948fe..61992ab 100755
--- a/debootstrap
+++ b/debootstrap
@@ -325,6 +325,9 @@ if [ $# != 0 ] ; then
 		else
 			error 1 NEEDARG "option requires an argument %s" "$1"
 		fi
+		if [ ! -e "$KEYRING" ]; then
+			error 1 KEYRING "specified keyring file ($KEYRING) not found"
+		fi
 		;;
 	    --no-check-gpg)
 			shift 1
-- 
2.16.2

>From f57cedf7f1fc7e47703f7f2930740f47f39ddc73 Mon Sep 17 00:00:00 2001
From: Hideki Yamane <henrich@debian.org>
Date: Fri, 9 Mar 2018 23:36:22 +0900
Subject: [PATCH 3/3] upload to unstable

---
 debian/changelog | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 31f1a08..88f34a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-debootstrap (1.0.93+nmu4) UNRELEASED; urgency=medium
+debootstrap (1.0.93+nmu4) unstable; urgency=medium
 
   * Non-maintainer Upload.
   * Escape spaces to fix debootstrap on path contains space fails
@@ -8,7 +8,7 @@ debootstrap (1.0.93+nmu4) UNRELEASED; urgency=medium
     Thanks to jnqnfe <jnqnfe@gmail.com> for the patch
     (Closes: #754318, #775474)
 
- -- Hideki Yamane <henrich@debian.org>  Wed, 07 Mar 2018 21:23:17 +0900
+ -- Hideki Yamane <henrich@debian.org>  Wed, 21 Mar 2018 16:28:01 +0900
 
 debootstrap (1.0.93+nmu3) unstable; urgency=medium
 
-- 
2.16.2


Reply to: