From dfa0758153a6d6f26708d9c1bc549933cbfcc344 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 | 4 +--- 2 files changed, 11 insertions(+), 4 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 2bb9678..1635c9c 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -679,9 +679,7 @@ class MenuWin( object ): about = Gtk.AboutDialog() about.set_name("mintMenu") - import commands - version = commands.getoutput("/usr/lib/linuxmint/common/version.py mintmenu") - about.set_version(version) + about.set_version("__DEB_VERSION__") try: h = open('/usr/share/common-licenses/GPL','r') s = h.readlines()