Compare commits

..

14 Commits

Author SHA1 Message Date
Xavier Roche
5f96e86818 Merge pull request #355 from xroche/ci/bump-checkout-v5
ci: bump actions/checkout to v6
2026-06-14 23:15:01 +02:00
Xavier Roche
6002bc20ca ci: bump actions/checkout from v4 to v6
Keeps the checkout action on a supported major; v4 runs on the
end-of-life Node 20 runtime, v6 moves to Node 24.

Signed-off-by: Xavier Roche <roche@httrack.com>
2026-06-14 23:13:06 +02:00
Xavier Roche
bdbc741597 Merge pull request #354 from xroche/ci/mkdeb-single-test
mkdeb: drop the redundant pre-build test pass
2026-06-14 22:22:49 +02:00
Xavier Roche
d0a1b957cd ci: let the deb job run debuild's test pass
The deb job set DEB_BUILD_OPTIONS=nocheck to skip a redundant second test run.
With mkdeb.sh no longer running its own pre-build check, debuild's is the only
test pass, so nocheck would suppress it entirely and CI would never exercise the
packaged build's tests. Drop nocheck; keep noautodbgsym and parallel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
2026-06-14 22:15:51 +02:00
Xavier Roche
6c329744e7 mkdeb: drop the redundant pre-build test pass
mkdeb.sh built and tested the sources twice: once in its own export-tree
pre-build (make check, offline), then again under debuild, whose dh_auto_test
runs the suite with the online tests enabled (debian/rules configures with
--enable-online-unit-tests=auto). The first run was a slower, offline-only
subset of the second.

Drop mkdeb's own make check. The export-tree build stays, since regen-man needs
the compiled binaries, but the suite now runs once, under debuild, as the
superset. This is the same redundancy CI #352 removed via DEB_BUILD_OPTIONS=nocheck;
fixing it in mkdeb.sh applies it to release builds too instead of per-environment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
2026-06-14 22:13:23 +02:00
Xavier Roche
1375ef97d7 Merge pull request #353 from xroche/ci/macos-i386
ci: add macOS and 32-bit (i386) build jobs
2026-06-14 22:09:11 +02:00
Xavier Roche
13207a92fc Make the cache and manpage tests POSIX-shell portable
Running the suite on macOS surfaced two GNU/Linux assumptions. The test
harness there resolves $(BASH) to /bin/sh (POSIX mode), and macOS ships
BSD userland, so:

- 01_engine-cache used "du -sb"; the -b (apparent bytes) flag is GNU-only
  and BSD/macOS du rejects it, leaving an empty size and an "integer
  expression expected" error. Switch to portable "du -sk" (1024-byte
  units); block-allocated size is an upper bound, fine for a ceiling.

- 02_manpage-regen used diff with process substitution, which a POSIX
  /bin/sh does not parse. Stage the stripped inputs in temp files instead.

Both now pass under dash as well as bash, on Linux and macOS.

Signed-off-by: Xavier Roche <roche@httrack.com>
2026-06-14 22:05:31 +02:00
Xavier Roche
d3eecbf211 Gate the GNU-ld libc-force flag behind a linker check
-Wl,--push-state,--no-as-needed,-lc,--pop-state forces libc back into
DT_NEEDED for libraries that reach it only through libhttrack: the
libhtsjava JNI wrapper and the libtest callback examples. The flag is
GNU-ld-specific; Apple's ld rejects it ("ld: unknown options:
--push-state --no-as-needed --pop-state"), breaking the macOS build, and
doesn't need it (every dylib links libSystem anyway).

Probe it once with AX_CHECK_LINK_FLAG and emit it via LIBC_FORCE_LINK
only where the linker accepts it. On GNU/Linux the flag is still applied
and libc.so.6 stays in DT_NEEDED, so behavior is unchanged there.

Signed-off-by: Xavier Roche <roche@httrack.com>
2026-06-14 21:57:56 +02:00
Xavier Roche
7ec77156d0 ci: add macOS and 32-bit (i386) build jobs
Two cheap portability targets that need no VM or second CI provider:

- macOS (Darwin/clang) on a native macos-14 runner. The tree has no
  __APPLE__ branches, so Darwin runs the generic-Unix path against a
  second libc and kernel. brew's openssl@3 is keg-only, so configure is
  pointed at it via CPPFLAGS/LDFLAGS.

- 32-bit i386 via multilib on the existing x86-64 runner. Exercises the
  32-bit size_t/pointer ABI, where size and bounds math can truncate or
  wrap in ways 64-bit never shows. --build (not --host) keeps configure
  out of cross mode so the i386 binary still runs the test suite.

