--- common/cvs-import.sh 2008/02/08 18:52:15 1.7 +++ common/cvs-import.sh 2008/07/30 18:02:34 1.8 @@ -5,7 +5,9 @@ # Copyright (C) 2004-2005 Red Hat, Inc. # Copyright (C) 2005 Fedora Foundation # -# $Id: cvs-import.sh,v 1.4 2008/02/06 21:03:30 slords Exp $ +# $Id: cvs-import.sh,v 1.7 2008/02/08 18:52:15 slords Exp $ + +shopt -s nocasematch # Initial setup CVSTREE=${CVSTREE:=extras} @@ -27,6 +29,8 @@ if test -w $(pwd) ; then WORKDIR="$(pwd)" fi +[ -f branch ] && BRANCH=$(cat branch) + # short usage help Usage() { cat </dev/null)" ] ; then + echo "ERROR: $PACKAGE was already imported on branch ${BRANCH:-HEAD}" + CleanUp + exit -2 +fi +# Check here as well because back in the old days we used to write it here if [ -n "$(grep ""^$LOG_ENTRY"" ./import.log 2>/dev/null)" ] ; then echo "ERROR: $PACKAGE was already imported on branch ${BRANCH:-HEAD}" CleanUp @@ -200,6 +209,7 @@ FILES=$(rpm -qpl $PACKAGE 2>/dev/null) # Remove the files that are no longer present OLDFILES=$(find ${BRANCH} -maxdepth 1 -type f \ -not -name branch \ + -not -name import.log \ -not -name sources \ -not -name Makefile \ -not -name .cvsignore \ @@ -242,9 +252,9 @@ for _f in $FILES ; do pushd ${BRANCH} >/dev/null if [ "$add_file" = "yes" ] ; then case $f in - *.tar | *gz | *.bz2 | *.Z | *.zip | *.ZIP | \ - *.ttf | *.bin | *.tbz | *.pdf | *.rpm | \ - *.jar | *.war | *.db | *.cpio | *.jisp | *.egg ) + *.tar | *gz | *.bz2 | *.lzma | *.Z | *.zip | \ + *.ttf | *.bin | *.tbz | *.tbz2 | *.pdf | *.rpm | \ + *.jar | *.war | *.db | *.cpio | *.jisp | *.egg | *.gem ) UPLOADFILES="$UPLOADFILES $f" if [ -n "$(grep $f sources 2>/dev/null)" ] ; then # this file existed before with a different md5sum @@ -282,7 +292,8 @@ popd >/dev/null rm -rf $TMP2 # setup finished -echo "$LOG_ENTRY:$(date +%s)" >> ./import.log +[ -f ./${BRANCH}/import.log ] || $(touch ./${BRANCH}/import.log; cvs add ./${BRANCH}/import.log) +echo "$LOG_ENTRY:$(date +%s)" >> ./${BRANCH}/import.log echo "=======================================================================" cvs -Q diff -u @@ -294,7 +305,8 @@ read cvs -Q update && \ echo "cvs commit..." && \ - cvs -Q commit ${MESSAGE:+-m "$MESSAGE"} && echo "Commit Complete" + cvs -Q commit ${MESSAGE:+-m "$MESSAGE"} && echo "Commit Complete" && \ + cd ${BRANCH} && make tag && echo "Tagging '${TAG}' complete." # Clean up CleanUp