#! /usr/bin/env sh FIRMWARE_URL="http://downloads.bremen.freifunk.net/firmware/" LOCAL_SUFFIX="bremen" GLUON_DIR="gluon/" KEYFILE="$HOME/.ecdsakey" set -eu if which realpath > /dev/null; then GLUON_SITEDIR="$(dirname "$(realpath "$0")")" else GLUON_SITEDIR="$(dirname "$(readlink -f "$0")")" fi export GLUON_SITEDIR get_GLUON_TAG() { if ! git --git-dir="${GLUON_DIR}/.git" describe --exact-match; then echo 'The gluon tree is not checked out at a tag.' echo 'Please use `git checkout ` to use an official gluon release' echo 'or build it manually. Only with at a tag we can autogenerate the' echo 'release string!' exit 1 fi } get_last_release() { branch="$1" wget -q -O- "${FIRMWARE_URL}/${branch}/sysupgrade/${branch}.manifest" | \ awk 'parse == 1 { print $2; exit } /^$/ { parse=1 }' } is_based_on() { [ "${1#$2}" != "${1}" ] return $? } extract_local_version() { local_version_tmp="${1#*+${LOCAL_SUFFIX}}" echo "${local_version_tmp%~testing}" } debug= if [ "$#" -gt 0 ]; then if [ "$1" = '-h' -o "$1" = '--help' ]; then cat < reset local version number local_version=1 fi auto_determined_release="${GLUON_TAG}+${LOCAL_SUFFIX}${local_version}" read -p "Release name for this build [default: ${auto_determined_release}]: " GLUON_RELEASE GLUON_RELEASE="${GLUON_RELEASE:-$auto_determined_release}" cat > "$statefile" <> "$statefile" done make manifest make manifest GLUON_BRANCH=testing GLUON_PRIORITY=0 cd .. if [ -n "$KEYFILE" -a -r "$KEYFILE" ]; then "${GLUON_DIR}/contrib/sign.sh" "$KEYFILE" "${GLUON_DIR}/output/images/sysupgrade/${GLUON_BRANCH}.manifest" fi rm "$statefile"