quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] Making quilt edit quieter, take 2


From: Jean Delvare
Subject: [Quilt-dev] Making quilt edit quieter, take 2
Date: Fri, 9 Sep 2005 19:35:10 +0200

Hi all,

Here comes a second version of my "quilt edit be quiet" patch. Thank to
Andreas Gruenbacher, John Vandenberg and Joe Green for their comments on
the first version. I've updated it to be in sync with current CVS, and
made the following changes:

* The -q option of "quilt add" will hide the message usually printed
when a file is successfully added to a patch.

* The remove command was granted a -q option as well, which "quilt edit"
uses so that no message is printed when a file is left unedited.

With these changes, "quilt edit" will keep quiet as long as no problem
occurs. Comments welcome. If there are no objections, I will apply this
patch to CVS.

Thanks.

Index: quilt/add.in
===================================================================
RCS file: /cvsroot/quilt/quilt/quilt/add.in,v
retrieving revision 1.26
diff -u -r1.26 add.in
--- quilt/add.in        24 Aug 2005 14:54:16 -0000      1.26
+++ quilt/add.in        9 Sep 2005 17:33:48 -0000
@@ -19,7 +19,7 @@
 
 usage()
 {
-       printf $"Usage: quilt add [-p patch] {file} ...\n"
+       printf $"Usage: quilt add [-q] [-p patch] {file} ...\n"
        if [ x$1 = x-h ]
        then
                printf $"
@@ -29,6 +29,8 @@
 
 -p patch
        Patch to add files to.
+
+-q     Quiet operation.
 "
                exit 0
        else
@@ -60,7 +62,7 @@
        done
 }
 
-options=`getopt -o p:h -- "$@"`
+options=`getopt -o p:qh -- "$@"`
 
 if [ $? -ne 0 ]
 then
@@ -79,6 +81,9 @@
                        exit 1
                fi
                shift 2 ;;
+       -q)
+               opt_quiet=1
+               shift ;;
        -h)
                usage -h ;;
        --)
@@ -118,6 +123,7 @@
        fi
        if file_in_patch $SUBDIR$file $patch
        then
+               [ -n "$opt_quiet" ] || \
                printf $"File %s is already in patch %s\n" \
                       "$SUBDIR$file" "$(print_patch $patch)" >&2
                [ $status -ne 1 ] && status=2
@@ -152,6 +158,7 @@
                chmod u+w $SUBDIR$file
        fi
 
+       [ -n "$opt_quiet" ] || \
        printf $"File %s added to patch %s\n" \
               "$SUBDIR$file" "$(print_patch $patch)"
 done
Index: quilt/edit.in
===================================================================
RCS file: /cvsroot/quilt/quilt/quilt/edit.in,v
retrieving revision 1.9
diff -u -r1.9 edit.in
--- quilt/edit.in       9 Sep 2005 16:16:36 -0000       1.9
+++ quilt/edit.in       9 Sep 2005 17:33:48 -0000
@@ -59,7 +59,7 @@
        usage
 fi
 
-quilt_command add "$@"
+quilt_command add "$@" -q
 status=$?
 if [ $status -ne 0 -a $status -ne 2 ]
 then
@@ -71,7 +71,7 @@
 do
        if ! [ -e "$file" ]
        then
-               quilt_command remove "$file"
+               quilt_command remove "$file" -q
                status=1
        fi
 done
Index: quilt/remove.in
===================================================================
RCS file: /cvsroot/quilt/quilt/quilt/remove.in,v
retrieving revision 1.18
diff -u -r1.18 remove.in
--- quilt/remove.in     10 Feb 2005 10:59:24 -0000      1.18
+++ quilt/remove.in     9 Sep 2005 17:33:48 -0000
@@ -19,7 +19,7 @@
 
 usage()
 {
-       printf $"Usage: quilt remove [-p patch] {file} ...\n"
+       printf $"Usage: quilt remove [-q] [-p patch] {file} ...\n"
        if [ x$1 = x-h ]
        then
                printf $"
@@ -28,6 +28,8 @@
 
 -p patch
        Patch to remove files from.
+
+-q     Quiet operation.
 "
                exit 0
        else
@@ -35,7 +37,7 @@
        fi
 }
 
-options=`getopt -o p:h -- "$@"`
+options=`getopt -o p:qh -- "$@"`
 
 if [ $? -ne 0 ]
 then
@@ -54,6 +56,9 @@
                        exit 1
                fi
                shift 2 ;;
+       -q)
+               opt_quiet=1
+               shift ;;
        -h)
                usage -h ;;
        --)
@@ -120,6 +125,7 @@
                touch $QUILT_PC/$patch~refresh
        fi
        
+       [ -n "$opt_quiet" ] || \
        printf $"File %s removed from patch %s\n" \
               "$SUBDIR$file" "$(print_patch $patch)"
 done


-- 
Jean Delvare




reply via email to

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