diff --git a/obs-service-tar_scm.changes b/obs-service-tar_scm.changes index 140605e..7fa6fc9 100644 --- a/obs-service-tar_scm.changes +++ b/obs-service-tar_scm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 29 07:01:36 UTC 2011 - adrian@suse.de + +- make it possible to create tar balls without version tag (#714542) + ------------------------------------------------------------------- Fri Aug 26 06:49:13 UTC 2011 - adrian@suse.de diff --git a/tar_scm b/tar_scm index a55f9be..43202f5 100644 --- a/tar_scm +++ b/tar_scm @@ -13,7 +13,7 @@ # defaults MYSCM="" MYURL="" -MYVERSION="" +MYVERSION="_auto_" MYPREFIX="" MYFILENAME="" MYREVISION="" @@ -168,7 +168,7 @@ if [ "$MYSCM" == "svn" ]; then cd - fi fi - if [ -z "$VERSION" ]; then + if [ "$VERSION" == "_auto_" ]; then cd "$FILE" [ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX.rev" VERSION="$MYPREFIX"`LC_ALL=C svn info | sed -n 's,^Last Changed Rev: \(.*\),\1,p'` @@ -195,7 +195,7 @@ elif [ "$MYSCM" == "git" ]; then cd - fi fi - if [ -z "$VERSION" ]; then + if [ "$VERSION" == "_auto_" ]; then cd "$FILE" [ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX." VERSION="$MYPREFIX"`git show --pretty=%at | head -n 1` @@ -219,7 +219,7 @@ elif [ "$MYSCM" == "hg" ]; then hg update "$MYREVISION" || exit 1 cd - fi - if [ -z "$VERSION" ]; then + if [ "$VERSION" == "_auto_" ]; then cd "$FILE" [ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX." # current working revision @@ -246,7 +246,7 @@ elif [ "$MYSCM" == "bzr" ]; then bzr checkout "$MYURL" "${FILE}" || exit 1 fi fi - if [ -z "$VERSION" ]; then + if [ "$VERSION" == "_auto_" ]; then cd "$FILE" [ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX." VERSION="$MYPREFIX"`bzr revno` @@ -262,9 +262,15 @@ if [ ! -e "$FILE/$MYSUBDIR" ]; then exit 1 fi -mv "$FILE/$MYSUBDIR" "${FILE}-${VERSION}" || exit 1 +if [ -z "$VERSION" ]; then + FILENAME="$FILE" +else + FILENAME="${FILE}-${VERSION}" +fi -tar cf "$MYOUTDIR/${FILE}-${VERSION}.tar" $EXCLUDES "${FILE}-${VERSION}" || exit 1 -rm -rf "${FILE}-${VERSION}" "$FILE" +mv "$FILE/$MYSUBDIR" "${FILENAME}" || exit 1 + +tar cf "$MYOUTDIR/${FILENAME}.tar" $EXCLUDES "${FILENAME}" || exit 1 +rm -rf "${FILENAME}" "$FILE" exit 0