summaryrefslogtreecommitdiff
path: root/src/xbs-abs
diff options
context:
space:
mode:
Diffstat (limited to 'src/xbs-abs')
-rw-r--r--src/xbs-abs/.gitignore1
-rw-r--r--src/xbs-abs/Makefile21
-rwxr-xr-xsrc/xbs-abs/helper-abs15
3 files changed, 29 insertions, 8 deletions
diff --git a/src/xbs-abs/.gitignore b/src/xbs-abs/.gitignore
index 8421720..d472431 100644
--- a/src/xbs-abs/.gitignore
+++ b/src/xbs-abs/.gitignore
@@ -1,2 +1,3 @@
+commitpkg*
archrelease*
!*.patch
diff --git a/src/xbs-abs/Makefile b/src/xbs-abs/Makefile
index cac9aea..8688ed7 100644
--- a/src/xbs-abs/Makefile
+++ b/src/xbs-abs/Makefile
@@ -1,10 +1,23 @@
pkgconfdir = $(sysconfdir)/xbs
pkglibexecdir = $(libexecdir)/xbs
libexecs = helper-abs
-no-progs = $(libexecs) archrelease
-copy_files = archrelease.in
-install_files = $(DESTDIR)$(pkglibexecdir)/helper-abs.d/archrelease
+
+_helpers = archrelease commitpkg
+no-progs = $(libexecs) $(_helpers)
+copy_files = $(addsuffix .in,$(_helpers))
+install_files = $(addprefix $(DESTDIR)$(pkglibexecdir)/helper-abs.d/,$(_helpers))
+pots = $(_helpers)
+
include ../../common.mk
-$(DESTDIR)$(pkglibexecdir)/helper-abs.d/archrelease: archrelease
+commitpkg: commitpkg.in
+ { \
+ echo '#!/usr/bin/env bash'; \
+ echo '. "$$(librelib common)"'; \
+ echo '. ./PKGBUILD'; \
+ echo 'repo=$$1; arch=$$2;'; \
+ sed -n "/== 'any'/,\$$p" $<; \
+ } > $@
+
+$(DESTDIR)$(pkglibexecdir)/helper-abs.d/%: %
install -Dm755 '$<' '$@'
diff --git a/src/xbs-abs/helper-abs b/src/xbs-abs/helper-abs
index 88f572a..6c57803 100755
--- a/src/xbs-abs/helper-abs
+++ b/src/xbs-abs/helper-abs
@@ -93,13 +93,13 @@ download() {
done
}
-release() {
+release-client() {
local repo=$1
local arch=$2
+ # Hack to use arch_svn as 'svn' in external scripts
local tmpdir="$(mktemp -dt "xbs-abs-release.XXXXXXXXXX")"
trap "$(printf 'rm -rf -- %q' "$tmpdir")" EXIT
-
printf '%s\n' \
'#!/bin/bash' \
"$(declare -p SVNUSER 2>/dev/null)" \
@@ -107,8 +107,15 @@ release() {
'arch_svn "$@"' \
> "$tmpdir/svn"
chmod 755 "$tmpdir/svn"
+ export PATH="$tmpdir:$PATH"
+
+ "${0}.d/archrelease" -f "${repo}-${arch}"
+ "${0}.d/commitpkg" "${repo}" "${arch}"
+}
- PATH="$tmpdir:$PATH" "${0}.d/archrelease" -f "${repo}-${arch}"
+release-server() {
+ # Do nothing
+ :
}
unrelease() {
@@ -185,6 +192,6 @@ releasepath() {
}
case "$1" in
- status|download|release|unrelease|move|releasepath) "$@";;
+ status|download|release-client|release-server|unrelease|move|releasepath) "$@";;
*) exit 127;;
esac