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

Bug#775474: Issue helpful error if user specified keyring not found



Package: debootstrap
Tags: patch

Patch attached to cause a helpful error to be issued to the user in the
event that they should specify a keyring file via the --keyring
parameter, but should the specified keyring file not be found (for
example should the user have made a typo). From a reading of the code I
believe that no such check already exists, and current behavior is to
just blunder on, resulting in a SIGCHECK gpgv state, and thus an
unhelpful "Error executing gpgv to check Release signature" message,
combined possibly with some degree of wasted time and bandwidth through
files being redownloaded after correcting the mistake (if the existing
copies aren't reused, I haven't yet read enough of the code carefully to
know at this point, nor have I run the code - been too busy to have time).
commit b066af054dad924641bd0cfa4dfd669a9db28bc5
Author: jnqnfe <jnqnfe@gmail.com>
Date:   Fri Jan 16 05:24:50 2015 +0000

    Issue error if user specified keyring file not found

diff --git a/debootstrap b/debootstrap
index e024560..e1a3fbf 100755
--- a/debootstrap
+++ b/debootstrap
@@ -321,6 +321,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 not found"
+		fi
 		;;
 	    --no-check-gpg)
 			shift 1

Reply to: