aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rpm2targz')
-rwxr-xr-xrpm2targz18
1 files changed, 11 insertions, 7 deletions
diff --git a/rpm2targz b/rpm2targz
index dcfdc27..9a0087c 100755
--- a/rpm2targz
+++ b/rpm2targz
@@ -26,16 +26,18 @@ argv0=${0##*/}
usage=false
stdout=false
verbose=false
+strip=false
files=false
msg=""
for opt; do
case ${opt} in
- -h|--help) usage=true;;
- -O|--stdout) stdout=true;;
- -v|--verbose) verbose=true;;
- --) break;;
- -*) usage=true msg="unknown option '${opt}'";;
- *) files=true;;
+ -h|--help) usage=true;;
+ -O|--stdout) stdout=true;;
+ -v|--verbose) verbose=true;;
+ -S|--strip-path) strip=true;;
+ --) break;;
+ -*) usage=true msg="unknown option '${opt}'";;
+ *) files=true;;
esac
done
@@ -48,6 +50,7 @@ if ! ${files} || ${usage} ; then
Options:
-h, --help This help screen (imagine that)
-O, --stdout Write tarball to stdout
+ -S, --strip-path Strip package name from tarball
-v, --verbose Verbose output
EOF
@@ -109,6 +112,7 @@ for file; do
case ${file} in
-v|--verbose) continue;;
-O|--stdout) continue;;
+ -S|--strip-path) continue;;
--) dashdash=true; continue;;
esac
fi
@@ -117,7 +121,7 @@ for file; do
outfile=${file##*/}
outfile=${outfile%.rpm}
- base=${outfile%.src}
+ ${strip} && base="" || base=${outfile%.src}
DEST="${WORKDIR}/${base}"
rm -rf "${DEST}"
if ! mkdir "${DEST}" ; then