1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-25 20:30:43 +01:00

Simplify dependency handling

- dependencies() accepts a single package name instead of a list.
   Is used only that way anwayway.
 - Remove most temporary packge lists

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-01-24 11:18:56 +01:00
parent 077f72f529
commit 78c616ca27
5 changed files with 8 additions and 36 deletions

6
mk.sh
View file

@ -44,8 +44,7 @@ source "$SCRIPTDIR/util/cmake.sh"
############################## build toolchain ############################### ############################## build toolchain ###############################
echo "--- resolving toolchain dependencies ---" echo "--- resolving toolchain dependencies ---"
echo "toolchain" > "$BUILDROOT/$CFG/rawpkg" dependencies "toolchain" "tcpkg" > "$PACKAGELIST"
dependencies "$BUILDROOT/$CFG/rawpkg" "$PACKAGELIST" "tcpkg"
cat "$PACKAGELIST" cat "$PACKAGELIST"
echo "--- downloading toolchain files ---" echo "--- downloading toolchain files ---"
@ -70,8 +69,7 @@ save_toolchain
############################### build packages ############################### ############################### build packages ###############################
echo "--- resolving package dependencies ---" echo "--- resolving package dependencies ---"
echo "release-${CFG}" > "$BUILDROOT/$CFG/rawpkg" dependencies "release-${CFG}" "pkg" > "$PACKAGELIST"
dependencies "$BUILDROOT/$CFG/rawpkg" "$PACKAGELIST" "pkg"
cat "$PACKAGELIST" cat "$PACKAGELIST"
echo "--- downloading package files ---" echo "--- downloading package files ---"

View file

@ -11,11 +11,8 @@ build() {
echo "/lib" > "$BUILD/etc/ld-musl-i386.path" echo "/lib" > "$BUILD/etc/ld-musl-i386.path"
# install packages to rootfs # install packages to rootfs
cat "$SCRIPTDIR/pkg/rootfs-alix/depends" | sort -u > "$BUILD/rawpkg" dependencies "rootfs-alix" "pkg" | grep -v "rootfs-alix" > "$BUILD/etc/packages"
dependencies "$BUILD/rawpkg" "$BUILD/etc/packages" "pkg"
echo "toolchain" >> "$BUILD/etc/packages" echo "toolchain" >> "$BUILD/etc/packages"
rm -f "$BUILD/rawpkg"
while read pkgname; do while read pkgname; do
if [ ! -e "$PKGDEPLOYDIR/$pkgname" ]; then if [ ! -e "$PKGDEPLOYDIR/$pkgname" ]; then

View file

@ -12,11 +12,8 @@ build() {
echo "/opt/vc/lib" >> "$BUILD/etc/ld-musl-arm.path" echo "/opt/vc/lib" >> "$BUILD/etc/ld-musl-arm.path"
# install packages to rootfs # install packages to rootfs
cat "$SCRIPTDIR/pkg/rootfs-rpi3/depends" | sort -u > "$BUILD/rawpkg" dependencies "rootfs-rpi3" "pkg" | grep -v "rootfs-rpi3" > "$BUILD/etc/packages"
dependencies "$BUILD/rawpkg" "$BUILD/etc/packages" "pkg"
echo "toolchain" >> "$BUILD/etc/packages" echo "toolchain" >> "$BUILD/etc/packages"
rm -f "$BUILD/rawpkg"
while read pkgname; do while read pkgname; do
if [ ! -e "$PKGDEPLOYDIR/$pkgname" ]; then if [ ! -e "$PKGDEPLOYDIR/$pkgname" ]; then

View file

@ -14,27 +14,8 @@ dependencies_recursive() {
} }
dependencies() { dependencies() {
local RAW="$1" local NAME="$1"
local PKGLIST="$2" local PKGDIR="$2"
local PKGDIR="$3"
local TEMP=$(mktemp)
truncate -s 0 "$PKGLIST" dependencies_recursive "$NAME" "$PKGDIR" | tsort | tac
# handle toplevel packages _with_ depenendencies
while read pkgname; do
dependencies_recursive "$pkgname" "$PKGDIR" >> "$TEMP"
done < "$RAW"
# handle toplevel packages without dependencies
while read pkgname; do
if [ ! -e "$SCRIPTDIR/$PKGDIR/$pkgname/depends" ]; then
grep -q "$pkgname" "$TEMP" &> /dev/null || \
echo "$pkgname" >> "$PKGLIST"
fi
done < "$RAW"
# generate topologically sorted list of packages
sort -u "$TEMP" | tsort | tac >> "$PKGLIST"
rm "$TEMP"
} }

View file

@ -20,8 +20,7 @@ install_build_deps() {
return return
fi fi
dependencies "$SCRIPTDIR/pkg/$pkg/depends" \ dependencies "$pkg" "pkg" | grep -v "$pkg" > "$BUILDROOT/$CFG/deppkg"
"$BUILDROOT/$CFG/deppkg" "pkg"
while read deppkg; do while read deppkg; do
local devdir="$PKGDEPLOYDIR/${deppkg}-dev" local devdir="$PKGDEPLOYDIR/${deppkg}-dev"