diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-08-15 20:55:26 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-08-15 20:55:26 +0200 |
commit | b5fb2927cde513dc0fd82e4fd4dfe3836cf35728 (patch) | |
tree | a865bdac4e9bd0d273ca5a6aa4bc93ced9216557 /db-update | |
parent | 583863043ad11eb203c479c9d0eea825a29ace39 (diff) | |
download | dbscripts-b5fb2927cde513dc0fd82e4fd4dfe3836cf35728.tar.gz dbscripts-b5fb2927cde513dc0fd82e4fd4dfe3836cf35728.tar.xz |
Lock repos before checking
Diffstat (limited to 'db-update')
-rwxr-xr-x | db-update | 32 |
1 files changed, 14 insertions, 18 deletions
@@ -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)) |