]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - adapter.sh
- more sf url unify
[packages/rpm-build-tools.git] / adapter.sh
index 44fe4bb1e89315a5f55a5435325413206f59a5ae..0b467f21eb77f8155cc68f38e7c80cd9aa58582e 100644 (file)
@@ -28,10 +28,12 @@ usage="Usage: $self [FLAGS] SPECFILE
        skip %defattr corrections
 
 "
+
 if [ ! -x /usr/bin/getopt ]; then
-echo "You need to install util-linux to use adapter"
-exit 0
+       echo >&1 "You need to install util-linux to use adapter"
+       exit 1
 fi
+
 t=`getopt -o hsmda --long help,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$self" -- "$@"` || exit $?
 eval set -- "$t"
 
@@ -128,7 +130,7 @@ adapterize()
         tmpdir=$(mktemp -d ${TMPDIR:-/tmp}/adapter-XXXXXX) || exit
         awk -f adapter.awk $SPECFILE > $tmpdir/$SPECFILE || exit
 
-        if [ "`diff --brief $SPECFILE $tmpdir/$SPECFILE`" ] ; then
+        if [ "`diff --brief $SPECFILE $tmpdir/$SPECFILE`" ]; then
                  diff -u $SPECFILE $tmpdir/$SPECFILE > $tmpdir/$SPECFILE.diff
                  if [ -t 1 ]; then
                                diffcol $tmpdir/$SPECFILE.diff | less -r
@@ -145,12 +147,15 @@ adapterize()
                                                  diff2hunks $tmpdir/$SPECFILE.diff
                                                  for t in $(ls $tmpdir/$SPECFILE-*.diff); do
                                                                diffcol $t | less -r
-                                                               echo -n "Accept? (Yes, [N]o)? "
+                                                               echo -n "Accept? (Yes, [N]o, Quit)? "
                                                                read ans
                                                                case "$ans" in
                                                                [yYoO]) # y0 mama
                                                                        patch < $t
                                                                        ;;
+                                                               [Q])  # Abort
+                                                                       break
+                                                                       ;;
                                                                esac
                                                  done
                                                  break
This page took 0.033033 seconds and 4 git commands to generate.