@ -4,7 +4,7 @@ DIRNAME=$(dirname $(readlink -f $0))
DESCRIBE = $( readlink -f ${ DIRNAME } /git_describe.sh)
DESCRIBE = $( readlink -f ${ DIRNAME } /git_describe.sh)
function usage {
function usage {
echo " $( basename $0 ) [-h|--help] [-f|--format <format>] [ tag-prefix]"
echo " $( basename $0 ) [-h|--help] [-f|--format <format>] [ -u|--url <url>] [ tag-prefix]"
echo ""
echo ""
echo "Arguments:"
echo "Arguments:"
echo " -h|--help Print this usage message and exit."
echo " -h|--help Print this usage message and exit."
@ -14,6 +14,8 @@ function usage {
echo " dxy Release notes for Doxygen"
echo " dxy Release notes for Doxygen"
echo " html Release notes for HTML"
echo " html Release notes for HTML"
echo " -p|--pre Include latest pre-release."
echo " -p|--pre Include latest pre-release."
echo " -u|--url <url> Add url attribute to each release:"
echo " Placeholders are TAG, VERSION, DATE."
echo " tag-prefix Prefix to filter tags."
echo " tag-prefix Prefix to filter tags."
echo ""
echo ""
}
}
@ -41,11 +43,14 @@ function print_pdsc_head {
}
}
function print_pdsc {
function print_pdsc {
if [ -z " $2 " ] ; then
echo -n " <release version=\" $1 \" "
echo " <release version=\" $1 \"> "
if [ -n " $2 " ] ; then
else
echo -n " date=\" $2 \" "
echo " <release version=\" $1 \" date=\" $2 \"> "
fi
fi
if [ -n " $4 " ] ; then
echo -n " url=\" $4 \" "
fi
echo ">"
echo -e " $3 " | \
echo -e " $3 " | \
sed "s/^/ /" | \
sed "s/^/ /" | \
sed "s/<br>//" | \
sed "s/<br>//" | \
@ -108,6 +113,7 @@ function print_html_tail {
POSITIONAL = ( )
POSITIONAL = ( )
FORMAT = "text"
FORMAT = "text"
PRERELEASE = 0
PRERELEASE = 0
URL = ""
while [ [ $# -gt 0 ] ]
while [ [ $# -gt 0 ] ]
do
do
key = " $1 "
key = " $1 "
@ -126,6 +132,11 @@ do
PRERELEASE = 1
PRERELEASE = 1
shift
shift
; ;
; ;
'-u' | '--url' )
shift
URL = $1
shift
; ;
*) # unknown option
*) # unknown option
POSITIONAL += ( " $1 " ) # save it in an array for later
POSITIONAL += ( " $1 " ) # save it in an array for later
shift # past argument
shift # past argument
@ -151,9 +162,13 @@ fi
for TAG in $TAGS ; do
for TAG in $TAGS ; do
TAG = " ${ TAG #refs/tags/ } "
TAG = " ${ TAG #refs/tags/ } "
VERSION = " ${ TAG # ${ PREFIX } } "
DESC = $( git tag -l -n99 --format "%(contents)" ${ TAG } 2>/dev/null)
DESC = $( git tag -l -n99 --format "%(contents)" ${ TAG } 2>/dev/null)
DATE = $( git tag -l -n99 --format "%(taggerdate:short)" ${ TAG } 2>/dev/null)
DATE = $( git tag -l -n99 --format "%(taggerdate:short)" ${ TAG } 2>/dev/null)
print_$FORMAT " ${ TAG # ${ PREFIX } } " " ${ DATE } " " ${ DESC } "
if [ -n " $URL " ] ; then
DLURL = $( TAG = $TAG VERSION = $VERSION DATE = $DATE envsubst <<< $URL )
fi
print_$FORMAT " ${ VERSION } " " ${ DATE } " " ${ DESC } " " ${ DLURL } "
done
done
print_${ FORMAT } _tail
print_${ FORMAT } _tail