summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-05-29 14:36:37 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-05-31 20:33:43 +0200
commitec59cbba1e230c1fe6758c1c523af0e8a20b1c1e (patch)
tree31ca1d0104eee332363e4595bd1654568da88897
parentbotamusique: substitute version information (diff)
downloadnixpkgs-ec59cbba1e230c1fe6758c1c523af0e8a20b1c1e.tar.gz
botamusique: Backport fix for invalid version handling
(cherry picked from commit 5409925d9806d4270b23828d0c1a35eda749db5a)
-rw-r--r--pkgs/tools/audio/botamusique/catch-invalid-versions.patch24
-rw-r--r--pkgs/tools/audio/botamusique/default.nix6
2 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/tools/audio/botamusique/catch-invalid-versions.patch b/pkgs/tools/audio/botamusique/catch-invalid-versions.patch
new file mode 100644
index 000000000000..39b9aae8514c
--- /dev/null
+++ b/pkgs/tools/audio/botamusique/catch-invalid-versions.patch
@@ -0,0 +1,24 @@
+diff --git a/mumbleBot.py b/mumbleBot.py
+index 11bc480..7395f41 100644
+--- a/mumbleBot.py
++++ b/mumbleBot.py
+@@ -188,11 +188,14 @@ class MumbleBot:
+ th.start()
+
+ last_startup_version = var.db.get("bot", "version", fallback=None)
+- if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version):
+- var.db.set("bot", "version", self.version)
+- if var.config.getboolean("bot", "auto_check_update"):
+- changelog = util.fetch_changelog()
+- self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog))
++ try:
++ if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version):
++ var.db.set("bot", "version", self.version)
++ if var.config.getboolean("bot", "auto_check_update"):
++ changelog = util.fetch_changelog()
++ self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog))
++ except version.InvalidVersion:
++ pass
+
+ # Set the CTRL+C shortcut
+ def ctrl_caught(self, signal, frame):
diff --git a/pkgs/tools/audio/botamusique/default.nix b/pkgs/tools/audio/botamusique/default.nix
index 2288066b8229..5eaaa9c873e3 100644
--- a/pkgs/tools/audio/botamusique/default.nix
+++ b/pkgs/tools/audio/botamusique/default.nix
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
+, fetchpatch
, python3Packages
, ffmpeg
, makeWrapper
@@ -53,6 +54,11 @@ stdenv.mkDerivation rec {
# We can't update the package at runtime with NixOS, so this patch makes
# the !update command mention that
./no-runtime-update.patch
+
+ # Fix passing of invalid "git" version into version.parse, which results
+ # in an InvalidVersion exception. The upstream fix is insufficient, so
+ # we carry the correct patch downstream for now.
+ ./catch-invalid-versions.patch
];
postPatch = ''