quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] [PATCH] files: Return nothing if there are no files


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] files: Return nothing if there are no files
Date: Tue, 11 Feb 2014 14:39:24 +0100

"quilt files" returns a blank line if no files are included in the
patch. This could easily break constructs such as "quilt files | wc
-l" or "if [ -z "$(quilt files)" ]". Let "quilt files" return nothing
at all if there are no files in the patch.
---
 quilt/files.in     |    2 +-
 test/example1.test |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

--- quilt.orig/quilt/files.in
+++ quilt/quilt/files.in
@@ -128,7 +128,7 @@ list_files_in_patch()
        fi
        # Note: If opt_labels is set, then use_status is not set.
        IFS=
-       echo $(files_in_patch "$patch") |
+       echo -n $(files_in_patch "$patch") |
        sort |
        while read file
        do
--- quilt.orig/test/example1.test
+++ quilt/test/example1.test
@@ -12,6 +12,7 @@ http://the-tech.mit.edu/Shakespeare/mids
        $ quilt new flower.diff
        > Patch %{P}flower.diff is now on top
 
+       $ quilt files
        $ quilt add Oberon.txt
        > File Oberon.txt added to patch %{P}flower.diff
 

-- 
Jean Delvare
Suse L3 Support




reply via email to

[Prev in Thread] Current Thread [Next in Thread]