Merge pull request #360 from eduardosm/fixes

Avoid deleting sources that will be needed in future builds and fix updating checksums with `--update-checksums`
This commit is contained in:
fosslinux 2023-12-27 22:59:11 +00:00 committed by GitHub
commit ca0e701ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 23 deletions

View File

@ -1,15 +0,0 @@
# SPDX-FileCopyrightText: 2023 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
# Save because linux deletes all distfiles to save space
cp "${DISTFILES}"/musl-1.2.4.tar.gz /tmp
cp "${DISTFILES}"/curl-7.88.1.tar.bz2 /tmp
# Clear up some RAM space
grep --no-filename '^build' "${SOURCES}"/run*.sh | grep -v musl-1.2.4 | sed "s/build //" | sed "s/ .*$//" | while read -r p ; do
rm -rf "${SOURCES:?}/${p:?}"
done
mv /tmp/musl-1.2.4.tar.gz "${DISTFILES}"
mv /tmp/curl-7.88.1.tar.bz2 "${DISTFILES}"

43
steps/improve/clean_sources.sh Executable file
View File

@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2023 Eduardo Sánchez Muñoz <eduardosm-dev@e64.io>
#
# SPDX-License-Identifier: GPL-3.0-or-later
# Delete sources of packages before linux kernel
get_source_filename() {
local url="${1}"
local fname="${3}"
# Default to basename of url if not given
echo "${fname:-$(basename "${url}")}"
}
# List all packages from linux kernel onwards
# Ideally, we would use arrays here, but they are not supported by
# the bash version we have at this point.
pkgs="$(awk '/^build:/ { print $2 }' "${SRCDIR}/manifest" | awk '/^linux-[0-9]/,EOF { print $0 }')"
# Gather source names for all packages in pkgs, which we want to keep
keep_sources=""
for pkg in ${pkgs}; do
while read line; do
keep_sources="${keep_sources} $(get_source_filename ${line})"
done < "${SRCDIR}/${pkg}/sources"
done
for source in "${DISTFILES}/"*; do
source_name="$(basename "${source}")"
for keep_source in ${keep_sources}; do
if [ "${keep_source}" = "${source_name}" ]; then
# Countinue the outer loop to skip deletion
continue 2
fi
done
# Delete this source
rm "${source}"
done
unset get_source_filename
unset pkgs pkg line
unset keep_sources keep_source
unset source source_name

View File

@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2023 Eduardo Sánchez Muñoz <eduardosm-dev@e64.io>
#
# SPDX-License-Identifier: GPL-3.0-or-later
pushd /external/repo
sha256sum -- * | tee "${SRCDIR}/SHA256SUMS.pkgs"
popd

View File

@ -6,14 +6,6 @@
# XXX: Fix package after builder-hex0
src_unpack() {
# Remove all previous source tarballs
mkdir /tmp/keep
for keep in deblob-4.9 ${pkg}.tar.gz musl-1.2.4.tar.gz curl-7.88.1.tar.bz2; do
mv "${DISTFILES}/${keep}" /tmp/keep
done
rm -r "${DISTFILES}/"*
mv /tmp/keep/* "${DISTFILES}"
mkdir "${pkg}"
mv "${DISTFILES}/deblob-4.9" "${pkg}/"
default || true # Predictable link errors - not a problem

View File

@ -114,6 +114,7 @@ build: bc-1.07.1
define: BUILD_LINUX = ( CHROOT == False || BUILD_KERNELS == True )
build: kexec-linux-1.0.0 ( BUILD_LINUX == True )
build: kexec-tools-2.0.22 ( BUILD_LINUX == True )
improve: clean_sources
build: linux-4.9.10 ( BUILD_LINUX == True )
jump: break ( INTERNAL_CI == pass1 )
jump: linux ( CHROOT == False )
@ -180,3 +181,4 @@ build: gcc-10.4.0
build: binutils-2.41
build: gcc-13.1.0
improve: null_time ( FORCE_TIMESTAMPS == True )
improve: update_checksums ( UPDATE_CHECKSUMS == True )