summaryrefslogtreecommitdiff
path: root/tag
blob: be7f3e489958849f1289aa16b30f227bb0e0331d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /usr/bin/env bash

# Tag build2 distribution.
#
# Usage: tag [-t]
#
# -t
#    Toolchain only.
#
usage="usage: $0 [-t]"

owd=`pwd`
trap "{ cd $owd; exit 1; }" ERR
set -o errtrace # Trap in functions.

function info () { echo "$*" 1>&2; }
function error () { info "$*"; exit 1; }

toolchain="libbutl build2 libbpkg bpkg build2-toolchain"
extras="brep"

while [ $# -gt 0 ]; do
  case $1 in
    -t)
      extra=
      shift
      ;;
    *)
      error "unexpected $1"
      ;;
  esac
done

tools="$toolchain $extras"

for t in $tools; do
  v=`cat $t/version`
  if [ -z "$v" ]; then
    error "unable to extract version from $t/version"
  fi
  git -C $t tag -a $v -m "Tag version $v"
  info "tagged $t $v"
done

info "remember to push"