From 1dff5a4284daed3b65722e008456a21b19e3960f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 24 Sep 2018 17:08:44 -0400 Subject: db-import-pkg: Also stage symlinks to PKGPOOL --- db-import-pkg | 3 ++- db-update | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/db-import-pkg b/db-import-pkg index 8d5ebc0..0541842 100755 --- a/db-import-pkg +++ b/db-import-pkg @@ -280,12 +280,13 @@ main() { local pkgname filename pgpsig while read -r pkgname filename pgpsig; do local pool staged=false - for pool in "${INHERIT[@]}"; do + for pool in "$PKGPOOL" "${INHERIT[@]}"; do filepath=("${FTP_BASE}/${pool}/${filename}") if [[ -f $filepath && ! -h $filepath ]]; then ln -srT -- "$filepath" "${WORKDIR}/staging/${repo}/${filename}" ln -srT -- "$filepath".sig "${WORKDIR}/staging/${repo}/${filename}".sig staged=true + break fi done if ! $staged; then diff --git a/db-update b/db-update index e2b2741..c8dc3b6 100755 --- a/db-update +++ b/db-update @@ -51,16 +51,16 @@ for repo in "${repos[@]}"; do if (( $? == 0 )); then for pkg in "${pkgs[@]}"; do if [[ -h ${pkg} ]]; then - # As a special hack for inheriting packages between db-import - # upstreams, allow symlinks that point to arch=(any) packages in a - # different PKGPOOL. - if ! [[ - -f ${pkg} && - "$(readlink -f -- "$pkg")" = "${FTP_BASE}"/pool/*-any${PKGEXTS} && - "$(readlink -f -- "$pkg")" != "${FTP_BASE}/${PKGPOOL}"/* - ]]; then - die "Package %s is a symbolic link" "$repo/${pkg##*/}" + # As a special hack for + # 1. inheriting arch=(any) packages between db-import + # upstreams, and + # 2. re-adding previously removed binaries that have not been + # cleaned up yet, + # allow symlinks that point to packages under ${FTP_BASE}/pool/. + if [[ -f ${pkg} && "$(readlink -f -- "$pkg")" = "${FTP_BASE}"/pool/*${PKGEXTS} ]]; then + continue fi + die "Package %s is a symbolic link" "$repo/${pkg##*/}" fi if ! check_pkgfile "${pkg}"; then die "Package %s is not consistent with its meta data" "$repo/${pkg##*/}" -- cgit v1.2.2