diff options
author | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-04-16 00:44:41 -0500 |
---|---|---|
committer | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-04-16 00:44:41 -0500 |
commit | 7203e2e2631e29a79f4ea822c371d4e12c9c1a88 (patch) | |
tree | f0ada9061babb0f656afa90e438bba0f0f781241 /testing2x | |
parent | deab65fad4ced009fb31f7033b1db8ef0af78aee (diff) | |
parent | 229a9c504cbd733c93cf91399dc54bedf5160cc5 (diff) |
Merge branch 'master' of ~/packages/dbscripts into prueba
Conflicts:
.gitignore
db-functions
Diffstat (limited to 'testing2x')
-rwxr-xr-x | testing2x | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/testing2x b/testing2x new file mode 100755 index 0000000..54cae11 --- /dev/null +++ b/testing2x @@ -0,0 +1,61 @@ +#!/bin/bash + +. "$(dirname $0)/db-functions" +. "$(dirname $0)/config" + +if [ $# -lt 1 ]; then + msg "usage: $(basename $0) <pkgname|pkgbase> ..." + exit 1 +fi + +# Lock everything to reduce possibility of interfering task between the different repo-updates +script_lock +for repo in 'core' 'extra' 'testing'; do + for pkgarch in ${ARCHES[@]}; do + repo_lock ${repo} ${pkgarch} || exit 1 + done +done + +declare -A pkgs + +for pkgbase in $*; do + if [ ! -d "${WORKDIR}/${pkgbase}" ]; then + /usr/bin/svn export -q "${SVNREPO}/${pkgbase}/repos" "${WORKDIR}/${pkgbase}" >/dev/null + + found_source=false + for pkgarch in ${ARCHES[@]} 'any'; do + svnrepo_from="${WORKDIR}/${pkgbase}/testing-${pkgarch}" + if [ -r "${svnrepo_from}/PKGBUILD" ]; then + found_source=true + break + fi + done + ${found_source} || die "${pkgbase} not found in [testing]" + found_target=false + for pkgarch in ${ARCHES[@]} 'any'; do + for repo in 'core' 'extra'; do + svnrepo_to="${WORKDIR}/${pkgbase}/${repo}-${pkgarch}" + if [ -r "${svnrepo_to}/PKGBUILD" ]; then + found_target=true + pkgs[${repo}]+="${pkgbase} " + break 2 + fi + done + done + ${found_target} || die "${pkgbase} neither found in [core] nor [extra]" + fi +done + +for pkgarch in ${ARCHES[@]}; do + repo_unlock 'testing' ${pkgarch} +done +for repo in 'core' 'extra'; do + for pkgarch in ${ARCHES[@]}; do + repo_unlock ${repo} ${pkgarch} + done + if [ -n "${pkgs[${repo}]}" ]; then + "$(dirname $0)/db-move" 'testing' "${repo}" ${pkgs[${repo}]} + fi +done + +script_unlock |