Thursday, September 23, 2021

Re: Errors in deluge port with python > 3.8

On 2021/09/23 12:58, rob.schmersel@bahnhof.se wrote:
> Hi,
>
> Deluge as packages is version 2.0.3 from about 2 years ago. Since
> switching to python 3.8 there are a number of errors popping up when
> running deluge-web:
>
> fatboy$ deluge-web
>
> Unable to initialize gettext/locale!
> 'ngettext'
> Traceback (most recent call last):
> File "/usr/local/lib/python3.8/site-packages/deluge/i18n/util.py",
> line 118, in setup_translation
> builtins.__dict__['_n'] = builtins.__dict__['ngettext']
> KeyError: 'ngettext'
>
> And one related to findCaller usage in log.py. Both of these have been
> solved for some time now in the develop branch
> (https://git.deluge-torrent.org/deluge/log/?h=develop). How would one go
> about updating the port in order to include this in the package (at the
> moment I'm manually updating after every pkg_add -u).
> Would one need to cherry pick the commits and add them as patches to
> the port?
> Or would it be easier/possible to pick a time in the
> develop branch to create a tarball to be stored somewhere and used in an
> updated port?
>
> BR/Rob
>

Simplest overall for OpenBSD and other OS packagers would be if upstream
would make a new release, then we can all just update to that.

Otherwise, it Looks like they're fairly simple fixes? (At least the
ngettext patch that Debian are using just adds [ ] in one line).
In which case it's probably best to just backport the particular fixes.
Here's roughly what you need to do:

- Checkout the ports tree if you haven't already

cd /usr/ports/net/deluge:
make patch
cd `make show=WRKSRC`
cp $file $file.orig (etc; i.e. backup all edited files)
vi deluge/i18n/util.py (etc; edit files as needed)
cd -
make update-patches
cvs add patches/patch-deluge_i18n_util_py (etc)
vi Makefile (increment REVISION; if you do this for another
port and there is no existing REVISION then add one, starting at 0)
cvs diff -uNp | tee /tmp/deluge.diff

Then mail that diff

No comments:

Post a Comment