]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- add support to confirm each chunk to adapter
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 12 Dec 2005 12:57:37 +0000 (12:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- skip xterm title updates when output is not terminal

Changed files:
    builder.sh -> 1.356

builder.sh

index 7a478749709071ee08a63b28d8de0e68146ec34f..03168a335deb83d1586da6ac14a9118e3966fa05 100644 (file)
@@ -286,6 +286,7 @@ Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
 }
 
 update_shell_title() {
+       [ -t 1 ] || return
        local msg="builder[$SPECFILE] $*"
        case "$TERM" in
                cygwin|xterm*)
@@ -1474,7 +1475,7 @@ adapterize()
                  if [ -t 1 ]; then
                                diffcol $tmpdir/$SPECFILE.diff | less -r
                                while : ; do
-                                        echo -n "Accept? [yn] "
+                                        echo -n "Accept? (Yes, No, Confirm)? "
                                         read ans
                                         case "$ans" in
                                         [yYoO]) # y0 mama
@@ -1482,6 +1483,24 @@ adapterize()
                                                  echo "Ok, adapterized."
                                                  break
                                         ;;
+                                        [cC]) # confirm each chunk
+                                                 head -n 2 $tmpdir/$SPECFILE.diff > $tmpdir/header.diff
+                                                 lines=$(grep -n ^@@ $tmpdir/$SPECFILE.diff | cut -d: -f1)
+                                                 for a in $lines; do
+                                                               t=$tmpdir/chunk-$a.diff
+                                                               cat $tmpdir/header.diff > $t
+                                                               sed -ne "$a,/@@/p" $tmpdir/$SPECFILE.diff >> $t
+                                                               diffcol $t | less -r
+                                                               echo -n "Accept? (Yes, [N]o)? "
+                                                               read ans
+                                                               case "$ans" in
+                                                               [yYoO]) # y0 mama
+                                                                       patch < $t
+                                                                       ;;
+                                                               esac
+                                                 done
+                                                 break
+                                        ;;
                                         [nNsS])
                                                  echo "Ok, exiting."
                                                  break
This page took 0.041822 seconds and 4 git commands to generate.