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 -- 1.7.6