diff --git a/obs-service-tar_scm.changes b/obs-service-tar_scm.changes index f113d22..9dfba64 100644 --- a/obs-service-tar_scm.changes +++ b/obs-service-tar_scm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 24 15:46:17 UTC 2012 - rschiele@gmail.com + +- add new option to specify a subset of files/subdirectories to + pack in the tar ball + ------------------------------------------------------------------- Tue Jan 24 13:26:19 UTC 2012 - rschiele@gmail.com diff --git a/tar_scm b/tar_scm index 6497742..b211f2e 100644 --- a/tar_scm +++ b/tar_scm @@ -19,6 +19,7 @@ MYFILENAME="" MYREVISION="" MYPACKAGEMETA="" MYGITARGS="--depth 1" +INCLUDES="" while test $# -gt 0; do case $1 in @@ -42,6 +43,10 @@ while test $# -gt 0; do MYVERSION="$2" shift ;; + *-include) + INCLUDES="$INCLUDES $2" + shift + ;; *-versionprefix) MYPREFIX="$2" shift @@ -276,9 +281,18 @@ else FILENAME="${FILE}-${VERSION}" fi +MYINCLUDES="" + +for INC in $INCLUDES; do + MYINCLUDES="$MYINCLUDES $FILENAME/$INC" +done +if [ -z "$MYINCLUDES" ]; then + MYINCLUDES="$FILENAME" +fi + mv "$FILE/$MYSUBDIR" "${FILENAME}" || exit 1 -tar cf "$MYOUTDIR/${FILENAME}.tar" $EXCLUDES "${FILENAME}" || exit 1 +tar cf "$MYOUTDIR/${FILENAME}.tar" $EXCLUDES $MYINCLUDES || exit 1 rm -rf "${FILENAME}" "$FILE" exit 0 diff --git a/tar_scm.service b/tar_scm.service index 2709f50..9b38e90 100644 --- a/tar_scm.service +++ b/tar_scm.service @@ -26,7 +26,10 @@ base file name to be created - for sepcifing excludes when creating the tar ball + for specifying excludes when creating the tar ball + + + for specifying subset of files/subdirectories to pack in the tar ball version to be used in tar. Setting it to an empty string is disabling the version tag.