Skip to content

Commit 606f66d

Browse files
committed
Determine app version based on the installed package
1 parent d8df8c2 commit 606f66d

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

build_package

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ APP_VERSION=$(sed -ne 's/\s*APP_VERSION\s*=\s*\x27\([^\x27]\+\)\x27.*/\1/p' "$SE
3737
echo "Building ${APP_NAME} version ${APP_VERSION} revision ${REVISION}..."
3838

3939
# Verify the changelog contains the appropriate line
40-
app_ver_string="${APP_NAME} (${APP_VERSION}-${REVISION})"
41-
(head -n 1 "debian/changelog" | grep -q "$app_ver_string") ||
42-
err "The changelog doesn't start with the entry '${app_ver_string}'"
40+
[[ "$(dpkg-parsechangelog -S version)" == "$APP_VERSION-$REVISION" ]] ||
41+
err "The changelog doesn't start with the entry for version $APP_VERSION-$REVISION"
4342

4443
# Initial cleanup: clean the dist dirs
4544
[[ ! -d "$DIST_ROOT_DIR" ]] || rm -rf "$DIST_ROOT_DIR" || err "Removing $DIST_ROOT_DIR failed"

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
indicator-sound-switcher (2.3.5.2-1) focal; urgency=low
2+
3+
* Determine app version based on the installed package
4+
5+
-- Dmitry Kann <[email protected]> Sun, 27 Dec 2020 20:25:24 +0200
6+
17
indicator-sound-switcher (2.3.5.1-1) focal; urgency=low
28

39
* No-change commit to address Launchpad failure

lib/indicator_sound_switcher/indicator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os.path
22
import logging
33
import time
4+
import pkg_resources
45

56
import gi
67

@@ -24,7 +25,6 @@
2425
# Global definitions
2526
APP_ID = 'indicator-sound-switcher'
2627
APP_NAME = 'Sound Switcher Indicator'
27-
APP_VERSION = '2.3.5'
2828
APP_LICENCE = """This program is free software: you can redistribute it and/or modify it
2929
under the terms of the GNU General Public License version 3, as published
3030
by the Free Software Foundation.
@@ -37,6 +37,9 @@
3737
You should have received a copy of the GNU General Public License along
3838
with this program. If not, see http://www.gnu.org/licenses/"""
3939

40+
# Determine app version
41+
APP_VERSION = pkg_resources.require(APP_ID)[0].version
42+
4043
YESNO = {False: 'No', True: 'Yes'}
4144

4245
CARD_NONE_SINK = -1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
APP_ID = 'indicator-sound-switcher'
9-
APP_VERSION = '2.3.5'
9+
APP_VERSION = '2.3.5.2'
1010

1111

1212
def compile_lang_files() -> list:

0 commit comments

Comments
 (0)