diff options
-rw-r--r-- | config | 4 | ||||
-rw-r--r-- | db-functions | 10 | ||||
-rwxr-xr-x | db-update | 16 |
3 files changed, 24 insertions, 6 deletions
@@ -6,7 +6,7 @@ case "$USER" in *) _name=parabola;; esac -FTP_BASE="/srv/http/repo/public" +FTP_BASE="/srv/repo/main" PKGREPOS=() PKGPOOL='' SRCPOOL='' @@ -28,7 +28,7 @@ LOCK_TIMEOUT=300 [ -n "${STAGING:-}" ] || STAGING="$HOME/staging/unknown/staging" export TMPDIR="${TMPDIR:-/tmp}" -ARCHES=(i686 x86_64 mips64el) +ARCHES=(i686 x86_64) DBEXT=".db.tar.gz" FILESEXT=".files.tar.gz" PKGEXT=".pkg.tar.?z" diff --git a/db-functions b/db-functions index b0bdb28..62260bb 100644 --- a/db-functions +++ b/db-functions @@ -421,12 +421,13 @@ arch_repo_add() { local arch=$2 local pkgs=("${@:3}") + printf -v pkgs_str -- '%q ' "${pkgs[@]}" # package files might be relative to repo dir pushd "${FTP_BASE}/${repo}/os/${arch}" >/dev/null /usr/bin/repo-add -q "${repo}${DBEXT}" "${pkgs[@]}" \ - || error '%s' "repo-add ${repo}${DBEXT} ${pkgs[*]}" + || error 'repo-add %q %s' "${repo}${DBEXT}" "${pkgs_str% }" /usr/bin/repo-add -f -q "${repo}${FILESEXT}" "${pkgs[@]}" \ - || error '%s' "repo-add -f ${repo}${FILESEXT} ${pkgs[*]}" + || error 'repo-add -f %q %s' "${repo}${FILESEXT}" "${pkgs_str% }" popd >/dev/null set_repo_permission "${repo}" "${arch}" @@ -444,10 +445,11 @@ arch_repo_remove() { error "No database found at '%s'" "${dbfile}" return 1 fi + printf -v pkgs_str -- '%q ' "${pkgs[@]}" /usr/bin/repo-remove -q "${dbfile}" "${pkgs[@]}" \ - || error '%s' "repo-remove ${dbfile} ${pkgs[*]}" + || error 'repo-remove %q %s' "${dbfile}" "${pkgs_str% }" /usr/bin/repo-remove -q "${filesfile}" "${pkgs[@]}" \ - || error '%s' "repo-remove ${filesfile} ${pkgs[*]}" + || error 'repo-remove %q %s' "${filesfile}" "${pkgs_str% }" set_repo_permission "${repo}" "${arch}" REPO_MODIFIED=1 @@ -63,10 +63,12 @@ for repo in "${repos[@]}"; do fi done +dirs=() for repo in "${repos[@]}"; do msg "Updating [%s]..." "${repo}" any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXT} 2>/dev/null)) for pkgarch in "${ARCHES[@]}"; do + add_dirs=() add_pkgs=() arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-"${pkgarch}"${PKGEXT} 2>/dev/null)) for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do @@ -84,11 +86,17 @@ for repo in "${repos[@]}"; do if [ -f "$FTP_BASE/${PKGPOOL}/${pkgfile}.sig" ]; then ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" fi + add_dirs+=("${STAGING}/abslibre/$(getpkgarch "$FTP_BASE/$PKGPOOL/$pkgfile")/$repo/$(getpkgbase "$FTP_BASE/$PKGPOOL/$pkgfile")") add_pkgs+=("${pkgfile}") done + for add_dir in "${add_dirs[@]}"; do + (cd "${add_dir}" && xbs release-server "${repo}" "${pkgarch}") || + error 'cd %q && xbs release-server %q %q' "${add_dir}" "${repo}" "${pkgarch}" + done if [ ${#add_pkgs[@]} -ge 1 ]; then arch_repo_add "${repo}" "${pkgarch}" "${add_pkgs[@]}" fi + dirs+=("${add_dirs[@]}") done done @@ -99,6 +107,14 @@ for repo in "${repos[@]}"; do done cd "${STAGING}" + +# Remove left over XBS files +rm -rf -- "${dirs[@]}" +dirname -z -- "${dirs[@]}" | + xargs -0 realpath -zm --relative-to="${STAGING}" -- | + xargs -0 rmdir -p -- 2>/dev/null + +# Stage generated source files while read -r file; do pub="${FTP_BASE}/${file}" if [[ -f "$pub" ]]; then |