aboutsummaryrefslogtreecommitdiffstats
path: root/fork-svn
blob: 3509078dbcf95c615012d5a3665135d5f1b9830c (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
34
35
36
#!/bin/sh

SCRIPTSDIR=$(dirname $0)
. $SCRIPTSDIR/config

svn="sudo -u $COMMIT_USER /usr/bin/svn"

function create_branch()
{
    pkgname="$1"
    svn_url="$2"
    copy_dir="$3"
    if [ -z $svn_url ]
    then
	create_branch "$1" "$BIN_SVN" current
	create_branch "$1" "$PKG_SVN" pristine
	return
    fi
    pkg_url="$svn_url/$pkgname/$copy_dir"
    $svn info "$pkg_url" 2>/dev/null >&2 || \
	( echo "$pkgname not found on $svn_url" 2>/dev/null >&2 && return 1 )
    branch_url="$svn_url/$pkgname/branches"
    $svn info "$branch_url" 2>/dev/null >&2 \
    	|| $svn mkdir -m "SILENT: creating branches directory" "$branch_url"
    branch_url="$svn_url/$pkgname/branches/$NEW_RELEASE"
    $svn info "$branch_url" 2>/dev/null >&2 \
    	|| $svn cp -m "SILENT: Mageia Release $NEW_RELEASE" "$pkg_url" "$branch_url"
}

for srpm in $SRPMS_CORE_DIR/*.src.rpm $SRPMS_NONFREE_DIR/*.src.rpm $SRPMS_TAINTED_DIR/*.src.rpm
do
    echo "srpm: $srpm"
    rpmname=`rpm -qp --qf "%{NAME}\n" "$srpm"`
    [ -z $rpmname ] || create_branch "$rpmname"
done