[v3,3/3] buildscript: Add separate parameter to update feeds in build dir

Submitted by Adrian Schmutzler on Oct. 7, 2019, 12:28 p.m.

Details

Message ID 20191007122807.1918-3-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler Oct. 7, 2019, 12:28 p.m.
By running "./buildscript updatefeeds", the feeds in build dir are
recreated without touching the rest of the directory.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

This is added as 2/2 as it depends on the change of the dl directory
link. However, 1/2 can be applied without caring about 2/2 ...

v2: Rebased, now 3/3 instead of 2/2
v3: No change
---
 buildscript | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/buildscript b/buildscript
index 9ae77cbd..098a70db 100755
--- a/buildscript
+++ b/buildscript
@@ -136,6 +136,14 @@  prepare() {
     # 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
+
+    update_feeds
+}
+
+update_feeds() {
     ## generate own feeds.conf
     #this local variable should be globally configure variable used in get_source and here
     local PACKAGEBASE=${PWD}/src/packages
@@ -166,10 +174,6 @@  prepare() {
             "$builddir"/scripts/feeds install -p "$NAME" "${PACKAGESVAR[@]}"
         fi
     done
-
-    #saves ~200MB for each build
-    test -d ./src/dl || mkdir ./src/dl
-    ln -s ../src/dl "$builddir"/dl
 }
 
 prebuild() {
@@ -438,6 +442,9 @@  case "$1" in
             prepare
         fi
         ;;
+    "updatefeeds")
+        update_feeds
+        ;;
     "build")
         if [ "$2" = "help" ] || [ "$2" = "x" ]; then
             echo "This option compiles the firmware"
@@ -501,6 +508,7 @@  case "$1" in
         echo "  selectbsp <bsp-file>"
         echo "  selectvariant <name of variant>"
         echo "  prepare"
+        echo "  updatefeeds"
         echo "  config openwrt"
         echo "  build [fast|debug]"
         echo "  buildall [fast]"

Comments

Fabian Blaese Nov. 10, 2019, 12:59 p.m.
Reviewed-by: Fabian Bläse <fabian@blaese.de>

On 07.10.19 14:28, Adrian Schmutzler wrote:
> By running "./buildscript updatefeeds", the feeds in build dir are
> recreated without touching the rest of the directory.
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> ---
> 
> This is added as 2/2 as it depends on the change of the dl directory
> link. However, 1/2 can be applied without caring about 2/2 ...
> 
> v2: Rebased, now 3/3 instead of 2/2
> v3: No change
> ---
>  buildscript | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/buildscript b/buildscript
> index 9ae77cbd..098a70db 100755
> --- a/buildscript
> +++ b/buildscript
> @@ -136,6 +136,14 @@ prepare() {
>      # 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
> +
> +    update_feeds
> +}
> +
> +update_feeds() {
>      ## generate own feeds.conf
>      #this local variable should be globally configure variable used in get_source and here
>      local PACKAGEBASE=${PWD}/src/packages
> @@ -166,10 +174,6 @@ prepare() {
>              "$builddir"/scripts/feeds install -p "$NAME" "${PACKAGESVAR[@]}"
>          fi
>      done
> -
> -    #saves ~200MB for each build
> -    test -d ./src/dl || mkdir ./src/dl
> -    ln -s ../src/dl "$builddir"/dl
>  }
>  
>  prebuild() {
> @@ -438,6 +442,9 @@ case "$1" in
>              prepare
>          fi
>          ;;
> +    "updatefeeds")
> +        update_feeds
> +        ;;
>      "build")
>          if [ "$2" = "help" ] || [ "$2" = "x" ]; then
>              echo "This option compiles the firmware"
> @@ -501,6 +508,7 @@ case "$1" in
>          echo "  selectbsp <bsp-file>"
>          echo "  selectvariant <name of variant>"
>          echo "  prepare"
> +        echo "  updatefeeds"
>          echo "  config openwrt"
>          echo "  build [fast|debug]"
>          echo "  buildall [fast]"
>
Fabian Blaese Nov. 10, 2019, 1:31 p.m.
applied.