From c293d485d9a76162c07da177299aec981197e0f4 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Wed, 27 Feb 2019 17:12:14 +0000 Subject: [PATCH] Inject the app version during the build --- debian/rules | 11 ++++++++++- usr/lib/linuxmint/mintMenu/mintMenu.py | 5 +---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/debian/rules b/debian/rules index c215171..0751f93 100755 --- a/debian/rules +++ b/debian/rules @@ -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 diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index cfba891..daf7b9a 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -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)