Merge pull request #234795 from mweinelt/botamusique-version-backport

botamusique: Backport fix for invalid version handling

authored by Martin Weinelt and committed by GitHub 5c4e4cd0 8b4cc62c

+30
+24
pkgs/tools/audio/botamusique/catch-invalid-versions.patch
··· 1 + diff --git a/mumbleBot.py b/mumbleBot.py 2 + index 11bc480..7395f41 100644 3 + --- a/mumbleBot.py 4 + +++ b/mumbleBot.py 5 + @@ -188,11 +188,14 @@ class MumbleBot: 6 + th.start() 7 + 8 + last_startup_version = var.db.get("bot", "version", fallback=None) 9 + - if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version): 10 + - var.db.set("bot", "version", self.version) 11 + - if var.config.getboolean("bot", "auto_check_update"): 12 + - changelog = util.fetch_changelog() 13 + - self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog)) 14 + + try: 15 + + if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version): 16 + + var.db.set("bot", "version", self.version) 17 + + if var.config.getboolean("bot", "auto_check_update"): 18 + + changelog = util.fetch_changelog() 19 + + self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog)) 20 + + except version.InvalidVersion: 21 + + pass 22 + 23 + # Set the CTRL+C shortcut 24 + def ctrl_caught(self, signal, frame):
+6
pkgs/tools/audio/botamusique/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchFromGitHub 4 + , fetchpatch 4 5 , python3Packages 5 6 , ffmpeg 6 7 , makeWrapper ··· 53 54 # We can't update the package at runtime with NixOS, so this patch makes 54 55 # the !update command mention that 55 56 ./no-runtime-update.patch 57 + 58 + # Fix passing of invalid "git" version into version.parse, which results 59 + # in an InvalidVersion exception. The upstream fix is insufficient, so 60 + # we carry the correct patch downstream for now. 61 + ./catch-invalid-versions.patch 56 62 ]; 57 63 58 64 postPatch = ''