diff options
author | Nicolas Vigier <boklm@mageia.org> | 2011-05-31 14:57:56 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2011-05-31 14:57:56 +0000 |
commit | 1ac9bb5bdf69132475d98a9685757464be4cebea (patch) | |
tree | d836e9a04b3476c56d996a504b0332b1bcc8fa5e | |
parent | 0759575f1bc7eb84ffc60acbb4ce7b9fbaecada0 (diff) | |
download | release-1ac9bb5bdf69132475d98a9685757464be4cebea.tar release-1ac9bb5bdf69132475d98a9685757464be4cebea.tar.gz release-1ac9bb5bdf69132475d98a9685757464be4cebea.tar.bz2 release-1ac9bb5bdf69132475d98a9685757464be4cebea.tar.xz release-1ac9bb5bdf69132475d98a9685757464be4cebea.zip |
add script to fork svn
-rw-r--r-- | config | 11 | ||||
-rwxr-xr-x | fork-svn | 36 |
2 files changed, 44 insertions, 3 deletions
@@ -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 + |