Skip to content

Commit

Permalink
Determine app version based on the installed package
Browse files Browse the repository at this point in the history
  • Loading branch information
yktoo committed Dec 27, 2020
1 parent d8df8c2 commit 606f66d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
5 changes: 2 additions & 3 deletions build_package
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ APP_VERSION=$(sed -ne 's/\s*APP_VERSION\s*=\s*\x27\([^\x27]\+\)\x27.*/\1/p' "$SE
echo "Building ${APP_NAME} version ${APP_VERSION} revision ${REVISION}..."

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

# Initial cleanup: clean the dist dirs
[[ ! -d "$DIST_ROOT_DIR" ]] || rm -rf "$DIST_ROOT_DIR" || err "Removing $DIST_ROOT_DIR failed"
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
indicator-sound-switcher (2.3.5.2-1) focal; urgency=low

* Determine app version based on the installed package

-- Dmitry Kann <yktooo@gmail.com> Sun, 27 Dec 2020 20:25:24 +0200

indicator-sound-switcher (2.3.5.1-1) focal; urgency=low

* No-change commit to address Launchpad failure
Expand Down
5 changes: 4 additions & 1 deletion lib/indicator_sound_switcher/indicator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os.path
import logging
import time
import pkg_resources

import gi

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

# Determine app version
APP_VERSION = pkg_resources.require(APP_ID)[0].version

YESNO = {False: 'No', True: 'Yes'}

CARD_NONE_SINK = -1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


APP_ID = 'indicator-sound-switcher'
APP_VERSION = '2.3.5'
APP_VERSION = '2.3.5.2'


def compile_lang_files() -> list:
Expand Down

0 comments on commit 606f66d

Please # to comment.