Signed-off-by: Xavier Roche <roche@httrack.com>
2026-06-14 21:38:49 +02:00
Xavier Roche
3cd8197cc7 Merge pull request #352 from xroche/ci/deb-faster
ci: speed up the deb package job
2026-06-14 21:33:53 +02:00
Xavier Roche
37f50bb925 ci: speed up the deb package job
The deb job spent ~3m19s in the build step, half of it on work CI does not
need. The package build (via mkdeb.sh) ran the full test suite a second time
with online/network unit tests enabled (~54s), and compressed the large LTO
-dbgsym packages that CI throws away (~48s).

Set DEB_BUILD_OPTIONS=nocheck,noautodbgsym,parallel=N on the CI step only.
nocheck skips debuild's make check, which is redundant here: the build matrix
already runs the suite on every config and mkdeb.sh's own pre-build runs the
offline tests. noautodbgsym drops the -dbgsym packages. parallel uses every
runner core. mkdeb.sh is unchanged, so release builds still build with LTO,
full tests, and debug symbols; only the CI environment differs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
2026-06-14 21:31:03 +02:00
Xavier Roche
d8d1eafcd1 Merge pull request #351 from xroche/feature/appstream-metainfo
Ship AppStream MetaInfo for WebHTTrack
2026-06-14 21:30:28 +02:00
Xavier Roche
80d0e90819 Merge pull request #350 from xroche/fix/webhttrack-browser-deps
debian: refresh stale webhttrack browser dependency
2026-06-14 21:26:31 +02:00
Xavier Roche
a16820a282 debian: refresh stale webhttrack browser dependency
The webhttrack Depends listed iceape-browser, iceweasel, icecat, mozilla,
firefox and mozilla-firefox as browser alternatives. All six have been
removed from Debian (iceweasel was only ever a firefox-esr stub, firefox is
not in Debian main), so qa.debian.org/debcheck flagged them as half-broken
relationships. The OR-chain still resolved via the trailing www-browser
virtual package, so it was noise rather than a real installability failure.

Replace them with firefox-esr | chromium | www-browser: two real browsers
that exist in Debian today plus the virtual fallback. google-chrome is left
out deliberately since it is not in the Debian archive and would reintroduce
the same half-broken relationship.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
2026-06-14 21:21:25 +02:00
19 changed files with 194 additions and 25 deletions

View File

