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