From b5fb2927cde513dc0fd82e4fd4dfe3836cf35728 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 15 Aug 2010 20:55:26 +0200 Subject: Lock repos before checking --- db-update | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'db-update') diff --git a/db-update b/db-update index 73897f3..b11face 100755 --- a/db-update +++ b/db-update @@ -11,43 +11,39 @@ fi # Find repos with packages to release repos=($(find "${STAGING}" -mindepth 1 -type d ! -empty -printf '%f ' 2>/dev/null)) if [ $? -ge 1 ]; then - error "Could not read ${STAGING}" - exit 1 + die "Could not read ${STAGING}" fi +# TODO: this might lock too much (architectures) +for repo in ${repos[@]}; do + for pkgarch in ${ARCHES[@]}; do + repo_lock ${repo} ${pkgarch} || exit 1 + done +done + +# check if packages are valid for repo in ${repos[@]}; do if ! check_repo_permission "${repo}"; then - error "You don't have permission to update packages in ${repo}" - exit 1 + die "You don't have permission to update packages in ${repo}" fi pkgs=($(getpkgfiles "${STAGING}/${repo}/"*${PKGEXT})) if [ $? -eq 0 ]; then for pkg in ${pkgs[@]}; do if ! check_pkgfile "${pkg}"; then - error "Package ${repo}/$(basename ${pkg}) is not consistent with its meta data" - exit 1 + die "Package ${repo}/$(basename ${pkg}) is not consistent with its meta data" fi if ! check_pkgsvn "${pkg}" "${repo}"; then - error "Package ${repo}/$(basename ${pkg}) is not consistent with svn repository" - exit 1 + die "Package ${repo}/$(basename ${pkg}) is not consistent with svn repository" fi if [ -f "${FTP_BASE}/$(get_pkgpool_for_host)/$(basename ${pkg})" ]; then - error "Package ${repo}/$(basename pkg) already exists in ${FTP_BASE}/$(get_pkgpool_for_host)" - exit 1 + die "Package ${repo}/$(basename pkg) already exists in ${FTP_BASE}/$(get_pkgpool_for_host)" fi done else - exit 1 + die "Could not read ${STAGING}" fi done -# TODO: this might lock too much (architectures) -for repo in ${repos[@]}; do - for pkgarch in ${ARCHES[@]}; do - repo_lock ${repo} ${pkgarch} || exit 1 - done -done - for repo in ${repos[@]}; do msg "Updating [${repo}]..." any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) -- cgit v1.2.3-24-g4f1b