forked from pool/obs-service-extract_file
allow subdirectories
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/obs-service-extract_file?expand=0&rev=3
This commit is contained in:
parent
121595aa19
commit
3b6130c61f
10
extract_file
10
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
|
||||
|
@ -9,5 +9,8 @@
|
||||
<description>Files to extract. You may use this parameter multiple times</description>
|
||||
<required/>
|
||||
</parameter>
|
||||
<parameter name="outfilename">
|
||||
<description>Rename file into outfilename</description>
|
||||
</parameter>
|
||||
</service>
|
||||
|
||||
|
5
obs-service-extract_file.changes
Normal file
5
obs-service-extract_file.changes
Normal file
@ -0,0 +1,5 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 23 15:36:13 UTC 2011 - adrian@suse.de
|
||||
|
||||
- initial package
|
||||
|
Loading…
Reference in New Issue
Block a user