summaryrefslogtreecommitdiff
path: root/src/xbs-abslibre
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-07-05 02:10:21 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-07-05 18:08:41 -0400
commitac6c975cde77b1fa8f3a8df2f9c966b3dc5fc90c (patch)
tree56f8a52bd5ac62f2240c46305f8baa425db30073 /src/xbs-abslibre
parent8435815a7690830dece329ac9a71b1da04f4ba38 (diff)
xbs: create separate release-client and release-server sub-commands
Diffstat (limited to 'src/xbs-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