summaryrefslogtreecommitdiff
path: root/db-update
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-06-05 00:48:12 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-05 00:51:12 -0600
commitb96b9d95dd4d2214a428f1435a9a72ef50f43cf5 (patch)
treee8204ebe8ef806fe2affea7da12eff72dddc494d /db-update
parent003288a90c042c56d86258f60ac205b1d3053eab (diff)
db-update: Hook in to `xbs release-server` as it exists today.
Obviously, this is an exercise in noticing a leaky abstraction. - assumes that the PKGBUILD is staged to a real directory going in - assumes where that is - assumes how to clean that up I believe the correct solution will require modifying XBS. Following is what I believe the changes should be. - change release-server to take "REPO ARCH DIR1 [DIR2...]", instead of using the CWD. - but this still assumes that the caller knows where release-client put the PKGBUILD, so change it to take "REPO ARCH PKGBASE1 [PKGBASE2...]". - this means that release-server knows to check if a PKGBUILD exists at the specified arch, and fall back to 'any' if it doesn't. - an alternative would be passing in the .pkg.tar filenames, and either parsing the filename or using db-functions to figure out the arch. - ??? how to get rid of cleaning up assumptions.
Diffstat (limited to 'db-update')
-rwxr-xr-xdb-update16
1 files changed, 16 insertions, 0 deletions
diff --git a/db-update b/db-update
index 0c4f824..f22eb15 100755
--- a/db-update
+++ b/db-update
@@ -55,13 +55,16 @@ 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
+ add_dirs+=("${STAGING}/abslibre/$(getpkgarch "$pkg")/$(getpkgbase "$pkg")")
pkgfile="${pkg##*/}"
msg2 "%s (%s)" "${pkgfile}" "${pkgarch}"
# any packages might have been moved by the previous run
@@ -78,9 +81,14 @@ for repo in "${repos[@]}"; do
fi
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
@@ -91,6 +99,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