Changeset ca5e52a for git-version.sh


Ignore:
Timestamp:
05/01/2021 02:07:11 PM (3 years ago)
Author:
Xi Ruoyao <xry111@…>
Branches:
11.0, 11.1, 11.2, 11.3, 12.0, 12.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
9d0684c
Parents:
4a570af1
Message:

git-version: simplify version number

File:
1 edited

Legend:

Unmodified
Added
Removed
  • git-version.sh

    r4a570af1 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.