On Mon, 8 Aug 2011 21:21:45 +0200, Florian Pritz wrote:
Signed-off-by: Florian Pritz <bluewind@xinu.at>
diff --git a/archco b/archco index 3a153a7..098cf31 100755 --- a/archco +++ b/archco @@ -1,9 +1,13 @@ #!/bin/bash
scriptname=${0##*/} +CREATE= +STARTDIR=$PWD
if [ "$1" = '' ]; then - echo 'Usage: '$scriptname' <package name> [<package name>]' + echo 'Usage: '$scriptname' [options] <package name> [<package name>]' + echo "Options:" + echo " -n create new packages and check them out" exit 1 fi
@@ -18,6 +22,26 @@ case $scriptname in ;; esac
+if [[ $1 = "-n" ]]; then + CREATE=1 + shift + + TMPDIR=$(mktemp -d /tmp/$scripname.XXXXXXXX) + trap "rm -rf $TMPDIR" EXIT INT TERM + + cd $TMPDIR + svn checkout -N "$SVNURL" svn + +fi + for i in "$@"; do + if (($CREATE)); then + cd $TMPDIR/svn + mkdir -p "$i/"{repos,trunk} + svn add "$i" + svn commit -m "add new package: $i" + cd $STARTDIR + fi + svn co "$SVNURL/$i" done
archco shouldn't commit a package itself. This is kind of unexpected. So two suggestions: create a new script for this and/or do not commit. -- Pierre Schmitz, https://users.archlinux.de/~pierre