Inject the app version during the build

This commit is contained in:
Clement Lefebvre 2019-02-27 17:12:14 +00:00
parent cd43e2e9b9
commit c293d485d9
2 changed files with 11 additions and 5 deletions

11
debian/rules vendored
View File

@ -1,4 +1,13 @@
#!/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

@ -672,10 +672,7 @@ class MenuWin(object):
def showAboutDialog(self, action, userdata = None):
about = Gtk.AboutDialog()
about.set_name("mintMenu")
import subprocess
(stdout, stderr) = subprocess.Popen(["/usr/lib/python3/dist-packages/mintcommon/version.py", "mintmenu"],
stdout=subprocess.PIPE).communicate()
about.set_version(stdout.strip())
about.set_version("__DEB_VERSION__")
try:
gpl = open('/usr/share/common-licenses/GPL','r').read()
about.set_license(gpl)