summaryrefslogtreecommitdiff
path: root/db-update
diff options
context:
space:
mode:
Diffstat (limited to 'db-update')
-rwxr-xr-xdb-update29
1 files changed, 21 insertions, 8 deletions
diff --git a/db-update b/db-update
index 0359697..74d3f45 100755
--- a/db-update
+++ b/db-update
@@ -1,19 +1,26 @@
#!/bin/bash
-. "$(dirname $0)/db-functions"
-. "$(dirname $0)/config"
+. "$(dirname "$(readlink -e "$0")")/config"
+. "$(dirname "$(readlink -e "$0")")/db-functions"
if [ $# -ge 1 ]; then
- warning "Calling $(basename $0) with a specific repository is no longer supported"
+ warning "Calling ${0##*/} with a specific repository is no longer supported"
exit 1
fi
# Find repos with packages to release
-repos=($(find "${STAGING}" -mindepth 1 -maxdepth 1 -type d ! -empty -printf '%f ' 2>/dev/null))
+staging_repos=($(find "${STAGING}" -mindepth 1 -type f -name "*${PKGEXT}" -printf '%h\n' | sort -u))
if [ $? -ge 1 ]; then
die "Could not read ${STAGING}"
fi
+repos=()
+for staging_repo in ${staging_repos[@]##*/}; do
+ if in_array ${staging_repo} ${PKGREPOS[@]}; then
+ repos+=(${staging_repo})
+ fi
+done
+
# TODO: this might lock too much (architectures)
for repo in ${repos[@]}; do
for pkgarch in ${ARCHES[@]}; do
@@ -30,13 +37,19 @@ for repo in ${repos[@]}; do
if [ $? -eq 0 ]; then
for pkg in ${pkgs[@]}; do
if [ -h "${pkg}" ]; then
- die "Package ${repo}/$(basename ${pkg}) is a symbolic link"
+ die "Package ${repo}/${pkg##*/} is a symbolic link"
fi
if ! check_pkgfile "${pkg}"; then
- die "Package ${repo}/$(basename ${pkg}) is not consistent with its meta data"
+ die "Package ${repo}/${pkg##*/} is not consistent with its meta data"
+ fi
+ if ${REQUIRE_SIGNATURE} && ! pacman-key -v "${pkg}.sig" >/dev/null 2>&1; then
+ die "Package ${repo}/${pkg##*/} does not have a valid signature"
+ fi
+ if ! check_pkgxbs "${pkg}" "${repo}"; then
+ die "Package ${repo}/${pkg##*/} is not consistent with xbs"
fi
if ! check_pkgrepos "${pkg}"; then
- die "Package ${repo}/$(basename ${pkg}) already exists in another repository"
+ die "Package ${repo}/${pkg##*/} already exists in another repository"
fi
done
# This is fucking obnoxious
@@ -55,7 +68,7 @@ for repo in ${repos[@]}; do
add_pkgs=()
arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-${pkgarch}${PKGEXT} 2>/dev/null))
for pkg in ${arch_pkgs[@]} ${any_pkgs[@]}; do
- pkgfile="$(basename ${pkg})"
+ pkgfile="${pkg##*/}"
msg2 "${pkgfile} (${pkgarch})"
# any packages might have been moved by the previous run
if [ -f "${pkg}" ]; then