@@ -31,7 +31,7 @@ jobs:
env:
CC: ${{ matrix.cc }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: recursive
@@ -61,6 +61,78 @@ jobs:
if: failure()
run: cat tests/test-suite.log 2>/dev/null || true
# Portability: build and test on macOS (Darwin/clang) on a native runner --
# no VM. The tree has no __APPLE__ branches, so Darwin exercises the
# generic-Unix path on a second libc and kernel. brew's openssl@3 is keg-only,
# so point configure at it; everything else is in the SDK or default paths.
macos:
name: build (macOS arm64, clang)
runs-on: macos-14
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Install build dependencies
run: |
set -euo pipefail
brew install autoconf automake libtool autoconf-archive
- name: Configure
run: |
set -euo pipefail
ssl="$(brew --prefix openssl@3)"
autoreconf -fi
./configure CPPFLAGS="-I${ssl}/include" LDFLAGS="-L${ssl}/lib"
- name: Build
run: make -j"$(sysctl -n hw.ncpu)"
- name: Test
run: make check
- name: Print the test log on failure
if: failure()
run: cat tests/test-suite.log 2>/dev/null || true
# Portability/hardening: 32-bit (i386) build on the x86-64 runner via multilib
# -- no extra hardware. Exercises the 32-bit size_t/pointer ABI, where size
# and bounds math can truncate or wrap in ways 64-bit never reveals (the axis
# the overflow-safe bounds work targets). --build (not --host) keeps configure
# out of cross mode, so the i386 binary still runs the test suite here.
linux-i386:
name: build (linux i386, gcc -m32)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Install build dependencies (multilib + 32-bit libs)
run: |
set -euo pipefail
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential gcc-multilib autoconf automake libtool \
autoconf-archive zlib1g-dev:i386 libssl-dev:i386
- name: Configure
run: |
set -euo pipefail
autoreconf -fi
./configure --build=i686-pc-linux-gnu CC="gcc -m32"
- name: Build
run: make -j"$(nproc)"
- name: Test
run: make check
- name: Print the test log on failure
if: failure()
run: cat tests/test-suite.log 2>/dev/null || true
# Validate the Debian packaging via the same script maintainers release with.
# One amd64/gcc run is enough: packaging (control/rules/manifest/lintian/quilt
# source build) is arch- and compiler-independent, and the build matrix above
@@ -69,7 +141,7 @@ jobs:
name: deb package (lintian)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: recursive
@@ -84,8 +156,16 @@ jobs:
# --unsigned: CI has no GPG key (also skips the release sig/checksums).
# debuild builds every package, then lintian gates on errors.
#
# DEB_BUILD_OPTIONS trims work CI does not need (release builds via
# mkdeb.sh are untouched): noautodbgsym drops the -dbgsym packages whose
# LTO payloads are slow to compress and that CI never ships; parallel uses
# every core. We let debuild run its test pass -- the only one now that
# mkdeb no longer runs its own -- so CI exercises the packaged tests.
- name: Build Debian packages
run: bash tools/mkdeb.sh --unsigned --no-release-artifacts
run: |
export DEB_BUILD_OPTIONS="noautodbgsym parallel=$(nproc)"
bash tools/mkdeb.sh --unsigned --no-release-artifacts
dco:
name: DCO sign-off
@@ -93,7 +173,7 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
@@ -122,7 +202,7 @@ jobs:
name: lint (shellcheck, shfmt)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Install linters
env:
@@ -151,7 +231,7 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0

View File

@@ -257,6 +257,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@

48
configure vendored
View File

@@ -695,6 +695,7 @@ HAVE_VISIBILITY
CFLAG_VISIBILITY
LDFLAGS_PIE
CFLAGS_PIE
LIBC_FORCE_LINK
DEFAULT_LDFLAGS
DEFAULT_CFLAGS
VERSION_INFO
@@ -15871,6 +15872,53 @@ esac
fi
# Force libc back into DT_NEEDED for libraries that reach it only through
# libhttrack (libhtsjava, the libtest callbacks), but only with a GNU-style
# linker; Apple ld rejects these flags and links libSystem unconditionally.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--push-state,--no-as-needed,-lc,--pop-state" >&5
printf %s "checking whether the linker accepts -Wl,--push-state,--no-as-needed,-lc,--pop-state... " >&6; }
if test ${ax_cv_check_ldflags___Wl___push_state___no_as_needed__lc___pop_state+y}
then :
printf %s "(cached) " >&6
else case e in #(
e)
ax_check_save_flags=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--push-state,--no-as-needed,-lc,--pop-state"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ax_cv_check_ldflags___Wl___push_state___no_as_needed__lc___pop_state=yes
else case e in #(
e) ax_cv_check_ldflags___Wl___push_state___no_as_needed__lc___pop_state=no ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$ax_check_save_flags ;;
esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___push_state___no_as_needed__lc___pop_state" >&5
printf "%s\n" "$ax_cv_check_ldflags___Wl___push_state___no_as_needed__lc___pop_state" >&6; }
if test "x$ax_cv_check_ldflags___Wl___push_state___no_as_needed__lc___pop_state" = xyes
then :
LIBC_FORCE_LINK="-Wl,--push-state,--no-as-needed,-lc,--pop-state"
else case e in #(
e) : ;;
esac
fi
### PIE
CFLAGS_PIE=""
LDFLAGS_PIE=""

View File

@@ -91,6 +91,13 @@ AX_CHECK_LINK_FLAG([-Wl,--no-undefined], [DEFAULT_LDFLAGS="$DEFAULT_LDFLAGS -Wl,
AX_CHECK_LINK_FLAG([-Wl,-z,relro,-z,now], [DEFAULT_LDFLAGS="$DEFAULT_LDFLAGS -Wl,-z,relro,-z,now"])
AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [DEFAULT_LDFLAGS="$DEFAULT_LDFLAGS -Wl,-z,noexecstack"])
# Force libc back into DT_NEEDED for libraries that reach it only through
# libhttrack (libhtsjava, the libtest callbacks), but only with a GNU-style
# linker; Apple ld rejects these flags and links libSystem unconditionally.
AX_CHECK_LINK_FLAG([-Wl,--push-state,--no-as-needed,-lc,--pop-state],
[LIBC_FORCE_LINK="-Wl,--push-state,--no-as-needed,-lc,--pop-state"])
AC_SUBST([LIBC_FORCE_LINK])
### PIE
CFLAGS_PIE=""
LDFLAGS_PIE=""

5
debian/changelog vendored
View File

@@ -8,6 +8,11 @@ httrack (3.49.8-1) unstable; urgency=medium
common-licenses/GPL-3, use a secure version=4 watch file, add
Rules-Requires-Root and Vcs-Browser, and override the false-positive
source-is-missing on the bundled HTML documentation.
* Refresh the webhttrack browser dependency: drop the removed alternatives
(iceape-browser, iceweasel, icecat, mozilla, firefox, mozilla-firefox)
that no longer exist in Debian and triggered half-broken relationships on
the QA debcheck page. Depend on firefox-esr | chromium | www-browser
instead.
-- Xavier Roche <xavier@debian.org> Sun, 07 Jun 2026 14:29:24 +0200

2
debian/control vendored
View File

@@ -30,7 +30,7 @@ Description: Copy websites to your computer (Offline browser)
Package: webhttrack
Architecture: any
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends}, webhttrack-common, sensible-utils, iceape-browser | iceweasel | icecat | mozilla | firefox | mozilla-firefox | www-browser
Depends: ${misc:Depends}, ${shlibs:Depends}, webhttrack-common, sensible-utils, firefox-esr | chromium | www-browser
Replaces: webhttrack-common (<< 3.43.9-2)
Breaks: webhttrack-common (<< 3.43.9-2)
Suggests: httrack, httrack-doc

