From 3b6130c61ff52ce05ef8078fa19e054d0598bc06bcf24c091660463d73abf70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 23 Feb 2011 15:36:45 +0000 Subject: [PATCH] allow subdirectories OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-extract_file?expand=0&rev=3 --- extract_file | 10 +++++++++- extract_file.service | 3 +++ obs-service-extract_file.changes | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 obs-service-extract_file.changes diff --git a/extract_file b/extract_file index 2ea0d30..af91099 100644 --- a/extract_file +++ b/extract_file @@ -5,6 +5,7 @@ # defaults MYARCHIVE="" MYFILES="" +OUTFILE="." while test $# -gt 0; do case $1 in @@ -13,7 +14,11 @@ while test $# -gt 0; do shift ;; *-file|*-files) - MYFILES="$MYFILES ${2##*/}" + MYFILES="$MYFILES ${2}" + shift + ;; + *-outfilename) + OUTFILE="${2}" shift ;; *-outdir) @@ -60,6 +65,9 @@ if [ -e "$existing_archive" ]; then echo "ERROR: unknown archive format $existing_archive" exit 1 fi + for i in $MYFILES; do + mv "$i" "$OUTFILE" + done else echo "ERROR: archive not found: $existing_archive" exit 1 diff --git a/extract_file.service b/extract_file.service index 5f62ca1..5819e5f 100644 --- a/extract_file.service +++ b/extract_file.service @@ -9,5 +9,8 @@ Files to extract. You may use this parameter multiple times + + Rename file into outfilename + diff --git a/obs-service-extract_file.changes b/obs-service-extract_file.changes new file mode 100644 index 0000000..b52a452 --- /dev/null +++ b/obs-service-extract_file.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Wed Feb 23 15:36:13 UTC 2011 - adrian@suse.de + +- initial package +