summaryrefslogtreecommitdiff
path: root/src/xbs-abslibre/helper-abslibre
diff options
context:
space:
mode:
Diffstat (limited to 'src/xbs-abslibre/helper-abslibre')
-rwxr-xr-xsrc/xbs-abslibre/helper-abslibre34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/xbs-abslibre/helper-abslibre b/src/xbs-abslibre/helper-abslibre
index 2e5ed27..76e9cfa 100755
--- a/src/xbs-abslibre/helper-abslibre
+++ b/src/xbs-abslibre/helper-abslibre
@@ -29,7 +29,7 @@ download() {
gitget -f -p "$ABSLIBRESEND" checkout "$ABSLIBRERECV" "$WORKDIR/abslibre" || return 1
}
-release() {
+release-client() {
local repo=$1
local arch=$2
@@ -45,14 +45,42 @@ release() {
if [[ -e $pkgdir ]]; then
rm -rf -- "$pkgdir"
fi
+
+ mkdir -p -- "$pkgdir"
+ git ls-files -z | xargs -0 -I{} cp -- {} "$pkgdir"
+}
+
+release-server() {
+ local repo=$1
+ local repo=$2
+
+ . libremessages
+ . $(librelib conf)
+ load_files libretools
+ check_vars libretools WORKDIR ABSLIBREDEST || return 1
+ local pkgbase="$(load_PKGBUILD >/dev/null; printf '%s\n' "${pkgbase:-${pkgname}}")"
+ local pkgdir="${ABSLIBREDEST}/${arch}/${repo}/${pkgbase}"
+
+ lock 9 "${ABSLIBREDEST}/${arch}.lock" "Waiting for a lock on the ABSLibre release directory for ${arch}"
+
+ if [[ -e $pkgdir ]]; then
+ rm -rf -- "$pkgdir"
+ fi
+
mkdir -p -- "$pkgdir"
- git ls-files -z | xargs -0 -I{} cp {} "$pkgdir"
+ cp -- * "$pkgdir"
if [[ -e "${ABSLIBREDEST}/${arch}/.git" ]]; then
cd "$pkgdir"
git add .
git commit -q -m "xbs-abslibre: Release ${repo}/${pkgbase} for ${arch} (by $(id -un))"
fi
+
+ local olddir
+ for olddir in "${ABSLIBREDEST}"/*/"${repo}/${pkgbase}/PKGBUILD"; do
+ local oldarch=${olddir#"${ABSLIBREDEST}"}; oldarch="${oldarch%%/*}"
+ unrelease "$pkgbase" "$repo" "$oldarch"
+ done
}
unrelease() {
@@ -138,6 +166,6 @@ releasepath() {
}
case "$1" in
- status|download|release|unrelease|move|releasepath) "$@";;
+ status|download|release-client|release-server|unrelease|move|releasepath) "$@";;
*) exit 127;;
esac