lib.sh: more unified config handling

replace it with logic that simply uses "." to load
files directly. for this, "vcfg" is added as a variable
in coreboot target.cfg files, referring to a directory
in config/vendor/ containing a file named pkg.cfg, and
this file then contains the same variables as the
erstwhile config/vendor/sources

config/git files are now directories, also containing
pkg.cfg files each with the same variables as before,
such as repository link and commit hash

this change results in a noticeable reduction in code
complexity within the build system.

unified reading of config files: new function setcfg()
added to lib.sh

setcfg checks if a config exists. if a 2nd argument is
passed, it is used as a return value for eval, otherwise
a string calling err is passed. setcfg output is passed
through eval, to set strings based on config; eval must
be used, so that the variables are set within the same
scope, otherwise they'd be set within setcfg which could
lead to some whacky results.

there's still a bit more more to do, but this single change
results in a substantial reduction in code complexity.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2024-06-22 02:35:25 +01:00
parent ad1602569e
commit fc7ae3e590
83 changed files with 190 additions and 306 deletions
-6
View File
@@ -1,6 +0,0 @@
{bios_extract}{
rev: 0a7bc1d71735ef97b00dfec0fd54a02fcc5d1bb0
loc: bios_extract
url: https://review.coreboot.org/bios_extract
bkup_url: https://github.com/coreboot/bios_extract/
}
+3
View File
@@ -0,0 +1,3 @@
rev="0a7bc1d71735ef97b00dfec0fd54a02fcc5d1bb0"
url="https://review.coreboot.org/bios_extract"
bkup_url="https://github.com/coreboot/bios_extract/"
-6
View File
@@ -1,6 +0,0 @@
{biosutilities}{
rev: 03ae0cf0706ede5a2a15da0986c19c776d0e6b26
loc: biosutilities
url: https://codeberg.org/libreboot/BIOSUtilities
bkup_url: https://github.com/platomav/BIOSUtilities
}
+3
View File
@@ -0,0 +1,3 @@
rev="03ae0cf0706ede5a2a15da0986c19c776d0e6b26"
url="https://codeberg.org/libreboot/BIOSUtilities"
bkup_url="https://github.com/platomav/BIOSUtilities"
-6
View File
@@ -1,6 +0,0 @@
{coreboot}{
rev: HEAD
loc: coreboot/coreboot
url: https://review.coreboot.org/coreboot
bkup_url: https://github.com/coreboot/coreboot.git
}
+3
View File
@@ -0,0 +1,3 @@
rev="HEAD"
url="https://review.coreboot.org/coreboot"
bkup_url="https://github.com/coreboot/coreboot.git"
-6
View File
@@ -1,6 +0,0 @@
{docs}{
rev: e72d055915c3a9ffe739982946e101b146b2483c
loc: docs
url: https://codeberg.org/vimuser/untitled
bkup_url: https://notabug.org/untitled/untitled
}
+3
View File
@@ -0,0 +1,3 @@
rev="e72d055915c3a9ffe739982946e101b146b2483c"
url="https://codeberg.org/vimuser/untitled"
bkup_url="https://notabug.org/untitled/untitled"
-6
View File
@@ -1,6 +0,0 @@
{flashprog}{
rev: 5b4fdd11dd74c7f018cb04f7a27a2badc02fe182
loc: flashprog
url: https://review.sourcearcade.org/flashprog
bkup_url: https://github.com/SourceArcade/flashprog.git
}
+3
View File
@@ -0,0 +1,3 @@
rev="5b4fdd11dd74c7f018cb04f7a27a2badc02fe182"
url="https://review.sourcearcade.org/flashprog"
bkup_url="https://github.com/SourceArcade/flashprog.git"
-6
View File
@@ -1,6 +0,0 @@
{grub}{
rev: HEAD
loc: grub/grub
url: git://git.savannah.gnu.org/grub.git
bkup_url: https://codeberg.org/libreboot/grub
}
+3
View File
@@ -0,0 +1,3 @@
rev="HEAD"
url="git://git.savannah.gnu.org/grub.git"
bkup_url="https://codeberg.org/libreboot/grub"
-6
View File
@@ -1,6 +0,0 @@
{memtest86plus}{
rev: 5dcd424ea7afb857c1171e747ef064d98d26afeb
loc: memtest86plus
url: https://codeberg.org/libreboot/memtest86plus
bkup_url: https://github.com/memtest86plus/memtest86plus.git
}
+3
View File
@@ -0,0 +1,3 @@
rev="5dcd424ea7afb857c1171e747ef064d98d26afeb"
url="https://codeberg.org/libreboot/memtest86plus"
bkup_url="https://github.com/memtest86plus/memtest86plus.git"
-6
View File
@@ -1,6 +0,0 @@
{pico-sdk}{
rev: 6a7db34ff63345a7badec79ebea3aaef1712f374
loc: pico-sdk
url: https://codeberg.org/libreboot/pico-sdk
bkup_url: https://github.com/raspberrypi/pico-sdk
}
+3
View File
@@ -0,0 +1,3 @@
rev="6a7db34ff63345a7badec79ebea3aaef1712f374"
url="https://codeberg.org/libreboot/pico-sdk"
bkup_url="https://github.com/raspberrypi/pico-sdk"
-7
View File
@@ -1,7 +0,0 @@
{pico-serprog}{
rev: e75e3a20e63269a5e3189bc2e49a6a81d45a636a
loc: pico-serprog
url: https://codeberg.org/libreboot/pico-serprog
bkup_url: https://git.disroot.org/libreboot/pico-serprog
depend: pico-sdk
}
+4
View File
@@ -0,0 +1,4 @@
rev="e75e3a20e63269a5e3189bc2e49a6a81d45a636a"
url="https://codeberg.org/libreboot/pico-serprog"
bkup_url="https://git.disroot.org/libreboot/pico-serprog"
depend="pico-sdk"
-6
View File
@@ -1,6 +0,0 @@
{seabios}{
rev: HEAD
loc: seabios/seabios
url: https://review.coreboot.org/seabios
bkup_url: https://github.com/coreboot/seabios
}
+3
View File
@@ -0,0 +1,3 @@
rev="HEAD"
url="https://review.coreboot.org/seabios"
bkup_url="https://github.com/coreboot/seabios"
-6
View File
@@ -1,6 +0,0 @@
{stm32-vserprog}{
rev: 8fcf0a4d41800631b571fa7bbd1d8b251f0a2111
loc: stm32-vserprog
url: https://codeberg.org/libreboot/stm32-vserprog
bkup_url: https://git.disroot.org/libreboot/stm32-vserprog
}
+3
View File
@@ -0,0 +1,3 @@
rev="8fcf0a4d41800631b571fa7bbd1d8b251f0a2111"
url="https://codeberg.org/libreboot/stm32-vserprog"
bkup_url="https://git.disroot.org/libreboot/stm32-vserprog"
-6
View File
@@ -1,6 +0,0 @@
{u-boot}{
rev: HEAD
loc: u-boot/u-boot
url: https://source.denx.de/u-boot/u-boot.git
bkup_url: https://github.com/u-boot/u-boot.git
}
+3
View File
@@ -0,0 +1,3 @@
rev="HEAD"
url="https://source.denx.de/u-boot/u-boot.git"
bkup_url="https://github.com/u-boot/u-boot.git"
-6
View File
@@ -1,6 +0,0 @@
{uefitool}{
rev: 4a41c33596e9bc3ae812e763965d91ac57553e02
loc: uefitool
url: https://codeberg.org/libreboot/UEFITool
bkup_url: https://github.com/LongSoft/UEFITool
}
+3
View File
@@ -0,0 +1,3 @@
rev="4a41c33596e9bc3ae812e763965d91ac57553e02"
url="https://codeberg.org/libreboot/UEFITool"
bkup_url="https://github.com/LongSoft/UEFITool"