Hello Werner,

On Monday 27 June 2005 01:24, Werner Almesberger wrote:
> In quilt 0.40, if QUILT_PATCHES contains an absolute path name,
> quilt diff -z produces incorrect, confusing output.

The diff command can be fixed easily for the absolute $QUILT_PATCHES case by 
not changing the working directory, as in the attached patch. I don't see any 
obvious problems in other places, but I didn't look very hard.

Cheers,
Andreas.
Index: quilt/diff.in
===================================================================
RCS file: /cvsroot/quilt/quilt/quilt/diff.in,v
retrieving revision 1.49
diff -u -r1.49 diff.in
--- quilt/diff.in	6 Jun 2005 19:34:28 -0000	1.49
+++ quilt/diff.in	27 Jun 2005 07:27:01 -0000
@@ -335,16 +335,10 @@
 	patch_file=$(patch_file_name $last_patch)
 	patch_args=$(patch_args $last_patch)
 	workdir=$(gen_tempfile -d $PWD/quilt)
-	pwd=$PWD
 
-	if ! cd $QUILT_PC/$last_patch
-	then
-		printf $"Cannot change into directory %s\n" \
-		       "$QUILT_PC/$last_patch" >&2
-		die 1
-	fi
 	if [ [EMAIL PROTECTED] -gt 0 ] \
-	   && ! cp -l --parents "[EMAIL PROTECTED]" $workdir/
+	   && ! ( cd $QUILT_PC/$last_patch &&
+		  cp -l --parents "[EMAIL PROTECTED]" $workdir/ )
 	then
 		printf $"Failed to copy files to temporary directory\n" >&2
 		die 1
@@ -355,16 +349,10 @@
 	# them: We must remove them here.
 	find $workdir -type f -size 0 -exec rm -f '{}' ';'
 
-	if ! cd $workdir
+	if [ -s $patch_file ]
 	then
-		printf $"Cannot change to temporary directory\n" >&2
-		die 1
-	fi
-	
-	if [ -s $pwd/$patch_file ]
-	then
-		if ! cat_file $pwd/$patch_file \
-		     | @PATCH@ $QUILT_PATCH_OPTS $patch_args \
+		if ! cat_file $patch_file \
+		     | @PATCH@ -d $workdir $QUILT_PATCH_OPTS $patch_args \
 		     	       --no-backup-if-mismatch -Ef \
 			       >/dev/null 2>/dev/null
 		then
@@ -373,18 +361,13 @@
 			# applied, we know that it won't apply cleanly. In
 			# all other cases, print a warning.
 			
-			if [ ! -e $pwd/$QUILT_PC/$last_patch~refresh -a \
+			if [ ! -e $QUILT_PC/$last_patch~refresh -a \
 			       [EMAIL PROTECTED] -eq 0 ]
 			then
 				printf $"Failed to patch temporary files\n" >&2
 			fi
 		fi
 	fi
-	if ! cd $pwd
-	then
-		printf $"Cannot change to source directory\n" >&2
-		die 1
-	fi
 fi
 
 for file in "[EMAIL PROTECTED]"
_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to