taler-merchant-demos

Python-based Frontends for the Demonstration Web site
Log | Files | Refs | Submodules | README | LICENSE

bump (1095B)


      1 #!/usr/bin/env bash
      2 # This file is in the public domain.
      3 set -eu
      4 
      5 if [ $# != 1 ]; then
      6     >&2 echo "Illegal number of arguments"
      7     >&2 echo "Usage: $0 <version>"
      8     exit -1
      9 fi
     10 
     11 PACKAGE=taler-merchant-demos
     12 VERSION="$1"
     13 DATE="$(date -R)"
     14 GIT_USER="$(git config user.name)"
     15 GIT_EMAIL="$(git config user.email)"
     16 
     17 function updated {
     18     local FILE=$1
     19     if [[ $(grep "${VERSION}" "${FILE}") ]]; then
     20         echo "${FILE} already in ${VERSION}"
     21         return -1
     22     fi
     23 }
     24 
     25 set -x
     26 
     27 # update configure.ac
     28 function pyproject {
     29     updated pyproject.toml || return 0
     30 
     31     sed -i 's/version = .*/version = "'${VERSION}'"/' pyproject.toml
     32     echo "pyproject.toml ${VERSION}"
     33 }
     34 
     35 # update debian/changelog
     36 function debian_changelog {
     37     updated debian/changelog || return 0
     38 
     39     cat <<EOF > ./debian/changelog.tmp
     40 $PACKAGE (${VERSION}) unstable; urgency=low
     41 
     42   * Release ${VERSION}.
     43 
     44  -- ${GIT_USER} <${GIT_EMAIL}>  ${DATE}
     45 
     46 EOF
     47     cat ./debian/changelog >> ./debian/changelog.tmp
     48     mv ./debian/changelog.tmp ./debian/changelog
     49     echo "debian/changelog ${VERSION}"
     50 }
     51 
     52 pyproject
     53 debian_changelog