diff --git a/tar_scm b/tar_scm index d0ec24c..1a79a4d 100644 --- a/tar_scm +++ b/tar_scm @@ -81,6 +81,7 @@ if [ -z "$MYOUTDIR" ]; then exit 1 fi +SRCDIR=$(pwd) cd "$MYOUTDIR" if [ -z "$FILE" -a "$MYSCM" == "git" ]; then @@ -97,7 +98,7 @@ if [ -z "$FILE" -a "$MYSCM" == "hg" ]; then FILE="${FILE##*/}" fi -existing_tar=$(echo _service:*tar_scm:${FILE}-*.tar*) +existing_tar=$(echo $SRCDIR/_service:*tar_scm:${FILE}-*.tar*) if [ -e "$existing_tar" ]; then UNCOMPRESS="cat" if [ "${existing_tar%.tar.gz}" != "$existing_tar" ]; then @@ -190,9 +191,6 @@ elif [ "$MYSCM" == "hg" ]; then cd "$TAR_DIRECTORY" OLDVERSION=`hg id -i -rtip` hg pull || exit 1 - if [ -n "$MYREVISION" ]; then - hg update "$MYREVISION" || exit 1 - fi NEWVERSION=`hg id -i -rtip` cd - if [ "$OLDVERSION" == "$NEWVERSION" ]; then @@ -204,12 +202,12 @@ elif [ "$MYSCM" == "hg" ]; then else # new checkout hg clone "$MYURL" "${FILE}" || exit 1 - if [ -n "$MYREVISION" ]; then - cd "$FILE" - hg update "$MYREVISION" || exit 1 - cd - - fi fi + if [ -n "$MYREVISION" ]; then + cd "$FILE" + hg update "$MYREVISION" || exit 1 + cd - + fi if [ -z "$VERSION" ]; then cd "$FILE" [ -n "$MYPREFIX" ] && MYPREFIX="$MYPREFIX."