From: DeaDDooMER Date: Mon, 22 Jul 2019 20:19:48 +0000 (+0300) Subject: update make-bootstrap.sh X-Git-Tag: v0.2~3 X-Git-Url: https://deadsoftware.ru/gitweb?p=cpc.git;a=commitdiff_plain;h=1a42ddc54f906162fc90d4530cd3d5580e007ca1 update make-bootstrap.sh --- diff --git a/make-bootstrap.sh b/make-bootstrap.sh index e82d0a6..8eb3b66 100755 --- a/make-bootstrap.sh +++ b/make-bootstrap.sh @@ -9,11 +9,20 @@ set -e _exec="make-bootstrap.sh" _this="$(dirname "$(readlink -f "$0")")" _version="v0.2" +_sign=false ###^^^^^^^^^^^### ### Functions ### ###___________### +usage() { + echo "Usage: make-bootstrap.sh [options]" + echo "Options:" + echo " -v version Set build version" + echo " -S Sign build" + exit 2 +} + make_bootstrap() { local _cpu="$1" local _target="$2" @@ -24,6 +33,28 @@ make_bootstrap() { -type d -name 'CodeC' -prune -o -exec rm -rf {} + } +error() { + echo "$_exec:" "$@" + exit 1 +} + +###^^^^^^^^^^^^^^^### +### Parse options ### +###_______________### + +while getopts v:Sh _name +do + case "$_name" in + v) _version="$OPTARG" ;; + S) _sign=true ;; + h|?) usage ;; + esac +done + +if [ -z "$_version" ] || echo "$_version" | grep " " > /dev/null; then + error "version not specified or contain spaces" +fi + ###^^^^^^^^^^^^^^^^^^^^### ### Prebuild C sources ### ###____________________### @@ -34,6 +65,12 @@ make_bootstrap 486 cpfront linux make_bootstrap 486 cpfront cygwin make_bootstrap arm cpfront linux +###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^### +### Hack: remove temp files from v0.1 ### +###___________________________________### + +find "$_this/bootstrap" -type f -name '.new*' -delete + ###^^^^^^^^^^^^^^^^^^^^^^### ### Package dist sources ### ###______________________### @@ -53,3 +90,11 @@ cp -rt "$_this/cpc-$_version" -- \ "$_this/src" \ "$_this/C" tar czf "cpc-$_version.src.tar.gz" "cpc-$_version" + +###^^^^^^^^^^^^^^^^### +### Make signature ### +###________________### + +if $_sign; then + gpg --armor --detach-sig "cpc-$_version.src.tar.gz" +fi