View File

@@ -213,6 +213,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@

View File

@@ -202,6 +202,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@

View File

@@ -20,11 +20,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/src
# The callback examples reference libc only through libhttrack, so the direct
# libc edge gets dropped from DT_NEEDED (library-not-linked-against-libc).
# Force libc to be recorded as a dependency.
# Force libc back; configure gates the flag since only a GNU-style linker
# accepts it (LIBC_FORCE_LINK is empty on e.g. macOS).
AM_LDFLAGS = \
@DEFAULT_LDFLAGS@ \
-L../src \
-Wl,--push-state,--no-as-needed,-lc,--pop-state
@LIBC_FORCE_LINK@
# Examples
libbaselinks_la_SOURCES = callbacks-example-baselinks.c

View File

@@ -344,6 +344,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
@@ -453,11 +454,12 @@ AM_CPPFLAGS = @DEFAULT_CFLAGS@ @THREADS_CFLAGS@ @V6_FLAG@ @LFS_FLAG@ \
# The callback examples reference libc only through libhttrack, so the direct
# libc edge gets dropped from DT_NEEDED (library-not-linked-against-libc).
# Force libc to be recorded as a dependency.
# Force libc back; configure gates the flag since only a GNU-style linker
# accepts it (LIBC_FORCE_LINK is empty on e.g. macOS).
AM_LDFLAGS = \
@DEFAULT_LDFLAGS@ \
-L../src \
-Wl,--push-state,--no-as-needed,-lc,--pop-state
@LIBC_FORCE_LINK@
# Examples

View File

@@ -173,6 +173,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@

View File

@@ -203,6 +203,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@

View File

@@ -86,8 +86,9 @@ libhtsjava_la_SOURCES = htsjava.c htsjava.h
libhtsjava_la_LIBADD = $(THREADS_LIBS) $(DL_LIBS) libhttrack.la
# This thin JNI wrapper reaches libc only through libhttrack, so the direct
# libc edge is dropped from DT_NEEDED (library-not-linked-against-libc). Force
# libc to be recorded as a dependency.
libhtsjava_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSION_INFO) -Wl,--push-state,--no-as-needed,-lc,--pop-state
# libc back as a dependency; configure gates the flag since only a GNU-style
# linker accepts it (LIBC_FORCE_LINK is empty on e.g. macOS).
libhtsjava_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSION_INFO) $(LIBC_FORCE_LINK)
EXTRA_DIST = httrack.h webhttrack \
coucal/murmurhash3.h.diff \

View File

@@ -361,6 +361,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
@@ -537,8 +538,9 @@ libhtsjava_la_SOURCES = htsjava.c htsjava.h
libhtsjava_la_LIBADD = $(THREADS_LIBS) $(DL_LIBS) libhttrack.la
# This thin JNI wrapper reaches libc only through libhttrack, so the direct
# libc edge is dropped from DT_NEEDED (library-not-linked-against-libc). Force
# libc to be recorded as a dependency.
libhtsjava_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSION_INFO) -Wl,--push-state,--no-as-needed,-lc,--pop-state
# libc back as a dependency; configure gates the flag since only a GNU-style
# linker accepts it (LIBC_FORCE_LINK is empty on e.g. macOS).
libhtsjava_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSION_INFO) $(LIBC_FORCE_LINK)
EXTRA_DIST = httrack.h webhttrack \
coucal/murmurhash3.h.diff \
coucal/murmurhash3.h.orig \

View File

