From 09840874c3af449032a07cac56e23a78d7e3a666 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sat, 8 Aug 2020 22:48:53 +0100 Subject: Software tarballs saved as symlinks if already in filesystem Until now, if the software source tarballs already existed on the system they would be copied inside the project. However, the software source tarballs are sometimes/mostly larger than their actual product and can consume significant space (~375 MB in the core branch!). With this commit, when the software are present on the system, their symbolic link will be placed in 'BDIR/software/tarballs', not a full copy. Also, because the tarballs in software tarball directory may themselves be links, we use 'realpath' to find the final place of the actual file and link to that location. Therefore if 'realpath' can't be found (prior to installing Coreutils in Maneage), we will copy the tarballs from the given software tarball directory. After Maneage has installed Coreutils, the project's own 'realpath' will be used. Of course, if the software are downloaded, their full downloaded copy will be kept in 'BDIR/software/tarballs', nothing has changed in the downloading scenario. --- reproduce/software/make/build-rules.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'reproduce/software/make') diff --git a/reproduce/software/make/build-rules.mk b/reproduce/software/make/build-rules.mk index 86370ab..d50c301 100644 --- a/reproduce/software/make/build-rules.mk +++ b/reproduce/software/make/build-rules.mk @@ -44,7 +44,12 @@ import-source = final=$(tdir)/$$tarball; \ unchecked="$$final.unchecked"; \ rm -f "$$unchecked"; \ if [ -f $(DEPENDENCIES-DIR)/$$tarball ]; then \ - cp $(DEPENDENCIES-DIR)/$$tarball "$$unchecked"; \ + if type realpath > /dev/null 2> /dev/null; then \ + ln -sf "$$(realpath $(DEPENDENCIES-DIR)/$$tarball)" \ + "$$unchecked"; \ + else \ + cp $(DEPENDENCIES-DIR)/$$tarball "$$unchecked"; \ + fi; \ else \ if [ x"$$url" = x ]; then \ bservers="$(backupservers)"; \ @@ -70,7 +75,7 @@ import-source = final=$(tdir)/$$tarball; \ if [ x"$$checksum" = x"$$exp_checksum" ]; then \ mv "$$unchecked" "$$final"; \ else \ - echo "ERROR: Non-matching checksum for '$$tarball'."; \ + echo "ERROR: Non-matching checksum: $$tarball"; \ echo "Checksum should be: $$exp_checksum"; \ echo "Checksum is: $$checksum"; \ exit 1; \ -- cgit v1.2.1