#! /bin/bash

module="modxslt2--main--2.0"
config='./{arch}/++default-version'

test -f "$config" || {
  echo "couldn't find $config" 1>&2
  exit 1
}

archive=`sed -e s@/.*@@ < $config`
version=`sed -e s@.*/@@ < $config`

  # Ok, for which revisions do we need to generate a tla changelog
tla revisions | sed -ne "/`cat ./LAST_SNAPSHOT |sed -e 's/.*--//'`/{:a;n;p;ba}" |\
	sed -e "s/^/${version}--/" |tac|xargs -i sh -c "tla cat-log \"${archive}/{}\"|./tools/rep-changelog"
echo "${module}--`tla revisions |tail -n1`" >./LAST_SNAPSHOT
