Inject the app version during the build

This commit is contained in:
Clement Lefebvre 2019-02-27 17:12:14 +00:00
parent 9e97c7d33b
commit dfa0758153
2 changed files with 11 additions and 4 deletions

11
debian/rules vendored
View File

@ -1,4 +1,13 @@
#!/usr/bin/make -f #!/usr/bin/make -f
DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
%: %:
dh ${@} --with python2 dh ${@} --with-python2
# Inject version number in the code
override_dh_installdeb:
dh_installdeb
for pkg in $$(dh_listpackages -i); do \
find debian/$$pkg -type f -exec sed -i -e s/__DEB_VERSION__/$(DEB_VERSION)/g {} +; \
done

View File

@ -679,9 +679,7 @@ class MenuWin( object ):
about = Gtk.AboutDialog() about = Gtk.AboutDialog()
about.set_name("mintMenu") about.set_name("mintMenu")
import commands about.set_version("__DEB_VERSION__")
version = commands.getoutput("/usr/lib/linuxmint/common/version.py mintmenu")
about.set_version(version)
try: try:
h = open('/usr/share/common-licenses/GPL','r') h = open('/usr/share/common-licenses/GPL','r')
s = h.readlines() s = h.readlines()