[packages/adapter: 435/631] - add -o arg
glen
glen at pld-linux.org
Mon Sep 12 20:10:54 CEST 2016
commit deb09aaae999dc68874424a8bb4c7692ac5f2425
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Mon Jan 5 18:05:12 2009 +0000
- add -o arg
Changed files:
adapter.sh -> 1.32
adapter.sh | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/adapter.sh b/adapter.sh
index 72d6384..afbcd4f 100644
--- a/adapter.sh
+++ b/adapter.sh
@@ -32,7 +32,8 @@ usage="Usage: $self [FLAGS] SPECFILE
skip desc wrapping
-a|--skip-defattr
skip %defattr corrections
-
+-o
+ do not do any diffing, just dump the output
"
if [ ! -x /usr/bin/getopt ]; then
@@ -45,7 +46,7 @@ if [ ! -x /usr/bin/patch ]; then
exit 1
fi
-t=$(getopt -o hsmdaV --long help,version,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$self" -- "$@") || exit $?
+t=$(getopt -o hsomdaV --long help,version,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$self" -- "$@") || exit $?
eval set -- "$t"
while true; do
@@ -69,6 +70,9 @@ while true; do
-V|--version)
echo "$VERSIONSTRING"
exit 0
+ ;;
+ -o)
+ outputonly=1
;;
--)
shift
@@ -214,7 +218,10 @@ adapterize() {
$awk -f $adapter $SPECFILE > $tmp || exit
- if [ "$(diff --brief $SPECFILE $tmp)" ]; then
+ if [ "$outputonly" = 1 ]; then
+ cat $tmp
+
+ elif [ "$(diff --brief $SPECFILE $tmp)" ]; then
diff -u $SPECFILE $tmp > $tmp.diff
if [ -t 1 ]; then
diffcol $tmp.diff | less -r
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885
More information about the pld-cvs-commit
mailing list