summaryrefslogtreecommitdiffstats
path: root/pushpkgs
blob: 0e7e6f9bfbc82643dfc198c49f7fdbe76662df0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

if [ -z "$DEST" ] ; then
    echo "Specify the destination directory with the DEST env var." 1>&2
    exit 1
fi

cd pkg || exit 1

while [ $# -gt 0 ] ; do
    pkg=$1 ; shift
    if [ ! -d "$pkg" ] ; then
        echo "pkg/$pkg was not found." 1>&2
        continue
    fi

    echo "$DEST/$pkg"
    if [ -d "$DEST/$pkg" ] ; then
        rm -rf "$DEST/$pkg/trunk/"*
    fi

    mkdir -p "$DEST/$pkg/"{trunk,repos}
    cp -r -t "$DEST/$pkg/trunk" "$pkg"/* 

    # Add an SVN $Id$ comment at the end of the comments header
    cd "$DEST/$pkg/trunk"
    awk '!/^#/ && ! done { print "# $Id$"; done = 1 } 1' PKGBUILD \
        > PKGBUILD.new
    mv PKGBUILD.new PKGBUILD

    # Make sure it is used.
    svn propset svn:keywords Id PKGBUILD
done