@@ -202,6 +202,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@

View File

@@ -1,5 +1,8 @@
#!/bin/bash
#
# Keep this POSIX-portable: the harness runs it via $(BASH), which is a plain
# POSIX /bin/sh on some platforms (e.g. macOS), so avoid bashisms and GNU-only
# tool flags despite the #!/bin/bash above.
# Cache create/read/update logic (driven by 'httrack -#A <dir>').
#
@@ -38,9 +41,12 @@ test -e "$dir/hts-cache/new.zip" || {
# Sanity-check the cache footprint: the few-thousand-entry pass is expected to
# weigh ~1-2 MB. Fail if it balloons well past that (e.g. a per-entry overhead
# regression or runaway growth), so the cache size stays bounded.
ceiling=$((4 * 1024 * 1024))
bytes=$(du -sb "$dir/hts-cache" | cut -f1)
test "$bytes" -le "$ceiling" || {
echo "cache footprint $bytes bytes exceeds ${ceiling} ceiling" >&2
# du -sk (1024-byte units) is portable; GNU's -b (apparent bytes) is rejected
# by BSD/macOS du. Block-allocated size is an upper bound on apparent size,
# which is all a ceiling check needs.
ceiling=$((4 * 1024)) # KiB
kbytes=$(du -sk "$dir/hts-cache" | cut -f1)
test "$kbytes" -le "$ceiling" || {
echo "cache footprint ${kbytes} KiB exceeds ${ceiling} KiB ceiling" >&2
exit 1
}

View File

@@ -3,6 +3,10 @@
# The committed man/httrack.1 must match what man/makeman.sh produces from the
# current "httrack --help" output. This catches a --help change that was not
# followed by "make -C man regen-man".
#
# Keep this POSIX-portable: the harness runs it via $(BASH), which is a plain
# POSIX /bin/sh on some platforms (e.g. macOS), so avoid bashisms (such as
# process substitution) despite the #!/bin/bash above.
: "${top_srcdir:=..}"
@@ -20,7 +24,9 @@ command -v httrack >/dev/null 2>&1 || {
}
tmp=$(mktemp) || exit 1
trap 'rm -f "$tmp"' EXIT
committed_clean=$(mktemp) || exit 1
generated_clean=$(mktemp) || exit 1
trap 'rm -f "$tmp" "$committed_clean" "$generated_clean"' EXIT
README="$top_srcdir/README" bash "$gen" httrack >"$tmp" 2>/dev/null || {
echo "makeman.sh failed" >&2
@@ -28,12 +34,15 @@ README="$top_srcdir/README" bash "$gen" httrack >"$tmp" 2>/dev/null || {
}
# Ignore the two intentionally date-dependent lines (page date, copyright year).
# Temp files, not process substitution, so this works under a POSIX /bin/sh.
strip_volatile() { grep -vE '^\.TH httrack |^Copyright \(C\) 1998-'; }
strip_volatile <"$committed" >"$committed_clean"
strip_volatile <"$tmp" >"$generated_clean"
if diff <(strip_volatile <"$committed") <(strip_volatile <"$tmp") >/dev/null; then
if diff "$committed_clean" "$generated_clean" >/dev/null; then
exit 0
fi
echo "man/httrack.1 is out of date. Regenerate with: make -C man regen-man" >&2
diff <(strip_volatile <"$committed") <(strip_volatile <"$tmp") | head -40 >&2
diff "$committed_clean" "$generated_clean" | head -40 >&2
exit 1

View File

@@ -380,6 +380,7 @@ LD = @LD@
LDFLAGS = @LDFLAGS@
LDFLAGS_PIE = @LDFLAGS_PIE@
LFS_FLAG = @LFS_FLAG@
LIBC_FORCE_LINK = @LIBC_FORCE_LINK@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@

View File

@@ -118,7 +118,10 @@ main() {
git -C "$repo/src/coucal" archive --format=tar --prefix=src/coucal/ HEAD |
tar -x -C "$export_dir"
# Refresh build system and man page, then build and validate the tarball.
# Refresh build system and man page, then build the tarball. We build here
# only because regen-man needs the compiled binaries; the test suite is not
# run in this pass. debuild (below) runs the full suite once, with the online
# tests enabled, so a check here would just be a slower, offline-only repeat.
info "regenerating build system and man page"
(
cd "$export_dir"
@@ -126,8 +129,6 @@ main() {
./configure --quiet
make -s -j"$(nproc)"
make -s -C man regen-man
info "running test suite"
make -s check
# Build the tarball from a clean tree so no object files leak into it.
make -s clean
make -s dist