aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config11
-rwxr-xr-xfork-svn36
2 files changed, 44 insertions, 3 deletions
diff --git a/config b/config
index 1afa727..23e34d9 100644
--- a/config
+++ b/config
@@ -1,9 +1,14 @@
NEW_RELEASE=1
-PKG_SVN=svn+ssh://svn.mageia.org/svn/test/packages/cauldron
-BIN_SVN=svn+ssh://svn.mageia.org/svn/test/binrepos/cauldron
+PKG_SVN=file:///svn/test/packages/cauldron
+BIN_SVN=file:///svn/test/binrepos/cauldron
MIRROR_DIR=/distrib/test/mirror
+COMMIT_USER=schedbot
+
DISTRIB_DIR="$MIRROR_DIR/distrib"
+NEW_RELEASE_TMP_DIR=/distrib/newrelease/$NEW_RELEASE
+SRPMS_CORE_DIR=$NEW_RELEASE_TMP_DIR/SRPMS/core/release
+SRPMS_NONFREE_DIR=$NEW_RELEASE_TMP_DIR/SRPMS/nonfree/release
+SRPMS_TAINTED_DIR=$NEW_RELEASE_TMP_DIR/SRPMS/tainted/release
CAULDRON_MIRROR_DIR="$DISTRIB_DIR/cauldron"
NEW_RELEASE_MIRROR_DIR="$DISTRIB_DIR/$NEW_RELEASE"
-NEW_RELEASE_TMP_DIR="$DISTRIB_DIR/.tmp-release-$NEW_RELEASE"
diff --git a/fork-svn b/fork-svn
new file mode 100755
index 0000000..c353586
--- /dev/null
+++ b/fork-svn
@@ -0,0 +1,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" || \
+ ( 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 "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
+