Skip to content

Commit 8ed2155

Browse files
authored
Merge pull request #8647 from tpowa/tpowa-patch-cksum-symlinks
Add hashsum symlinks with tests
1 parent 0e166f5 commit 8ed2155

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/CICD.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,53 @@ jobs:
341341
! test -f /tmp/usr/local/share/zsh/site-functions/_install
342342
! test -f /tmp/usr/local/share/bash-completion/completions/head
343343
! test -f /tmp/usr/local/share/fish/vendor_completions.d/cat.fish
344-
344+
- name: "`make install MULTICALL=n`"
345+
shell: bash
346+
run: |
347+
set -x
348+
DESTDIR=/tmp/ make PROFILE=release MULTICALL=n install
349+
# Check that the utils are present
350+
test -f /tmp/usr/local/bin/hashsum
351+
# Check that hashsum symlinks are present
352+
test -h /tmp/usr/local/bin/b2sum
353+
test -h /tmp/usr/local/bin/b3sum
354+
test -h /tmp/usr/local/bin/md5sum
355+
test -h /tmp/usr/local/bin/sha1sum
356+
test -h /tmp/usr/local/bin/sha224sum
357+
test -h /tmp/usr/local/bin/sha256sum
358+
test -h /tmp/usr/local/bin/sha3-224sum
359+
test -h /tmp/usr/local/bin/sha3-256sum
360+
test -h /tmp/usr/local/bin/sha3-384sum
361+
test -h /tmp/usr/local/bin/sha3-512sum
362+
test -h /tmp/usr/local/bin/sha384sum
363+
test -h /tmp/usr/local/bin/sha3sum
364+
test -h /tmp/usr/local/bin/sha512sum
365+
test -h /tmp/usr/local/bin/shake128sum
366+
test -h /tmp/usr/local/bin/shake256sum
367+
- name: "`make install MULTICALL=y`"
368+
shell: bash
369+
run: |
370+
set -x
371+
DESTDIR=/tmp/ make PROFILE=release MULTICALL=y install
372+
# Check that the utils are present
373+
test -f /tmp/usr/local/bin/coreutils
374+
# Check that hashsum symlinks are present
375+
test -h /tmp/usr/local/bin/b2sum
376+
test -h /tmp/usr/local/bin/b3sum
377+
test -h /tmp/usr/local/bin/md5sum
378+
test -h /tmp/usr/local/bin/sha1sum
379+
test -h /tmp/usr/local/bin/sha224sum
380+
test -h /tmp/usr/local/bin/sha256sum
381+
test -h /tmp/usr/local/bin/sha3-224sum
382+
test -h /tmp/usr/local/bin/sha3-256sum
383+
test -h /tmp/usr/local/bin/sha3-384sum
384+
test -h /tmp/usr/local/bin/sha3-512sum
385+
test -h /tmp/usr/local/bin/sha384sum
386+
test -h /tmp/usr/local/bin/sha3sum
387+
test -h /tmp/usr/local/bin/sha512sum
388+
test -h /tmp/usr/local/bin/shake128sum
389+
test -h /tmp/usr/local/bin/shake256sum
390+
345391
build_rust_stable:
346392
name: Build/stable
347393
needs: [ min_version, deps ]

GNUmakefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,23 @@ SELINUX_PROGS := \
191191
chcon \
192192
runcon
193193

194+
HASHSUM_PROGS := \
195+
b2sum \
196+
b3sum \
197+
md5sum \
198+
sha1sum \
199+
sha224sum \
200+
sha256sum \
201+
sha3-224sum \
202+
sha3-256sum \
203+
sha3-384sum \
204+
sha3-512sum \
205+
sha384sum \
206+
sha3sum \
207+
sha512sum \
208+
shake128sum \
209+
shake256sum
210+
194211
$(info Detected OS = $(OS))
195212

196213
# Don't build the SELinux programs on macOS (Darwin) and FreeBSD
@@ -464,11 +481,17 @@ ifeq (${MULTICALL}, y)
464481
$(foreach prog, $(filter-out coreutils, $(INSTALLEES)), \
465482
cd $(INSTALLDIR_BIN) && ln -fs $(PROG_PREFIX)coreutils $(PROG_PREFIX)$(prog) $(newline) \
466483
)
484+
$(foreach prog, $(HASHSUM_PROGS), \
485+
cd $(INSTALLDIR_BIN) && ln -fs $(PROG_PREFIX)coreutils $(PROG_PREFIX)$(prog) $(newline) \
486+
)
467487
$(if $(findstring test,$(INSTALLEES)), cd $(INSTALLDIR_BIN) && ln -fs $(PROG_PREFIX)coreutils $(PROG_PREFIX)[)
468488
else
469489
$(foreach prog, $(INSTALLEES), \
470490
$(INSTALL) -m 755 $(BUILDDIR)/$(prog) $(INSTALLDIR_BIN)/$(PROG_PREFIX)$(prog) $(newline) \
471491
)
492+
$(foreach prog, $(HASHSUM_PROGS), \
493+
cd $(INSTALLDIR_BIN) && ln -fs $(PROG_PREFIX)hashsum $(PROG_PREFIX)$(prog) $(newline) \
494+
)
472495
$(if $(findstring test,$(INSTALLEES)), $(INSTALL) -m 755 $(BUILDDIR)/test $(INSTALLDIR_BIN)/$(PROG_PREFIX)[)
473496
endif
474497

0 commit comments

Comments
 (0)