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"
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
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