Merge branch '__unpack_tar_extra_args' into 'master'

[__unpack] add parameter --tar-extra-args

See merge request ungleich-public/cdist!922
This commit is contained in:
poljakowski 2020-08-15 21:07:20 +02:00
commit 54c525e36c
3 changed files with 19 additions and 0 deletions

View file

@ -23,6 +23,13 @@ case "$src" in
cmd="$cmd --strip-components=$tar_strip" cmd="$cmd --strip-components=$tar_strip"
fi fi
if [ -f "$__object/parameter/tar-extra-args" ]
then
tar_extra_args="$( cat "$__object/parameter/tar-extra-args" )"
cmd="$cmd $tar_extra_args"
fi
;; ;;
*.7z) *.7z)
case "$os" in case "$os" in

View file

@ -33,6 +33,10 @@ sum-file
tar-strip tar-strip
Tarball specific. See ``man tar`` for ``--strip-components``. Tarball specific. See ``man tar`` for ``--strip-components``.
tar-extra-args
Tarball sepcific. Append additional arguments to ``tar`` command.
See ``man tar`` for possible arguments.
OPTIONAL BOOLEAN PARAMETERS OPTIONAL BOOLEAN PARAMETERS
--------------------------- ---------------------------
@ -65,6 +69,13 @@ EXAMPLES
--preserve-archive \ --preserve-archive \
--destination /opt/cpma/server --destination /opt/cpma/server
# example usecase for --tar-* args
__unpack /root/strelaysrv.tar.gz \
--preserve-archive \
--destination /usr/local/bin \
--tar-strip 1 \
--tar-extra-args '--wildcards "*/strelaysrv"'
AUTHORS AUTHORS
------- -------

View file

@ -1,2 +1,3 @@
sum-file sum-file
tar-strip tar-strip
tar-extra-args