Skip to contentSkip to conversation

utils/test-pkg: allow to override the default build directory with an environment variable

PATCH In review Thomas Devoogdt 2 participants 2 messages Sep 19, 2025 – Feb 4

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils/test-pkg: allow to override the default build directory with an environment variable

From: Thomas Devoogdt <[email protected]>

Currently, there is one way to override the ${HOME}/br-test-pkg default, using the --build-dir argument. But when doing frequent test runs, it's just easier to force it with an environment variable, so add it.

---
 utils/test-pkg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
utils/test-pkg +2 -2
index cea7ace7cb..32b2486b61 100755
@@ -89,7 +89,7 @@ main() {
         printf "error: %s: no such file\n" "${cfg}" >&2; exit 1
     fi
     if [ -z "${dir}" ]; then
-        dir="${HOME}/br-test-pkg"
+        dir="${BR2_TEST_DIR:-${HOME}/br-test-pkg}"
     fi
 
     if [ "${random}" -gt 0 ]; then
@@ -271,7 +271,7 @@ Options:
 
     -d DIR, --build-dir DIR
         Do the builds in directory DIR, one sub-dir per toolchain.
-        If not specified, defaults to \${HOME}/br-test-pkg
+        If not specified, defaults to \${BR2_TEST_DIR}, or \${HOME}/br-test-pkg.
 
     -p PKG, --package PKG
         Test-build the package PKG, by running 'make PKG'; if not specified,
Signature · 6 lines
2.49.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Thomas, All,

Le 19/09/2025 à 15:38, Thomas Devoogdt a écrit :

Quoted 25 lines

From: Thomas Devoogdt <[email protected]>

Currently, there is one way to override the ${HOME}/br-test-pkg default, using the --build-dir argument. But when doing frequent test runs, it's just easier to force it with an environment variable, so add it.

---
 utils/test-pkg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
utils/test-pkg +1 -1
index cea7ace7cb..32b2486b61 100755
@@ -89,7 +89,7 @@ main() {
         printf "error: %s: no such file\n" "${cfg}" >&2; exit 1
     fi
     if [ -z "${dir}" ]; then
-        dir="${HOME}/br-test-pkg"
+        dir="${BR2_TEST_DIR:-${HOME}/br-test-pkg}"
     fi
 
     if [ "${random}" -gt 0 ]; then

utils/test-pkg Options: · line 274

Quoted 5 lines
utils/test-pkg +1 -1
@@ -271,7 +271,7 @@ Options:
 
     -d DIR, --build-dir DIR
         Do the builds in directory DIR, one sub-dir per toolchain.
-        If not specified, defaults to \${HOME}/br-test-pkg
+        If not specified, defaults to \${BR2_TEST_DIR}, or \${HOME}/br-test-pkg.

The prefix BR2_ is for Buildroot environement variable like BR2_VERSION_FULL or BR2_DL_DIR from the main Makefile. BR2_TEST_DIR is not used anywere else.

Maybe use BR_ like for BR_COMPILER_PARANOID_UNSAFE_PATH?

Best regards,
Romain

utils/test-pkg Options: · line 277

Quoted 3 lines
utils/test-pkg +0 -0
     -p PKG, --package PKG
         Test-build the package PKG, by running 'make PKG'; if not specified,

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot