11.3
12.0
12.1
12.2
gimp3
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
xry111/for-12.3
xry111/llvm18
xry111/soup3
xry111/spidermonkey128
xry111/xf86-video-removal
Last change
on this file since 4e207bb was 4e207bb, checked in by Pierre Labastie <pierre.labastie@…>, 2 years ago |
Replace tabs with spaces (except in Makefile :)
|
-
Property mode
set to
100755
|
File size:
1.7 KB
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | if [ "$1" = sysv ]; then
|
---|
4 | SYSV="INCLUDE"
|
---|
5 | SYSTEMD="IGNORE "
|
---|
6 | elif [ "$1" = systemd ]; then
|
---|
7 | SYSV="IGNORE "
|
---|
8 | SYSTEMD="INCLUDE"
|
---|
9 | else
|
---|
10 | echo You must provide either \"sysv\" or \"systemd\" as argument
|
---|
11 | exit 1
|
---|
12 | fi
|
---|
13 |
|
---|
14 | echo "<!ENTITY % sysv \"$SYSV\">" > conditional.ent
|
---|
15 | echo "<!ENTITY % systemd \"$SYSTEMD\">" >> conditional.ent
|
---|
16 |
|
---|
17 | if ! git status > /dev/null; then
|
---|
18 | # Either it's not a git repository, or git is unavaliable.
|
---|
19 | # Just workaround.
|
---|
20 | echo "<!ENTITY year \"????\">" > version.ent
|
---|
21 | echo "<!ENTITY version \"unknown\">" >> version.ent
|
---|
22 | echo "<!ENTITY releasedate \"unknown\">" >> version.ent
|
---|
23 | echo "<!ENTITY pubdate \"unknown\">" >> version.ent
|
---|
24 | exit 0
|
---|
25 | fi
|
---|
26 |
|
---|
27 | export LC_ALL=en_US.utf8
|
---|
28 | export TZ=US/Pacific
|
---|
29 |
|
---|
30 | commit_date=$(git show -s --format=format:"%cd" --date=local)
|
---|
31 | short_date=$(date --date "$commit_date" "+%Y-%m-%d")
|
---|
32 |
|
---|
33 | year=$(date --date "$commit_date" "+%Y")
|
---|
34 | month=$(date --date "$commit_date" "+%B")
|
---|
35 | day_digit=$(date --date "$commit_date" "+%d")
|
---|
36 | day=$(echo $day_digit | sed 's/^0//')
|
---|
37 |
|
---|
38 | case $day in
|
---|
39 | "1" | "21" | "31" ) suffix="st";;
|
---|
40 | "2" | "22" ) suffix="nd";;
|
---|
41 | "3" | "23" ) suffix="rd";;
|
---|
42 | * ) suffix="th";;
|
---|
43 | esac
|
---|
44 |
|
---|
45 | full_date="$month $day$suffix, $year"
|
---|
46 |
|
---|
47 | sha="$(git describe --abbrev=1)"
|
---|
48 | version=$(echo "$sha" | sed 's/-g[^-]*$//')
|
---|
49 |
|
---|
50 | if [ "$(git diff HEAD | wc -l)" != "0" ]; then
|
---|
51 | version="$version+"
|
---|
52 | fi
|
---|
53 |
|
---|
54 | echo "<!ENTITY year \"$year\">" > version.ent
|
---|
55 | echo "<!ENTITY version \"$version\">" >> version.ent
|
---|
56 | echo "<!ENTITY releasedate \"$full_date\">" >> version.ent
|
---|
57 | echo "<!ENTITY pubdate \"$short_date\">" >> version.ent
|
---|
Note:
See
TracBrowser
for help on using the repository browser.