mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-23 22:42:14 +08:00
git-version: Don't dump revision if no "important files" are changed
If an important file is changed, we regenerate version.ent and so bump the revision. Otherwise, version.ent may be kept. Hack git-version.sh so we can ensure version.ent is really not changed. Add Makefile itself and git-version.sh into the important file list as they can definitely affect book rendering.
This commit is contained in:
parent
05d5b11202
commit
4653242e25
4
Makefile
4
Makefile
@ -284,8 +284,8 @@ ifneq ($(REV), $(PREVREV))
|
||||
.PHONY: version.ent
|
||||
endif
|
||||
|
||||
version.ent: general.ent packages.ent gnome.ent $(ALLXML) $(ALLXSL)
|
||||
$(Q)./git-version.sh $(REV)
|
||||
version.ent: git-version.sh general.ent packages.ent gnome.ent $(ALLXML) $(ALLXSL) Makefile
|
||||
$(Q)./$< $(REV) $^
|
||||
|
||||
#ALL_PYTHON_DEPS := $(filter-out $(PYHOSTED), \
|
||||
# $(wildcard general/prog/python-dependencies/*.xml))
|
||||
|
@ -11,6 +11,8 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shift 1
|
||||
|
||||
echo "<!ENTITY % sysv \"$SYSV\">" > conditional.ent
|
||||
echo "<!ENTITY % systemd \"$SYSTEMD\">" >> conditional.ent
|
||||
|
||||
@ -27,7 +29,8 @@ fi
|
||||
export LC_ALL=en_US.utf8
|
||||
export TZ=America/Chicago
|
||||
|
||||
commit_date=$(git show -s --format=format:"%cd" --date=local)
|
||||
sha=$(git log -s --format=format:"%H" --date=local -1 $*)
|
||||
commit_date=$(git log -s --format=format:"%cd" --date=local -1 $*)
|
||||
short_date=$(date --date "$commit_date" "+%Y-%m-%d")
|
||||
|
||||
year=$(date --date "$commit_date" "+%Y")
|
||||
@ -44,13 +47,9 @@ esac
|
||||
|
||||
full_date="$month $day$suffix, $year"
|
||||
|
||||
sha="$(git describe --abbrev=1)"
|
||||
sha="$(git describe --abbrev=1 $sha)"
|
||||
version=$(echo "$sha" | sed 's/-g[^-]*$//')
|
||||
|
||||
if [ "$(git diff HEAD | wc -l)" != "0" ]; then
|
||||
version="$version+"
|
||||
fi
|
||||
|
||||
echo "<!ENTITY year \"$year\">" > version.ent
|
||||
echo "<!ENTITY version \"$version\">" >> version.ent
|
||||
echo "<!ENTITY releasedate \"$full_date\">" >> version.ent
|
||||
|
Loading…
Reference in New Issue
Block a user