Package: devscripts
Version: 2.10.38
Severity: normal
Tags: patch

Hi, 

It seems that debsign don't use the DEBRELEASE_DEBS_DIR variable from
devscripts configuration files like debrelease, debc, ...

Could it be possible to add it ? I attached a patch to do this.

Regards,
Philippe Le Brouster

--- /usr/bin/debsign	2008-09-23 20:24:17.000000000 +0200
+++ /home/plb/bin/debsign	2008-10-16 13:43:12.000000000 +0200
@@ -207,7 +207,8 @@
 DEFAULT_DEBSIGN_SIGNLIKE=
 DEFAULT_DEBSIGN_MAINT=
 DEFAULT_DEBSIGN_KEYID=
-VARS="DEBSIGN_PROGRAM DEBSIGN_SIGNLIKE DEBSIGN_MAINT DEBSIGN_KEYID"
+DEFAULT_DEBRELEASE_DEBS_DIR=".."
+VARS="DEBSIGN_PROGRAM DEBSIGN_SIGNLIKE DEBSIGN_MAINT DEBSIGN_KEYID DEBRELEASE_DEBS_DIR"
 
 if [ "$1" = "--no-conf" -o "$1" = "--noconf" ]; then
     shift
@@ -232,14 +233,20 @@
 	  [ -r $file ] && . $file
 	done
 
-	set | egrep '^(DEBSIGN|DEVSCRIPTS)_')
+	set | egrep '^(DEBSIGN|DEVSCRIPTS|DEBRELEASE)_')
 
     # check sanity
     case "$DEBSIGN_SIGNLIKE" in
 	gpg|pgp) ;;
 	*) DEBSIGN_SIGNLIKE= ;;
     esac
-
+    
+    # We do not replace this with a default directory to avoid accidentally
+    # signing a broken package
+    DEBRELEASE_DEBS_DIR="`echo \"$DEBRELEASE_DEBS_DIR\" | sed -e 's%/\+%/%g; s%\(.\)/$%\1%;'`"
+    if ! [ -d "$DEBRELEASE_DEBS_DIR" ]; then
+	debsdir_warning="config file specified DEBRELEASE_DEBS_DIR directory $DEBRELEASE_DEBS_DIR does not exist!"
+    fi
     # set config message
     MODIFIED_CONF=''
     for var in $VARS; do
@@ -618,10 +625,10 @@
 	sversion=`echo "$version" | perl -pe 's/^\d+://'`
 	pv="${package}_${sversion}"
 	pva="${package}_${sversion}_${arch}"
-	dsc="../$pv.dsc"
-	changes="../$pva.changes"
+	dsc="$DEBRELEASE_DEBS_DIR/$pv.dsc"
+	changes="$DEBRELEASE_DEBS_DIR/$pva.changes"
 	if [ -n "$multiarch" -o ! -r $changes ]; then
-	    changes=$(ls "../${package}_${sversion}_*+*.changes" "../${package}_${sversion}_multi.changes" 2>/dev/null | head -1)
+	    changes=$(ls "$DEBRELEASE_DEBS_DIR/${package}_${sversion}_*+*.changes" "$DEBRELEASE_DEBS_DIR/${package}_${sversion}_multi.changes" 2>/dev/null | head -1)
 	    if [ -z "$multiarch" ]; then
 		if [ -n "$changes" ]; then
 		    echo "$PROGNAME: could not find normal .changes file but found multiarch file:" >&2
@@ -633,7 +640,7 @@
 		fi
 	    elif [ -n "$multiarch" -a -z "$changes" ]; then
 		echo "$PROGNAME: could not find any multiarch .changes file with name" >&2
-		echo "../${package}_${sversion}_*.changes" >&2
+		echo "$DEBRELEASE_DEBS_DIR/${package}_${sversion}_*.changes" >&2
 		exit 1
 	    fi
 	fi

Reply via email to