Gentoo Archives: gentoo-commits

From: Rafael Martins <rafaelmartins@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/blohg/files/, www-apps/blohg/
Date: Tue, 10 Mar 2020 22:17:07
Message-Id: 1583878615.995c8c25b4f3d9cd488e744b9b6b99d019facb13.rafaelmartins@gentoo
1 commit: 995c8c25b4f3d9cd488e744b9b6b99d019facb13
2 Author: Rafael Martins <rafaelmartins <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 10 22:16:32 2020 +0000
4 Commit: Rafael Martins <rafaelmartins <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 10 22:16:55 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=995c8c25
7
8 www-apps/blohg: port to python 3 (bug #702226)
9
10 Package-Manager: Portage-2.3.79, Repoman-2.3.16
11 Signed-off-by: Rafael Martins <rafaelmartins <AT> gentoo.org>
12
13 www-apps/blohg/Manifest | 1 +
14 .../{blohg-0.13-r3.ebuild => blohg-0.13-r4.ebuild} | 48 ++++++++++------------
15 www-apps/blohg/blohg-9999.ebuild | 46 ++++++++++-----------
16 www-apps/blohg/files/use-recent-libgit2.patch | 17 --------
17 4 files changed, 43 insertions(+), 69 deletions(-)
18
19 diff --git a/www-apps/blohg/Manifest b/www-apps/blohg/Manifest
20 index fa6fb11b357..8d8bcd4e9d7 100644
21 --- a/www-apps/blohg/Manifest
22 +++ b/www-apps/blohg/Manifest
23 @@ -1 +1,2 @@
24 DIST blohg-0.13.tar.gz 75003 BLAKE2B 6b9760ffa99ca85a40e35c81341e395fdfc00256f5e80091c6883e54f050d4cf3f345c4752b635b1297d15e0055c182e00e74165451d695bb396c869c285646f SHA512 de8643e85e3f72827408d726bbe2f8674dcc6dcf1efdc47d33a934892071f8365cb54e63a6adb803361c7fd04032b2ac4e786c442676e8a8132b6d3221696865
25 +DIST blohg-patches-0.13-r4.tar.xz 14960 BLAKE2B 31458f412395000a05b359db25e8af648c54e554a3b3216f6c62355fd7203fc19c4452defe7692d0382653563f7b0565395af4ceb2177cc8e6de1d7e1a3c7b41 SHA512 3f709880bdd1826b74982866931f5002fdda451a205b6c278a9869979314413f37c8bf6400e3064a463f2fd34810e22d0d4cd5dfc89786f9e276dd9bd9fe5ec2
26
27 diff --git a/www-apps/blohg/blohg-0.13-r3.ebuild b/www-apps/blohg/blohg-0.13-r4.ebuild
28 similarity index 56%
29 rename from www-apps/blohg/blohg-0.13-r3.ebuild
30 rename to www-apps/blohg/blohg-0.13-r4.ebuild
31 index f30c7c0ad0b..6a4abc9a54f 100644
32 --- a/www-apps/blohg/blohg-0.13-r3.ebuild
33 +++ b/www-apps/blohg/blohg-0.13-r4.ebuild
34 @@ -1,9 +1,9 @@
35 -# Copyright 1999-2019 Gentoo Authors
36 +# Copyright 1999-2020 Gentoo Authors
37 # Distributed under the terms of the GNU General Public License v2
38
39 -EAPI=6
40 +EAPI=7
41
42 -PYTHON_COMPAT=( python2_7 )
43 +PYTHON_COMPAT=( python3_6 )
44
45 GIT_ECLASS=""
46 if [[ ${PV} = *9999* ]]; then
47 @@ -16,7 +16,8 @@ inherit distutils-r1 ${GIT_ECLASS}
48 DESCRIPTION="A Mercurial (or Git) based blogging engine"
49 HOMEPAGE="https://github.com/rafaelmartins/blohg"
50
51 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
52 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
53 + https://dev.gentoo.org/~rafaelmartins/distfiles/${PN}-patches-${PVR}.tar.xz"
54 KEYWORDS="~amd64 ~x86"
55 if [[ ${PV} = *9999* ]]; then
56 SRC_URI=""
57 @@ -32,27 +33,28 @@ REQUIRED_USE="|| ( git mercurial )
58 test? ( git mercurial )"
59
60 RDEPEND="
61 - >=dev-python/click-2.0
62 - >=dev-python/docutils-0.11
63 - >=dev-python/flask-0.10.1
64 - >=dev-python/flask-babel-0.7
65 - >=dev-python/frozen-flask-0.7
66 - >=dev-python/jinja-2.5.2
67 - dev-python/pyyaml
68 - dev-python/setuptools
69 - dev-python/pygments
70 - git? ( >=dev-python/pygit2-0.21.3 )
71 - mercurial? ( >=dev-vcs/mercurial-1.6 )"
72 + dev-python/click[${PYTHON_USEDEP}]
73 + dev-python/docutils[${PYTHON_USEDEP}]
74 + dev-python/feedgenerator[${PYTHON_USEDEP}]
75 + dev-python/flask[${PYTHON_USEDEP}]
76 + dev-python/flask-babel[${PYTHON_USEDEP}]
77 + dev-python/frozen-flask[${PYTHON_USEDEP}]
78 + dev-python/jinja[${PYTHON_USEDEP}]
79 + dev-python/pyyaml[${PYTHON_USEDEP}]
80 + dev-python/pygments[${PYTHON_USEDEP}]
81 + git? ( dev-python/pygit2[${PYTHON_USEDEP}] )
82 + mercurial? ( >=dev-vcs/mercurial-5.2[${PYTHON_USEDEP}] )"
83
84 DEPEND="${RDEPEND}
85 - doc? ( dev-python/sphinx )
86 - test? ( dev-python/mock )"
87 + doc? ( dev-python/sphinx )"
88
89 python_prepare_all() {
90 + if [[ ${PV} != *9999* ]]; then
91 + eapply "${WORKDIR}/${PN}-patches-${PVR}"
92 + fi
93 +
94 if ! use git; then
95 rm -rf blohg/vcs_backends/git || die 'rm failed'
96 - else
97 - local PATCHES=( "${FILESDIR}/use-recent-libgit2.patch" )
98 fi
99
100 if ! use mercurial; then
101 @@ -74,11 +76,3 @@ python_install_all() {
102 python_test() {
103 esetup.py test
104 }
105 -
106 -pkg_postinst() {
107 - local ver="${PV}"
108 - [[ ${PV} = *9999* ]] && ver="latest"
109 -
110 - elog "You may want to check the upgrade notes:"
111 - elog "http://docs.blohg.org/en/${ver}/upgrade/"
112 -}
113
114 diff --git a/www-apps/blohg/blohg-9999.ebuild b/www-apps/blohg/blohg-9999.ebuild
115 index 03b42c18276..6a4abc9a54f 100644
116 --- a/www-apps/blohg/blohg-9999.ebuild
117 +++ b/www-apps/blohg/blohg-9999.ebuild
118 @@ -1,9 +1,9 @@
119 -# Copyright 1999-2019 Gentoo Authors
120 +# Copyright 1999-2020 Gentoo Authors
121 # Distributed under the terms of the GNU General Public License v2
122
123 -EAPI=5
124 +EAPI=7
125
126 -PYTHON_COMPAT=( python2_7 )
127 +PYTHON_COMPAT=( python3_6 )
128
129 GIT_ECLASS=""
130 if [[ ${PV} = *9999* ]]; then
131 @@ -16,7 +16,8 @@ inherit distutils-r1 ${GIT_ECLASS}
132 DESCRIPTION="A Mercurial (or Git) based blogging engine"
133 HOMEPAGE="https://github.com/rafaelmartins/blohg"
134
135 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
136 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
137 + https://dev.gentoo.org/~rafaelmartins/distfiles/${PN}-patches-${PVR}.tar.xz"
138 KEYWORDS="~amd64 ~x86"
139 if [[ ${PV} = *9999* ]]; then
140 SRC_URI=""
141 @@ -32,23 +33,26 @@ REQUIRED_USE="|| ( git mercurial )
142 test? ( git mercurial )"
143
144 RDEPEND="
145 - >=dev-python/click-2.0
146 - >=dev-python/docutils-0.11
147 - >=dev-python/flask-0.10.1
148 - >=dev-python/flask-babel-0.7
149 - >=dev-python/frozen-flask-0.7
150 - >=dev-python/jinja-2.5.2
151 - dev-python/pyyaml
152 - dev-python/setuptools
153 - dev-python/pygments
154 - git? ( >=dev-python/pygit2-0.21.3 )
155 - mercurial? ( >=dev-vcs/mercurial-1.6 )"
156 + dev-python/click[${PYTHON_USEDEP}]
157 + dev-python/docutils[${PYTHON_USEDEP}]
158 + dev-python/feedgenerator[${PYTHON_USEDEP}]
159 + dev-python/flask[${PYTHON_USEDEP}]
160 + dev-python/flask-babel[${PYTHON_USEDEP}]
161 + dev-python/frozen-flask[${PYTHON_USEDEP}]
162 + dev-python/jinja[${PYTHON_USEDEP}]
163 + dev-python/pyyaml[${PYTHON_USEDEP}]
164 + dev-python/pygments[${PYTHON_USEDEP}]
165 + git? ( dev-python/pygit2[${PYTHON_USEDEP}] )
166 + mercurial? ( >=dev-vcs/mercurial-5.2[${PYTHON_USEDEP}] )"
167
168 DEPEND="${RDEPEND}
169 - doc? ( dev-python/sphinx )
170 - test? ( dev-python/mock )"
171 + doc? ( dev-python/sphinx )"
172
173 python_prepare_all() {
174 + if [[ ${PV} != *9999* ]]; then
175 + eapply "${WORKDIR}/${PN}-patches-${PVR}"
176 + fi
177 +
178 if ! use git; then
179 rm -rf blohg/vcs_backends/git || die 'rm failed'
180 fi
181 @@ -72,11 +76,3 @@ python_install_all() {
182 python_test() {
183 esetup.py test
184 }
185 -
186 -pkg_postinst() {
187 - local ver="${PV}"
188 - [[ ${PV} = *9999* ]] && ver="latest"
189 -
190 - elog "You may want to check the upgrade notes:"
191 - elog "http://docs.blohg.org/en/${ver}/upgrade/"
192 -}
193
194 diff --git a/www-apps/blohg/files/use-recent-libgit2.patch b/www-apps/blohg/files/use-recent-libgit2.patch
195 deleted file mode 100644
196 index decd01b78fb..00000000000
197 --- a/www-apps/blohg/files/use-recent-libgit2.patch
198 +++ /dev/null
199 @@ -1,17 +0,0 @@
200 -diff --git a/blohg/vcs_backends/git/filectx.py b/blohg/vcs_backends/git/filectx.py
201 -index 84f7aa3..5e20762 100644
202 ---- a/blohg/vcs_backends/git/filectx.py
203 -+++ b/blohg/vcs_backends/git/filectx.py
204 -@@ -73,7 +73,11 @@ def _last_changeset(self):
205 - GIT_SORT_TIME):
206 - diff = self._repo.diff(head, commit)
207 - for patch in diff:
208 -- if patch.new_file_path == self._path:
209 -+ try:
210 -+ new_file_path = patch.delta.new_file.path
211 -+ except AttributeError:
212 -+ new_file_path = patch.new_file_path
213 -+ if new_file_path == self._path:
214 - return head
215 - head = commit
216 -