star-build

Automation tool for project installation
git clone git://git.meso-star.fr/star-build.git
Log | Files | Refs | README | LICENSE

commit 70c9d2f46a965335a19931dbbc9fa9debf04e3fa
parent 6140902fce2fe9d206128a1c692ade81e840627e
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue,  7 May 2024 15:43:41 +0200

Removing corrupted packages

Previously, packages were checked before installation. This meant that
if an uncorrupted package was installed in the target directory, the
corrupted version was not checked and therefore not removed. From this
commit onwards, the package is checked even if one has already been
installed. In this way, the package is removed as soon as no one claims
to need it and the downloaded archive is detected as corrupt.

Diffstat:
Msrc/spkg.mk.in | 21++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/spkg.mk.in b/src/spkg.mk.in @@ -1,17 +1,16 @@ @NAME@: @ARCH@.tgz @ARCH@.sha512sum prefix + @if ! sha512sum -c @ARCH@.sha512sum; then \ + rm -f @ARCH@.tgz; \ + rm -f @ARCH@.sha512sum; \ + >&2 printf "ERROR: %s was corrupted and therefore deleted.\n" @ARCH@.tgz; \ + >&2 printf "Try rerunning make\n"; \ + exit 1; \ + fi @if ! cmp @ARCH@.sha512sum "$$(cat .prefix)/share/spkg/@ARCH@.sha512sum" \ > /dev/null 2>&1; then \ - if sha512sum -c @ARCH@.sha512sum; then \ - tar -xvf @ARCH@.tgz -C $$(cat .prefix); \ - $(SHELL) "$$(cat .prefix)/share/spkg/@NAME@.sh" install "$$(cat .prefix)"; \ - cp @ARCH@.sha512sum "$$(cat .prefix)/share/spkg/"; \ - else \ - rm -f @ARCH@.tgz; \ - rm -f @ARCH@.sha512sum; \ - >&2 printf "ERROR: %s was corrupted and therefore deleted.\n" @ARCH@.tgz; \ - >&2 printf "Try rerunning make\n"; \ - exit 1; \ - fi \ + tar -xvf @ARCH@.tgz -C $$(cat .prefix); \ + $(SHELL) "$$(cat .prefix)/share/spkg/@NAME@.sh" install "$$(cat .prefix)"; \ + cp @ARCH@.sha512sum "$$(cat .prefix)/share/spkg/"; \ fi @ARCH@.sha512sum @ARCH@.tgz: