Hello,

this is a new revision of this patch. Changes:

 - removed the -r option to "quilt files"; now the printed filenames are
   always relative to the working directory
 - fixed a bug that swallowed the first directory component that did not
   match the corresponding component of the working directory; now it is
   replaced with "../"
 - relative_to_subdir() can now be used as a filter again: the state
   (rm_common) is reset for each filename
 - simplified relative_to_subdir() by removing special handling (a fast
   path) for files in the working directory

Regards,

-- 
Olaf Dabrunz (od/odabrunz), SUSE Linux Products GmbH, Nürnberg

 quilt/files.in      |    1 +
 scripts/patchfns.in |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)

Index: quilt/files.in
===================================================================
--- quilt/files.in.orig
+++ quilt/files.in
@@ -167,6 +167,7 @@ list_files_in_patch()
                                echo -n "$patch "
                        fi
                fi
+               file="$(echo $file | relative_to_subdir)"
                if [ -z "$use_status" ]
                then
                        echo "$file"
Index: scripts/patchfns.in
===================================================================
--- scripts/patchfns.in.orig
+++ scripts/patchfns.in
@@ -494,6 +494,27 @@ filenames_in_patch()
        fi
 }
 
+relative_to_subdir()
+{
+       local path subdir relpath rm_common
+       while read relpath ; do
+               subdir="$SUBDIR"
+               rm_common=1
+               while [ -n "$subdir" ] ; do
+                       path="${relpath}"
+                       test "$rm_common" && {
+                               relpath="${relpath#${subdir%%/*}/}"
+                               [ "$relpath" = "$path" ] && rm_common=""
+                       }
+                       test "$rm_common" || {
+                               relpath="../${relpath}"
+                       }
+                       subdir="${subdir#*/}"
+               done
+               echo "$relpath"
+       done
+}
+
 files_in_patch_ordered()
 {
        local patch=$1
_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to