aboutsummaryrefslogtreecommitdiffstats
path: root/fork-svn
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-05-31 14:57:56 +0000
committerNicolas Vigier <boklm@mageia.org>2011-05-31 14:57:56 +0000
commit1ac9bb5bdf69132475d98a9685757464be4cebea (patch)
treed836e9a04b3476c56d996a504b0332b1bcc8fa5e /fork-svn
parent0759575f1bc7eb84ffc60acbb4ce7b9fbaecada0 (diff)
downloadrelease-1ac9bb5bdf69132475d98a9685757464be4cebea.tar
release-1ac9bb5bdf69132475d98a9685757464be4cebea.tar.gz
release-1ac9bb5bdf69132475d98a9685757464be4cebea.tar.bz2
release-1ac9bb5bdf69132475d98a9685757464be4cebea.tar.xz
release-1ac9bb5bdf69132475d98a9685757464be4cebea.zip
add script to fork svn
Diffstat (limited to 'fork-svn')
-rwxr-xr-xfork-svn36
1 files changed, 36 insertions, 0 deletions
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
+