Changeset 3e828ea in mainline for tools/release.sh


Ignore:
Timestamp:
2019-09-23T12:49:29Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9be2358
Parents:
9259d20 (diff), 1a4ec93f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiri Svoboda <jiri@…> (2019-09-22 12:49:07)
git-committer:
Jiri Svoboda <jiri@…> (2019-09-23 12:49:29)
Message:

Merge changes from master, especially Meson build

File:
1 moved

Legend:

Unmodified
Added
Removed
  • tools/release.sh

    r9259d20 r3e828ea  
    1 #! /bin/bash
     1#!/bin/sh
    22
    33#
    4 # Copyright (c) 2010 Jakub Jermar
     4# Copyright (c) 2019 Jiří Zárevúcky
    55# All rights reserved.
    66#
     
    2929#
    3030
    31 if [ $1" " == "-h " ];
    32 then
    33         echo "Perform pre-integration hands-off build of all profiles."
    34         echo
    35         echo "Syntax:"
    36         echo " $0 [-h] [args...]"
    37         echo
    38         echo " -h        Print this help."
    39         echo " args...   All other args are passed to make (e.g. -j 6)"
    40         echo
     31# Find out the path to the script.
     32SOURCE_DIR=`which -- "$0" 2>/dev/null`
     33# Maybe we are running bash.
     34[ -z "$SOURCE_DIR" ] && SOURCE_DIR=`which -- "$BASH_SOURCE"`
     35[ -z "$SOURCE_DIR" ] && exit 1
     36SOURCE_DIR=`dirname -- "$SOURCE_DIR"`
     37SOURCE_DIR=`cd $SOURCE_DIR && cd .. && echo $PWD`
    4138
    42         exit
    43 fi
    4439
    45 FAILED=""
    46 PASSED=""
    47 PROFILES=""
    48 DIRS=`find defaults/ -name Makefile.config | sed 's/^defaults\/\(.*\)\/Makefile.config/\1/' | sort`
     40echo "Running tools/build_all.sh"
    4941
    50 for D in $DIRS;
    51 do
    52         for H in $DIRS;
    53         do
    54                 if [ `echo $H | grep "^$D\/.*"`x != "x"  ];
    55                 then
    56                         continue 2
    57                 fi
    58         done
    59         PROFILES="$PROFILES $D"
    60 done
     42mkdir -p build_all
     43cd build_all
     44sh "${SOURCE_DIR}/tools/build_all.sh"
     45cd ..
    6146
    62 echo ">>> Going to build the following profiles:"
    63 echo $PROFILES
    64 
    65 for P in $PROFILES;
    66 do
    67         echo -n ">>>> Building $P... "
    68         ( make distclean && make PROFILE=$P HANDS_OFF=y "$@" ) >>/dev/null 2>>/dev/null
    69         if [ $? -ne 0 ];
    70         then
    71                 FAILED="$FAILED $P"
    72                 echo "failed."
    73         else
    74                 PASSED="$PASSED $P"
    75                 echo "ok."
    76         fi
    77 done
    78 
    79 echo ">>> Done."
     47echo
    8048echo
    8149
    82 echo ">>> The following profiles passed:"
    83 echo $PASSED
    84 echo
     50PROFILES=`sh ${SOURCE_DIR}/tools/list_profiles.sh`
     51RELEASE=`sed -n 's:^HELENOS_RELEASE \?= \?\(.*\)$:\1:p' "${SOURCE_DIR}/version"`
     52SRC_ARCHIVE="HelenOS-${RELEASE}-src.tar"
    8553
    86 echo ">>> The following profiles failed:"
    87 echo $FAILED
    88 echo
     54git -C "${SOURCE_DIR}" archive master -o "${PWD}/${SRC_ARCHIVE}"
     55bzip2 -f "${SRC_ARCHIVE}"
     56echo "Created ${SRC_ARCHIVE}.bz2"
    8957
     58for profile in $PROFILES; do
     59        image_name=`cat build_all/$profile/image_path`
     60        if [ -z "$image_name" ]; then
     61                continue
     62        fi
     63
     64        image_path="build_all/$profile/`cat build_all/$profile/image_path`"
     65        image_suffix=`echo "$image_name" | sed 's:.*\.::'`
     66
     67        release_name="HelenOS-${RELEASE}-`echo $profile | tr '/' '-'`.$image_suffix"
     68        cp "$image_path" "$release_name"
     69
     70        echo "Created $release_name"
     71done
Note: See TracChangeset for help on using the changeset viewer.