summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@parabola.nu>2024-02-21 19:28:16 -0700
committerLuke T. Shumaker <lukeshu@parabola.nu>2024-02-21 19:28:16 -0700
commit2447fd5502b6ed5c5bd9e036cc72a514e6431d6b (patch)
tree1ec65e233f33b2e894e88d2d361c463a32c6ebcc
parent3604bbd006d42233ac52113dfff7ac78dba9469d (diff)
parent2242ff2968afbf42ffcbe1aec228a92d6db25e1c (diff)
Merge branch 'lukeshu/more-fixes'v20240221.1
-rw-r--r--INSTALL13
-rw-r--r--build-aux/Makefile.each.head/20-libretools.mk2
-rw-r--r--build-aux/Makefile.each.tail/20-libretools.mk17
-rw-r--r--config.mk2
-rwxr-xr-xsrc/abslibre-tools/librerelease2
-rwxr-xr-xsrc/librefetch/librefetch1
-rw-r--r--src/librefetch/librefetch.8.ronn1
-rw-r--r--test/cases/librerelease.bats59
-rw-r--r--test/fixtures/librefetch/PKGBUILD-mksource1
-rw-r--r--test/fixtures/librefetch/testpkg.install5
10 files changed, 87 insertions, 16 deletions
diff --git a/INSTALL b/INSTALL
index a74a376..024dda6 100644
--- a/INSTALL
+++ b/INSTALL
@@ -28,8 +28,9 @@ The "unusual" build-time dependencies are:
purpose.
- ronn -- A markdown-to-manpage converter
-At this time, the build system does not support not building the
-documentation; ronn is required.
+Whether or not to build the manpages is controlled by whether
+config.mk:enable_manpages is empty (disable) or non-empty (enable).
+If it is disabled, then `ronn` is not needed.
Additionally, other usual "core utilities" are required:
@@ -45,10 +46,10 @@ be a bigger issue.
## Test suite dependencies
-If you wish to run the test suite, you will need the "roundup" shell
-unit testing program. On Parabola GNU/Linux-libre it is called
-"sh-roundup". If your operating system doesn't have it, it is
-available at <http://bmizerany.github.io/roundup/>.
+If you wish to run the test suite, you will need the "BATS" shell unit
+testing program. On Parabola GNU/Linux-libre it is called "bats". If
+your operating system doesn't have it, it is available at
+<https://github.com/bats-core/bats-core>.
## Run-time dependencies
diff --git a/build-aux/Makefile.each.head/20-libretools.mk b/build-aux/Makefile.each.head/20-libretools.mk
index 22f59ba..7a5e754 100644
--- a/build-aux/Makefile.each.head/20-libretools.mk
+++ b/build-aux/Makefile.each.head/20-libretools.mk
@@ -30,7 +30,7 @@ libretools.out.libs = $(libretools.src.sh)
libretools.out.docs = $(libretools.src.md)
libretools.out.confs = $(libretools.src.conf)
-libretools.out = $(libretools.out.mans)
+libretools.out = $(if $(enable_manpages),$(libretools.out.mans))
libretools.out += $(libretools.out.bins)
libretools.out += $(libretools.out.libexecs)
libretools.out += $(libretools.out.libs)
diff --git a/build-aux/Makefile.each.tail/20-libretools.mk b/build-aux/Makefile.each.tail/20-libretools.mk
index 3e54614..5000114 100644
--- a/build-aux/Makefile.each.tail/20-libretools.mk
+++ b/build-aux/Makefile.each.tail/20-libretools.mk
@@ -30,14 +30,15 @@ files.sys.$(libretools.pkg) += \
$(addprefix $(pkglibdir)/,$(libretools.out.libs)) \
$(addprefix $(pkglibexecdir)/,$(libretools.out.libexecs)) \
$(addprefix $(docdir)/,$(libretools.out.docs)) \
- $(addprefix $(mandir)/man1/,$(filter %.1,$(libretools.out.mans))) \
- $(addprefix $(mandir)/man2/,$(filter %.2,$(libretools.out.mans))) \
- $(addprefix $(mandir)/man3/,$(filter %.3,$(libretools.out.mans))) \
- $(addprefix $(mandir)/man4/,$(filter %.4,$(libretools.out.mans))) \
- $(addprefix $(mandir)/man5/,$(filter %.5,$(libretools.out.mans))) \
- $(addprefix $(mandir)/man6/,$(filter %.6,$(libretools.out.mans))) \
- $(addprefix $(mandir)/man7/,$(filter %.7,$(libretools.out.mans))) \
- $(addprefix $(mandir)/man8/,$(filter %.8,$(libretools.out.mans)))
+ $(if $(enable_manpages), \
+ $(addprefix $(mandir)/man1/,$(filter %.1,$(libretools.out.mans))) \
+ $(addprefix $(mandir)/man2/,$(filter %.2,$(libretools.out.mans))) \
+ $(addprefix $(mandir)/man3/,$(filter %.3,$(libretools.out.mans))) \
+ $(addprefix $(mandir)/man4/,$(filter %.4,$(libretools.out.mans))) \
+ $(addprefix $(mandir)/man5/,$(filter %.5,$(libretools.out.mans))) \
+ $(addprefix $(mandir)/man6/,$(filter %.6,$(libretools.out.mans))) \
+ $(addprefix $(mandir)/man7/,$(filter %.7,$(libretools.out.mans))) \
+ $(addprefix $(mandir)/man8/,$(filter %.8,$(libretools.out.mans))))
files.out.int += *.pot *.ugly *.rej *.orig
files.out.all += $(foreach pkg,$(filter-out all,$(files.groups)),$(files.out.$(pkg)))
diff --git a/config.mk b/config.mk
index 882e2e9..fbd0ec5 100644
--- a/config.mk
+++ b/config.mk
@@ -29,6 +29,8 @@ sysconfdir = /etc
mandir = $(datarootdir)/man
devtoolsdir = $(call abspath,$(topsrcdir)/../devtools-par)
+
+enable_manpages = t
RONNFLAGS = --manual='libretools Manual' --organization='Parabola'
TESTENVFLAGS ?=
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease
index a887ce4..b441a4c 100755
--- a/src/abslibre-tools/librerelease
+++ b/src/abslibre-tools/librerelease
@@ -301,7 +301,7 @@ release_packages() {
local packages=${file_list} # TODO: parse package names? - this is gonna be messy
local login=${REPODEST_userinfo:-somebody} ; login=${login%%:*} ;
ssh ${REPODEST_port:+-p "$REPODEST_port"} "${REPODEST_userhost}" \
- "if type pbot-say &>/dev/null-say; then pbot-say ${login} just published: ${packages}; fi"
+ "if type pbot-say &>/dev/null; then pbot-say ${login} just published: ${packages}; fi"
return $EXIT_SUCCESS
}
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch
index 9b04837..0a1bb70 100755
--- a/src/librefetch/librefetch
+++ b/src/librefetch/librefetch
@@ -347,6 +347,7 @@ checkdepends=() ; unset "checkdepends_${CARCH}"
makedepends=("${mkdepends[@]}") ; unset "makedepends_${CARCH}"
backup=()
+unset install
####
# See packaging_options in the makepkg source
diff --git a/src/librefetch/librefetch.8.ronn b/src/librefetch/librefetch.8.ronn
index 63dfae9..b73db3b 100644
--- a/src/librefetch/librefetch.8.ronn
+++ b/src/librefetch/librefetch.8.ronn
@@ -143,6 +143,7 @@ Following is a table of the translations.
makedepends = mkdepends
*_$CARCH = <unset>
backup = <empty>
+ install = <unset>
Functions
prepare() { :; }
build() { mksource; }
diff --git a/test/cases/librerelease.bats b/test/cases/librerelease.bats
index 3b83651..a984d73 100644
--- a/test/cases/librerelease.bats
+++ b/test/cases/librerelease.bats
@@ -165,3 +165,62 @@ teardown() {
diff -u "$tmpdir/pwd.txt" "$tmpdir/prerelease.txt"
diff -u "$tmpdir/pwd.txt" "$tmpdir/postrelease.txt"
}
+
+@test "librerelease notifies pbot" {
+ # Add a stub db-update pbot-say so that when we ssh to localhost it has
+ # something to run.
+ install -Dm755 /dev/stdin "$tmpdir/bin/db-update" <<-eot
+ #!/bin/bash
+ {
+ printf '%s\n' "\$DBSCRIPTS_CONFIG"
+ readlink -f -- "\$STAGING"
+ find "\$STAGING" -printf '%P\n' | LC_COLLATE=C sort
+ } > ${tmpdir@Q}/log.txt
+ eot
+ install -Dm755 /dev/stdin "$tmpdir/bin/pbot-say" <<-eot
+ #!/bin/bash
+ echo "\$*" >${tmpdir@Q}/pbot.txt
+ eot
+ PATH=$tmpdir/bin:$PATH
+
+ # Log which directories the hooks are run in.
+ cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
+ HOOKPRERELEASE='pwd > ${tmpdir@Q}/prerelease.txt'
+ HOOKPOSTRELEASE='pwd > ${tmpdir@Q}/postrelease.txt'
+ eot
+
+ # Make some files to stage
+ local workdir="$tmpdir/workdir"
+ mkdir -p "$workdir/staging/repo1" "$workdir/staging/repo2/sub"
+ touch \
+ "$workdir/staging/repo1/file1" \
+ "$workdir/staging/repo1/file2" \
+ "$workdir/staging/repo2/file with spaces" \
+ "$workdir/staging/repo2/sub/subfolder"
+
+ # Run
+ librerelease
+
+ # Make sure everything went OK
+ pwd > "$tmpdir/pwd.txt"
+ cat > "$tmpdir/log-correct.txt" <<-eot
+ /etc/dbscripts/config.local.phony
+ $(readlink -f -- "$tmpdir/srv-staging")
+
+ repo1
+ repo1/file1
+ repo1/file1.sig
+ repo1/file2
+ repo1/file2.sig
+ repo2
+ repo2/file with spaces
+ repo2/file with spaces.sig
+ repo2/sub
+ repo2/sub/subfolder
+ repo2/sub/subfolder.sig
+ eot
+ diff -u "$tmpdir/log-correct.txt" "$tmpdir/log.txt"
+ diff -u "$tmpdir/pwd.txt" "$tmpdir/prerelease.txt"
+ diff -u "$tmpdir/pwd.txt" "$tmpdir/postrelease.txt"
+ grep 'just published' "$tmpdir/pbot.txt"
+}
diff --git a/test/fixtures/librefetch/PKGBUILD-mksource b/test/fixtures/librefetch/PKGBUILD-mksource
index 74489de..67f6bc3 100644
--- a/test/fixtures/librefetch/PKGBUILD-mksource
+++ b/test/fixtures/librefetch/PKGBUILD-mksource
@@ -5,6 +5,7 @@ pkgdesc=foo
arch=(any)
source=("libre://$pkgname-$pkgver.tar.gz"{,.sig})
backup=(etc/testpkg.conf)
+install=testpkg.install
mksource() {
mkdir "$srcdir/bar"
diff --git a/test/fixtures/librefetch/testpkg.install b/test/fixtures/librefetch/testpkg.install
new file mode 100644
index 0000000..8ff0e47
--- /dev/null
+++ b/test/fixtures/librefetch/testpkg.install
@@ -0,0 +1,5 @@
+#!/hint/bash
+
+post_instal() {
+ true
+}