#!/bin/bash . "$(dirname $0)/config" . "$(dirname $0)/db-functions" if [ $# -lt 1 ]; then msg "usage: ${0##*/} ..." exit 1 fi # Lock everything to reduce possibility of interfering task between the different repo-updates script_lock for repo in ${TESTING_REPO} ${STABLE_REPOS[@]}; do for pkgarch in ${ARCHES[@]}; do repo_lock ${repo} ${pkgarch} || exit 1 done done for pkgname in "$@"; do msg "Moving $pkgname" for pkgarch in ${ARCHES[@]}; do repo_from="" repo_to="" found_source=false found_target=false path="${HISTORYREPO}/${TESTING_REPO}/${pkgarch}/${pkgname}" if [ -e "${path}" ]; then found_source=true repo_from="${TESTING_REPO}" fi ${found_source} || continue for repo in ${STABLE_REPOS[@]}; do path="${HISTORYREPO}/${repo}/${pkgarch}/${pkgname}" if [ -e "${path}" ]; then found_target=true repo_to="${repo}" msg2 "$pkgarch $repo_from -> $repo_to" arch_db_move "$repo_from" "$repo_to" "$pkgarch" "$pkgname" break fi done ${found_target} || warning "${pkgname} not found in any of these repos: ${STABLE_REPOS[@]}. skipping" done ${found_source} || warning "${pkgname} not found in [${TESTING_REPO}]. skipping" done arch_history_commit "testing2x: $@" for repo in ${TESTING_REPO} ${STABLE_REPOS[@]}; do for pkgarch in ${ARCHES[@]}; do repo_unlock ${repo} ${pkgarch} done done script_unlock