aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2020-08-16 20:02:09 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2020-08-16 20:04:27 +0200
commitff9f211474a48da950a23d4c11d82640b42265be (patch)
tree9b43ff07aaddded5121f5cb29b579fc11cdb607e
parente7cfb9da35d40f9a05eaf01a8c818ab77e119997 (diff)
downloadaports-ff9f211474a48da950a23d4c11d82640b42265be.tar.gz
aports-ff9f211474a48da950a23d4c11d82640b42265be.tar.bz2
aports-ff9f211474a48da950a23d4c11d82640b42265be.tar.xz
community/beets: fix compatibility with current python
See: https://github.com/beetbox/beets/pull/3621
-rw-r--r--community/beets/0001-compatibility-with-breaking-changes-to-the-ast-modul.patch52
-rw-r--r--community/beets/APKBUILD8
2 files changed, 57 insertions, 3 deletions
diff --git a/community/beets/0001-compatibility-with-breaking-changes-to-the-ast-modul.patch b/community/beets/0001-compatibility-with-breaking-changes-to-the-ast-modul.patch
new file mode 100644
index 0000000000..75c0dcab49
--- /dev/null
+++ b/community/beets/0001-compatibility-with-breaking-changes-to-the-ast-modul.patch
@@ -0,0 +1,52 @@
+From dab0c1f9abda5b17cc7488f89a6fe08be7bc56a0 Mon Sep 17 00:00:00 2001
+From: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com>
+Date: Tue, 9 Jun 2020 19:34:31 +0200
+Subject: [PATCH] compatibility with breaking changes to the ast module
+
+new in 3.10, also backported to 3.8 and 3.9: https://github.com/python/cpython/pull/20649
+In fact, our generation of some Literals has been invalid since Python
+3.4, fix that too.
+---
+ beets/util/functemplate.py | 29 ++++++++++++++++++++---------
+ 1 file changed, 20 insertions(+), 9 deletions(-)
+
+diff --git a/beets/util/functemplate.py b/beets/util/functemplate.py
+index af22b790..266534a9 100644
+--- a/beets/util/functemplate.py
++++ b/beets/util/functemplate.py
+@@ -73,15 +73,26 @@ def ex_literal(val):
+ """An int, float, long, bool, string, or None literal with the given
+ value.
+ """
+- if val is None:
+- return ast.Name('None', ast.Load())
+- elif isinstance(val, six.integer_types):
+- return ast.Num(val)
+- elif isinstance(val, bool):
+- return ast.Name(bytes(val), ast.Load())
+- elif isinstance(val, six.string_types):
+- return ast.Str(val)
+- raise TypeError(u'no literal for {0}'.format(type(val)))
++ if sys.version_info[:2] < (3, 4):
++ if val is None:
++ return ast.Name('None', ast.Load())
++ elif isinstance(val, six.integer_types):
++ return ast.Num(val)
++ elif isinstance(val, bool):
++ return ast.Name(bytes(val), ast.Load())
++ elif isinstance(val, six.string_types):
++ return ast.Str(val)
++ raise TypeError(u'no literal for {0}'.format(type(val)))
++ elif sys.version_info[:2] < (3, 6):
++ if val in [None, True, False]:
++ return ast.NameConstant(val)
++ elif isinstance(val, six.integer_types):
++ return ast.Num(val)
++ elif isinstance(val, six.string_types):
++ return ast.Str(val)
++ raise TypeError(u'no literal for {0}'.format(type(val)))
++ else:
++ return ast.Constant(val)
+
+
+ def ex_varassign(name, expr):
diff --git a/community/beets/APKBUILD b/community/beets/APKBUILD
index f5ed902383..26e2475ed9 100644
--- a/community/beets/APKBUILD
+++ b/community/beets/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=beets
pkgver=1.4.9
-pkgrel=3
+pkgrel=4
pkgdesc="Music library manager and MusicBrainz tagger"
options="!check" # Requires unpackaged dependencies
url="https://beets.io"
@@ -14,7 +14,8 @@ makedepends="py3-sphinx"
depends="python3 py3-mutagen py3-unidecode py3-musicbrainzngs py3-munkres
py3-setuptools py3-yaml py3-jellyfish py3-six"
source="https://github.com/sampsyo/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz
- 0001-Try-to-work-around-a-Werkzeug-change.patch"
+ 0001-Try-to-work-around-a-Werkzeug-change.patch
+ 0001-compatibility-with-breaking-changes-to-the-ast-modul.patch"
build() {
# sdist := source distribution tarball, builds man pages
@@ -32,4 +33,5 @@ package() {
}
sha512sums="616bad4ca3ecdd05d2f59846fd67215f476ce89cc34d63bc6351efcbaf1e33e5ca783cb8a716e8597b56a7e08e6a6dc15e64b51e89dd786bfb6c5d847f66de5a beets-1.4.9.tar.gz
-7f2669345ef89a4f2cd8688f9e3a11d208ebebf2f44e684bf29f1f1f5102d08bdd8707e6df46a311843a86c5aa074b769420f07af7460e69bcb2d149bde933a7 0001-Try-to-work-around-a-Werkzeug-change.patch"
+7f2669345ef89a4f2cd8688f9e3a11d208ebebf2f44e684bf29f1f1f5102d08bdd8707e6df46a311843a86c5aa074b769420f07af7460e69bcb2d149bde933a7 0001-Try-to-work-around-a-Werkzeug-change.patch
+3fae29258adce039748dd87c66773cc1ec240b5bc32c7268de379d1c58b833b134fc159aa4de38382d3ab0a77d08bb237c976b273e6a1f6523c13cfc1ec9ad89 0001-compatibility-with-breaking-changes-to-the-ast-modul.patch"