buildscript: Apply variant to builddir in build step

Submitted by Fabian Blaese on Nov. 10, 2019, 12:55 p.m.

Details

Message ID 20191110125558.120560-1-fabian@blaese.de
State Superseded
Headers show

Commit Message

Fabian Blaese Nov. 10, 2019, 12:55 p.m.
The build variant previously only got applied in the prepare
step. Therefore selecting a new variant for a subsequent build
without calling prepare again produced a build with a different
variant than the selected one.

As the filename and version number is evaluated in the prebuild
step, which is called on every build, the version number did use
selected variant, so the build variant did not match the variant
in the version string.

As this step only causes the base package to be fully rebuilt,
it is moved to buildscripts prebuild step and is therefore applied
on every build.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
---
 buildscript | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/buildscript b/buildscript
index 098a70d..3062d69 100755
--- a/buildscript
+++ b/buildscript
@@ -131,11 +131,6 @@  prepare() {
 
     patch_target
 
-    # set the variant for this build
-    cp "./src/packages/fff/fff/variant-$(cat selected_variant).mk" "$builddir"/variant.mk
-    # force the reevaluation of this Makefile to make note of the new variant
-    touch ./src/packages/fff/fff/Makefile
-
     #saves ~200MB for each build
     test -d ./src/dl || mkdir ./src/dl
     ln -s ../src/dl "$builddir"/dl
@@ -177,6 +172,11 @@  update_feeds() {
 }
 
 prebuild() {
+    # set the variant for this build
+    cp "./src/packages/fff/fff/variant-$(cat selected_variant).mk" "$builddir"/variant.mk
+    # force the reevaluation of this Makefile to make note of the new variant
+    touch ./src/packages/fff/fff/Makefile
+
     #create filesdir for our config
     /bin/rm -rf "$builddir"/files
     mkdir "$builddir"/files