Changeset ca5e52a


Ignore:
Timestamp:
05/01/2021 02:07:11 PM (3 months ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
trunk
Children:
9d0684c
Parents:
4a570af
Message:

git-version: simplify version number

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • book/bookinfo.xml

    r4a570af rca5e52a  
    4848  <revhistory>
    4949    <revision>
    50       <revnumber>&short-version;</revnumber>
     50      <revnumber>&version;</revnumber>
    5151      <date>&pubdate;</date>
    5252      <revremark>Ongoing Release</revremark>
  • general.ent

    r4a570af rca5e52a  
    1414<!ENTITY releasedate    "September 1st, &year;">
    1515<!ENTITY pubdate        "&year;-&month;-&day;">
    16 <!ENTITY short-version "&version;">
    1716-->
    1817
  • git-version.sh

    r4a570af rca5e52a  
    3232full_date="$month $day$suffix, $year"
    3333
    34 sha="g$(git describe --always)"
    35 version="$short_date-$sha"
     34sha="$(git describe --abbrev=1)"
     35if git describe --all --match trunk > /dev/null 2> /dev/null; then
     36        sha=$(echo "$sha" | sed 's/-g[^-]*$//')
     37fi
     38version="$sha"
    3639
    3740if [ "$(git diff HEAD | wc -l)" != "0" ]; then
    38         version="$version-MODIFIED"
     41        version="$version+"
    3942fi
    4043
     
    4447echo "<!ENTITY copyrightdate     \"2001-$year\">"          >> version.ent
    4548echo "<!ENTITY version           \"$version\">"            >> version.ent
    46 echo "<!ENTITY short-version     \"$sha\">"                >> version.ent
    4749echo "<!ENTITY releasedate       \"$full_date\">"          >> version.ent
    4850echo "<!ENTITY pubdate           \"$short_date\">"         >> version.ent
Note: See TracChangeset for help on using the changeset viewer.