[v10,3/3] added buildrelease() for release process

Submitted by Jan Kraus on March 24, 2016, 8:56 p.m.

Details

Message ID 1458853003-18910-4-git-send-email-mayosemmel@gmail.com
State Superseded, archived
Headers show

Commit Message

Jan Kraus March 24, 2016, 8:56 p.m.
Signed-off-by: Jan Kraus <mayosemmel@gmail.com>
---
 buildscript | 35 ++++++++++++++++++++++++++++++++---
 1 file changed, 32 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/buildscript b/buildscript
index cf7ff60..2ad0e7b 100755
--- a/buildscript
+++ b/buildscript
@@ -233,7 +233,7 @@  build() {
         mkdir bin
     fi
 
-    postbuild
+    cp_firmware
 }
 
 config() {
@@ -282,8 +282,26 @@  cp_firmware() {
     done
 }
 
-postbuild() {
-    cp_firmware
+buildrelease() {
+    if [ "$1" = "all" ];then
+        buildall
+    elif [ "$1" = "fast" ];then
+        build fast
+    elif [ "$1" = "all" ] && [ "$2" = "fast" ];then
+        buildall fast
+    else
+        build
+    fi
+    rm -f "./bin/MD5SUMS"
+    rm -f "./bin/SHA1SUMS"
+    cd bin
+    for binary in *.bin; do
+        md5sum "$binary" >> ./MD5SUMS
+        sha1sum "$binary" >> ./SHA1SUMS
+        sha256sum "$binary" >> ./SHA256SUMS
+    done
+    cd ..
+    echo -e "VERSION:$version" > ./bin/release.nfo
 }
 
 clean() {
@@ -423,6 +441,16 @@  case "$1" in
             buildall "$2" "$3"
         fi
         ;;
+    "release")
+        if [ "$2" = help ]; then
+            echo "This option builds the firmware for a given board. It also creates hash sums and a the file release.nfo"
+            echo
+            echo "Usage: $0 $1 [all] [fast]"
+            echo
+        else
+            buildrelease "$2"
+        fi
+        ;;
     *)
         echo "This is the Build Environment Script of the Freifunk Community Franken."
         echo
@@ -434,6 +462,7 @@  case "$1" in
         echo "  config openwrt"
         echo "  build [fast|debug]"
         echo "  buildall <community-file> [fast]"
+        echo "  release [all] [fast]"
         echo "  clean"
         echo ""
         echo "If you need help to one of these options just type: $0 <command> help"

Comments

Tim Niemeyer April 4, 2016, 4:35 p.m.
Moin Jan

unten ein paar Kleinigkeiten..

Am Donnerstag, den 24.03.2016, 21:56 +0100 schrieb Jan Kraus:
> Signed-off-by: Jan Kraus <mayosemmel@gmail.com>
> ---
>  buildscript | 35 ++++++++++++++++++++++++++++++++---
>  1 file changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/buildscript b/buildscript
> index cf7ff60..2ad0e7b 100755
> --- a/buildscript
> +++ b/buildscript
> @@ -233,7 +233,7 @@ build() {
>          mkdir bin
>      fi
>  
> -    postbuild
> +    cp_firmware
Dieser Schritt gehört nicht in diesen Patch. Ggfs sollte das in den
Ersten rein?

>  }
>  
>  config() {
> @@ -282,8 +282,26 @@ cp_firmware() {
>      done
>  }
>  
> -postbuild() {
> -    cp_firmware
Dieser Schritt gehört nicht in diesen Patch. Ggfs sollte das in den
Ersten rein?

> +buildrelease() {
> +    if [ "$1" = "all" ];then
> +        buildall
> +    elif [ "$1" = "fast" ];then
> +        build fast
> +    elif [ "$1" = "all" ] && [ "$2" = "fast" ];then
> +        buildall fast
> +    else
> +        build
> +    fi
> +    rm -f "./bin/MD5SUMS"
> +    rm -f "./bin/SHA1SUMS"
> +    cd bin
> +    for binary in *.bin; do
> +        md5sum "$binary" >> ./MD5SUMS
Damit es kompatibel ist, müsste es:
md5sum "$binary" > "$binary".md5 sein.

> +        sha1sum "$binary" >> ./SHA1SUMS
> +        sha256sum "$binary" >> ./SHA256SUMS
Ja, wäre schon sinnvoller, aber dann geht die Kompatiblität kaputt.
Vorschlag: Wie nehmen sha256 auf, lassen aber sha1 weg.

Tim

> +    done
> +    cd ..
> +    echo -e "VERSION:$version" > ./bin/release.nfo
>  }
>  
>  clean() {
> @@ -423,6 +441,16 @@ case "$1" in
>              buildall "$2" "$3"
>          fi
>          ;;
> +    "release")
> +        if [ "$2" = help ]; then
> +            echo "This option builds the firmware for a given board. It also creates hash sums and a the file release.nfo"
> +            echo
> +            echo "Usage: $0 $1 [all] [fast]"
> +            echo
> +        else
> +            buildrelease "$2"
> +        fi
> +        ;;
>      *)
>          echo "This is the Build Environment Script of the Freifunk Community Franken."
>          echo
> @@ -434,6 +462,7 @@ case "$1" in
>          echo "  config openwrt"
>          echo "  build [fast|debug]"
>          echo "  buildall <community-file> [fast]"
> +        echo "  release [all] [fast]"
>          echo "  clean"
>          echo ""
>          echo "If you need help to one of these options just type: $0 <command> help"
> -- 
> 2.1.4
>