pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/ruby-redmine50



Module Name:    pkgsrc
Committed By:   triaxx
Date:           Wed May 24 18:21:20 UTC 2023

Modified Files:
        pkgsrc/devel/ruby-redmine50: Makefile distinfo
Added Files:
        pkgsrc/devel/ruby-redmine50/patches:
            patch-lib_redmine_scm_adapters_mercurial_redminehelper.py

Log Message:
ruby-redmine: Fix PR pkg/57432

pkgsrc changes:
---------------
  * Add patch to update Mercurial helper to work with Python 3 (from
    https://www.redmine.org/issues/33784).
  * Add dependency on lang/python.
  * Make incompatible with python 27.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 pkgsrc/devel/ruby-redmine50/Makefile
cvs rdiff -u -r1.7 -r1.8 pkgsrc/devel/ruby-redmine50/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/ruby-redmine50/patches/patch-lib_redmine_scm_adapters_mercurial_redminehelper.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/ruby-redmine50/Makefile
diff -u pkgsrc/devel/ruby-redmine50/Makefile:1.11 pkgsrc/devel/ruby-redmine50/Makefile:1.12
--- pkgsrc/devel/ruby-redmine50/Makefile:1.11   Thu Apr 27 13:56:06 2023
+++ pkgsrc/devel/ruby-redmine50/Makefile        Wed May 24 18:21:20 2023
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.11 2023/04/27 13:56:06 taca Exp $
+# $NetBSD: Makefile,v 1.12 2023/05/24 18:21:20 triaxx Exp $
 
 DISTNAME=      redmine-${RM_VERSION}
 PKGNAME=       ${RUBY_PKGPREFIX}-${DISTNAME:S/redmine/redmine${RM_VER}/}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    devel
 MASTER_SITES=  https://www.redmine.org/releases/
 
@@ -19,6 +19,8 @@ RUBY_VERSIONS_ACCEPTED=       27 30 31
 
 RUBY_RAILS_ACCEPTED=   61
 
+PYTHON_VERSIONS_INCOMPATIBLE=  27
+
 OVERRIDE_GEMSPEC+=     mini-magick>=4.11.0 nokogiri>=1.13.4
 
 #DEPENDS+=     ${RUBY_PKGPREFIX}-bundler>=1.12.0:../../misc/ruby-bundler
@@ -114,4 +116,5 @@ post-install: unicorn-post-install
                ${DESTDIR}/${EGDIR}
 
 .include "../../devel/ruby-redmine/redmine.mk"
+.include "../../lang/python/pyversion.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/devel/ruby-redmine50/distinfo
diff -u pkgsrc/devel/ruby-redmine50/distinfo:1.7 pkgsrc/devel/ruby-redmine50/distinfo:1.8
--- pkgsrc/devel/ruby-redmine50/distinfo:1.7    Thu Apr 27 13:56:06 2023
+++ pkgsrc/devel/ruby-redmine50/distinfo        Wed May 24 18:21:20 2023
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.7 2023/04/27 13:56:06 taca Exp $
+$NetBSD: distinfo,v 1.8 2023/05/24 18:21:20 triaxx Exp $
 
 BLAKE2s (redmine-5.0.5.tar.gz) = d467f73578fcf9587b638c18f2304c31f6ba6f4e50190fb1846c6d8e3d9df8e7
 SHA512 (redmine-5.0.5.tar.gz) = 95b7926008ac3ed53b091a05793ad2372a5e9a5194629811f3cefe38c3b550971f0eb424fb5f7eb9fec0c014632c694d90859945544cadae987f7ddff31d6ce4
 Size (redmine-5.0.5.tar.gz) = 3115940 bytes
 SHA1 (patch-Gemfile) = 46c2c2f56ff5a547ac6656f832d8efb58b06bc8c
 SHA1 (patch-config_additional__environment.rb.example) = 7ad913800c5f31fdd9b71aa92294bdbeea7b77fe
+SHA1 (patch-lib_redmine_scm_adapters_mercurial_redminehelper.py) = 87db1005896b2a962b8b93ec5b5b7d313ae6f691
 SHA1 (patch-lib_tasks_initializers.rake) = 73c4594c94abd28e628bbd172565b161f0e54fff

Added files:

Index: pkgsrc/devel/ruby-redmine50/patches/patch-lib_redmine_scm_adapters_mercurial_redminehelper.py
diff -u /dev/null pkgsrc/devel/ruby-redmine50/patches/patch-lib_redmine_scm_adapters_mercurial_redminehelper.py:1.1
--- /dev/null   Wed May 24 18:21:20 2023
+++ pkgsrc/devel/ruby-redmine50/patches/patch-lib_redmine_scm_adapters_mercurial_redminehelper.py       Wed May 24 18:21:20 2023
@@ -0,0 +1,277 @@
+$NetBSD: patch-lib_redmine_scm_adapters_mercurial_redminehelper.py,v 1.1 2023/05/24 18:21:20 triaxx Exp $
+
+Update Mercurial helper to work with Python 3.
+https://www.redmine.org/issues/33784
+
+--- lib/redmine/scm/adapters/mercurial/redminehelper.py.orig   2023-05-24 06:22:38.263411907 +0000
++++ lib/redmine/scm/adapters/mercurial/redminehelper.py
+@@ -45,17 +45,20 @@ Output example of rhmanifest::
+       </repository>
+     </rhmanifest>
+ """
+-import re, time, cgi, urllib
++import re, time, html, urllib
+ from mercurial import cmdutil, commands, node, error, hg, registrar
+ 
+ cmdtable = {}
+ command = registrar.command(cmdtable) if hasattr(registrar, 'command') else cmdutil.command(cmdtable)
+ 
+-_x = cgi.escape
+-_u = lambda s: cgi.escape(urllib.quote(s))
++_x = lambda s: html.escape(s.decode('utf-8')).encode('utf-8')
++_u = lambda s: html.escape(urllib.parse.quote(s)).encode('utf-8')
++
++def unquoteplus(*args, **kwargs):
++    return urllib.parse.unquote_to_bytes(*args, **kwargs).replace(b'+', b' ')
+ 
+ def _changectx(repo, rev):
+-    if isinstance(rev, str):
++    if isinstance(rev, bytes):
+        rev = repo.lookup(rev)
+     if hasattr(repo, 'changectx'):
+         return repo.changectx(rev)
+@@ -70,10 +73,10 @@ def _tip(ui, repo):
+         except TypeError:  # Mercurial < 1.1
+             return repo.changelog.count() - 1
+     tipctx = _changectx(repo, tiprev())
+-    ui.write('<tip revision="%d" node="%s"/>\n'
++    ui.write(b'<tip revision="%d" node="%s"/>\n'
+              % (tipctx.rev(), _x(node.hex(tipctx.node()))))
+ 
+-_SPECIAL_TAGS = ('tip',)
++_SPECIAL_TAGS = (b'tip',)
+ 
+ def _tags(ui, repo):
+     # see mercurial/commands.py:tags
+@@ -84,7 +87,7 @@ def _tags(ui, repo):
+             r = repo.changelog.rev(n)
+         except error.LookupError:
+             continue
+-        ui.write('<tag revision="%d" node="%s" name="%s"/>\n'
++        ui.write(b'<tag revision="%d" node="%s" name="%s"/>\n'
+                  % (r, _x(node.hex(n)), _u(t)))
+ 
+ def _branches(ui, repo):
+@@ -104,136 +107,146 @@ def _branches(ui, repo):
+             return repo.branchheads(branch)
+     def lookup(rev, n):
+         try:
+-            return repo.lookup(rev)
++            return repo.lookup(str(rev).encode('utf-8'))
+         except RuntimeError:
+             return n
+     for t, n, r in sorted(iterbranches(), key=lambda e: e[2], reverse=True):
+         if lookup(r, n) in branchheads(t):
+-            ui.write('<branch revision="%d" node="%s" name="%s"/>\n'
++            ui.write(b'<branch revision="%d" node="%s" name="%s"/>\n'
+                      % (r, _x(node.hex(n)), _u(t)))
+ 
+ def _manifest(ui, repo, path, rev):
+     ctx = _changectx(repo, rev)
+-    ui.write('<manifest revision="%d" path="%s">\n'
++    ui.write(b'<manifest revision="%d" path="%s">\n'
+              % (ctx.rev(), _u(path)))
+ 
+     known = set()
+-    pathprefix = (path.rstrip('/') + '/').lstrip('/')
++    pathprefix = (path.decode('utf-8').rstrip('/') + '/').lstrip('/')
+     for f, n in sorted(ctx.manifest().iteritems(), key=lambda e: e[0]):
+-        if not f.startswith(pathprefix):
++        fstr = f.decode('utf-8')
++        if not fstr.startswith(pathprefix):
+             continue
+-        name = re.sub(r'/.*', '/', f[len(pathprefix):])
++        name = re.sub(r'/.*', '/', fstr[len(pathprefix):])
+         if name in known:
+             continue
+         known.add(name)
+ 
+         if name.endswith('/'):
+-            ui.write('<dir name="%s"/>\n'
+-                     % _x(urllib.quote(name[:-1])))
++            ui.write(b'<dir name="%s"/>\n'
++                     % _x(urllib.parse.quote(name[:-1]).encode('utf-8')))
+         else:
+             fctx = repo.filectx(f, fileid=n)
+             tm, tzoffset = fctx.date()
+-            ui.write('<file name="%s" revision="%d" node="%s" '
+-                     'time="%d" size="%d"/>\n'
++            ui.write(b'<file name="%s" revision="%d" node="%s" '
++                     b'time="%d" size="%d"/>\n'
+                      % (_u(name), fctx.rev(), _x(node.hex(fctx.node())),
+                         tm, fctx.size(), ))
+ 
+-    ui.write('</manifest>\n')
++    ui.write(b'</manifest>\n')
+ 
+-@command('rhannotate',
+-         [('r', 'rev', '', 'revision'),
+-          ('u', 'user', None, 'list the author (long with -v)'),
+-          ('n', 'number', None, 'list the revision number (default)'),
+-          ('c', 'changeset', None, 'list the changeset'),
++@command(b'rhannotate',
++         [(b'r', b'rev', b'', b'revision'),
++          (b'u', b'user', None, b'list the author (long with -v)'),
++          (b'n', b'number', None, b'list the revision number (default)'),
++          (b'c', b'changeset', None, b'list the changeset'),
+          ],
+-         'hg rhannotate [-r REV] [-u] [-n] [-c] FILE...')
++         b'hg rhannotate [-r REV] [-u] [-n] [-c] FILE...')
+ def rhannotate(ui, repo, *pats, **opts):
+-    rev = urllib.unquote_plus(opts.pop('rev', None))
++    rev = unquoteplus(opts.pop('rev', b''))
+     opts['rev'] = rev
+-    return commands.annotate(ui, repo, *map(urllib.unquote_plus, pats), **opts)
++    return commands.annotate(ui, repo, *map(unquoteplus, pats), **opts)
+ 
+-@command('rhcat',
+-               [('r', 'rev', '', 'revision')],
+-               'hg rhcat ([-r REV] ...) FILE...')
++@command(b'rhcat',
++               [(b'r', b'rev', b'', b'revision')],
++               b'hg rhcat ([-r REV] ...) FILE...')
+ def rhcat(ui, repo, file1, *pats, **opts):
+-    rev = urllib.unquote_plus(opts.pop('rev', None))
++    rev = unquoteplus(opts.pop('rev', b''))
+     opts['rev'] = rev
+-    return commands.cat(ui, repo, urllib.unquote_plus(file1), *map(urllib.unquote_plus, pats), **opts)
++    return commands.cat(ui, repo, unquoteplus(file1), *map(unquoteplus, pats), **opts)
+ 
+-@command('rhdiff',
+-               [('r', 'rev', [], 'revision'),
+-                ('c', 'change', '', 'change made by revision')],
+-               'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...')
++@command(b'rhdiff',
++               [(b'r', b'rev', [], b'revision'),
++                (b'c', b'change', b'', b'change made by revision')],
++               b'hg rhdiff ([-c REV] | [-r REV] ...) [FILE]...')
+ def rhdiff(ui, repo, *pats, **opts):
+     """diff repository (or selected files)"""
+     change = opts.pop('change', None)
+     if change:  # add -c option for Mercurial<1.1
+         base = _changectx(repo, change).parents()[0].rev()
+-        opts['rev'] = [str(base), change]
++        opts['rev'] = [base, change]
+     opts['nodates'] = True
+-    return commands.diff(ui, repo, *map(urllib.unquote_plus, pats), **opts)
++    return commands.diff(ui, repo, *map(unquoteplus, pats), **opts)
+ 
+-@command('rhlog',
++@command(b'rhlog',
+                    [
+-                    ('r', 'rev', [], 'show the specified revision'),
+-                    ('b', 'branch', [],
+-                       'show changesets within the given named branch'),
+-                    ('l', 'limit', '',
+-                         'limit number of changes displayed'),
+-                    ('d', 'date', '',
+-                         'show revisions matching date spec'),
+-                    ('u', 'user', [],
+-                      'revisions committed by user'),
+-                    ('', 'from', '',
+-                      ''),
+-                    ('', 'to', '',
+-                      ''),
+-                    ('', 'rhbranch', '',
+-                      ''),
+-                    ('', 'template', '',
+-                       'display with template')],
+-                   'hg rhlog [OPTION]... [FILE]')
++                    (b'r', b'rev', [], b'show the specified revision'),
++                    (b'b', b'branch', [],
++                       b'show changesets within the given named branch'),
++                    (b'l', b'limit', b'',
++                         b'limit number of changes displayed'),
++                    (b'd', b'date', b'',
++                         b'show revisions matching date spec'),
++                    (b'u', b'user', [],
++                      b'revisions committed by user'),
++                    (b'', b'from', b'',
++                      b''),
++                    (b'', b'to', b'',
++                      b''),
++                    (b'', b'rhbranch', b'',
++                      b''),
++                    (b'', b'template', b'',
++                       b'display with template')],
++                   b'hg rhlog [OPTION]... [FILE]')
+ def rhlog(ui, repo, *pats, **opts):
+     rev      = opts.pop('rev')
+     bra0     = opts.pop('branch')
+-    from_rev = urllib.unquote_plus(opts.pop('from', None))
+-    to_rev   = urllib.unquote_plus(opts.pop('to'  , None))
+-    bra      = urllib.unquote_plus(opts.pop('rhbranch', None))
+-    from_rev = from_rev.replace('"', '\\"')
+-    to_rev   = to_rev.replace('"', '\\"')
+-    if hg.util.version() >= '1.6':
+-      opts['rev'] = ['"%s":"%s"' % (from_rev, to_rev)]
++    from_rev = unquoteplus(opts.pop('from', b''))
++    to_rev   = unquoteplus(opts.pop('to'  , b''))
++    bra      = unquoteplus(opts.pop('rhbranch', b''))
++    from_rev = from_rev.replace(b'"', b'\\"')
++    to_rev   = to_rev.replace(b'"', b'\\"')
++    if (from_rev != b'') or (to_rev != b''):
++        if from_rev != b'':
++            quotefrom = b'"%s"' % (from_rev)
++        else:
++            quotefrom = from_rev
++        if to_rev != b'':
++            quoteto = b'"%s"' % (to_rev)
++        else:
++            quoteto = to_rev
++        opts['rev'] = [b'%s:%s' % (quotefrom, quoteto)]
+     else:
+-      opts['rev'] = ['%s:%s' % (from_rev, to_rev)]
+-    opts['branch'] = [bra]
+-    return commands.log(ui, repo, *map(urllib.unquote_plus, pats), **opts)
+-
+-@command('rhmanifest',
+-                   [('r', 'rev', '', 'show the specified revision')],
+-                   'hg rhmanifest [-r REV] [PATH]')
+-def rhmanifest(ui, repo, path='', **opts):
++        opts['rev'] = rev
++    if (bra != b''):
++        opts['branch'] = [bra]
++    return commands.log(ui, repo, *map(unquoteplus, pats), **opts)
++
++@command(b'rhmanifest',
++                   [(b'r', b'rev', b'', b'show the specified revision')],
++                   b'hg rhmanifest -r REV [PATH]')
++def rhmanifest(ui, repo, path=b'', **opts):
+     """output the sub-manifest of the specified directory"""
+-    ui.write('<?xml version="1.0"?>\n')
+-    ui.write('<rhmanifest>\n')
+-    ui.write('<repository root="%s">\n' % _u(repo.root))
++    ui.write(b'<?xml version="1.0"?>\n')
++    ui.write(b'<rhmanifest>\n')
++    ui.write(b'<repository root="%s">\n' % _u(repo.root))
+     try:
+-        _manifest(ui, repo, urllib.unquote_plus(path), urllib.unquote_plus(opts.get('rev')))
++        _manifest(ui, repo, unquoteplus(path), unquoteplus(opts.get('rev')))
+     finally:
+-        ui.write('</repository>\n')
+-        ui.write('</rhmanifest>\n')
++        ui.write(b'</repository>\n')
++        ui.write(b'</rhmanifest>\n')
+ 
+-@command('rhsummary',[], 'hg rhsummary')
++@command(b'rhsummary', [], b'hg rhsummary')
+ def rhsummary(ui, repo, **opts):
+     """output the summary of the repository"""
+-    ui.write('<?xml version="1.0"?>\n')
+-    ui.write('<rhsummary>\n')
+-    ui.write('<repository root="%s">\n' % _u(repo.root))
++    ui.write(b'<?xml version="1.0"?>\n')
++    ui.write(b'<rhsummary>\n')
++    ui.write(b'<repository root="%s">\n' % _u(repo.root))
+     try:
+         _tip(ui, repo)
+         _tags(ui, repo)
+         _branches(ui, repo)
+         # TODO: bookmarks in core (Mercurial>=1.8)
+     finally:
+-        ui.write('</repository>\n')
+-        ui.write('</rhsummary>\n')
++        ui.write(b'</repository>\n')
++        ui.write(b'</rhsummary>\n')
+ 



Home | Main Index | Thread Index | Old Index