From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26010 invoked by alias); 14 May 2017 19:55:10 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 25983 invoked by uid 9795); 14 May 2017 19:55:09 -0000 Date: Sun, 14 May 2017 19:55:00 -0000 Message-ID: <20170514195509.25954.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20160705-82-gba53d8e X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 281d8cbd6f691a03263148217d1f3e30f3f2f13e X-Git-Newrev: ba53d8ee2eb63d28b51dec6740e3d9d3bdad910c X-SW-Source: 2017-q2/txt/msg00027.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=ba53d8ee2eb63d28b51dec6740e3d9d3bdad910c commit ba53d8ee2eb63d28b51dec6740e3d9d3bdad910c Author: Jon Turney Date: Thu May 11 22:14:24 2017 +0100 Stop pretending we handle UTF-8 maintainer names Restricting maintainer names to the ASCII charset sidesteps a couple of issues: * We're going to be generating pathnames based on maintainer names. If these contain non-ASCII character, we need to define the filesystem encoding to use. Practically, this means a UTF-8 locale is needed. * gitolite usernames are restricted to ASCII letters and numbers, so we'd need to transliterate UTF-8 maintainer name to that restricted charset. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=fe3c88de4463451827b8f5d63dce28e8100f7ac4 commit fe3c88de4463451827b8f5d63dce28e8100f7ac4 Author: Jon Turney Date: Fri May 12 18:08:11 2017 +0100 Record first named maintainer as owner in gitolite conf Diff: --- calm/maintainers.py | 26 +++++++++++--------------- calm/mkgitoliteconf.py | 3 ++- test/testdata/pkglist/cygwin-pkg-maint | 2 +- test/testdata/pkglist/expected | 2 +- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/calm/maintainers.py b/calm/maintainers.py index b1b43dc..119c8b5 100644 --- a/calm/maintainers.py +++ b/calm/maintainers.py @@ -173,6 +173,17 @@ class Maintainer(object): # joint maintainers are separated by '/' for name in m.split('/'): + + # is the maintainer name ascii? + # + # (despite containing spaces, think of these as an account + # name, rather than a display name) + try: + name.encode('ascii') + except UnicodeError: + logging.error("non-ascii maintainer name '%s' in line %s:%d, skipped" % (rest, pkglist, i)) + continue + m = Maintainer._find(mlist, name) m.pkgs.append(pkg) @@ -199,18 +210,3 @@ class Maintainer(object): @staticmethod def all_packages(mlist): return list(itertools.chain.from_iterable(mlist[m].pkgs for m in mlist)) - -# -# We must be able to use pathnames which contain any character in the maintainer -# name, read from the maintainer list file. -# -# So, this test is somewhat sloppy. In theory the filesystem encoding might be -# some encoding which can represent the subset of the io encoding that -# maintainer names actually use. In practice, use a utf-8 locale. -# - -if sys.getfilesystemencoding() != sys.getdefaultencoding(): - print("IO encoding is '%s', filesystem encoding is '%s'" % (sys.getdefaultencoding(), sys.getfilesystemencoding()), file=sys.stderr) - print('It is required that IO encoded strings are convertible to the filesystem encoding', file=sys.stderr) - print("Please set the locale", file=sys.stderr) - exit(1) diff --git a/calm/mkgitoliteconf.py b/calm/mkgitoliteconf.py index e32c69b..a82a083 100755 --- a/calm/mkgitoliteconf.py +++ b/calm/mkgitoliteconf.py @@ -43,7 +43,6 @@ from . import maintainers def transform_username(name): name = name.replace('.', '') name = name.replace(' ', '_') - name = name.encode('ascii', 'replace').decode() return name @@ -74,12 +73,14 @@ def do_main(args): # for each package for p in sorted(pkgs): users = ' '.join(map(transform_username, pkgs[p])) + owner = pkgs[p][0] # first named maintainer if p.startswith('_'): p = p[1:] print("repo cygwin-packages/%s" % (p)) print("C = %s" % (users)) print("RW = %s" % (users)) + print("owner = %s" % (owner)) print("") # diff --git a/test/testdata/pkglist/cygwin-pkg-maint b/test/testdata/pkglist/cygwin-pkg-maint index 9239bdc..75fad88 100644 --- a/test/testdata/pkglist/cygwin-pkg-maint +++ b/test/testdata/pkglist/cygwin-pkg-maint @@ -2300,7 +2300,7 @@ usbutils Yaakov Selkowitz util-linux Yaakov Selkowitz uw-imap Dr. Volker Zell vala Yaakov Selkowitz -varnish Jorge Díaz +varnish Jorge Diaz vfu Jari Aalto viewres Yaakov Selkowitz vim Yaakov Selkowitz diff --git a/test/testdata/pkglist/expected b/test/testdata/pkglist/expected index a43eb13..4c38b0b 100644 --- a/test/testdata/pkglist/expected +++ b/test/testdata/pkglist/expected @@ -33,7 +33,7 @@ 'Jon Turney': maintainers.Maintainer('Jon Turney', ['jon@invalid.local'], ['buildbot-slave', 'cygwin-doc', 'cygwin-x-doc', 'ddd', 'dmalloc', 'font-bitstream-vera-ttf', 'gdb', 'google-breakpad', 'khronos-opengl-registry', 'libxcwm', 'mingw64-i686-google-breakpad', 'mingw64-x86_64-google-breakpad', 'xlaunch', 'xmon', 'xorg-server', 'XtoW', 'xview', 'xwin-xdg-menu']), 'Jonathan C. Allen': maintainers.Maintainer('Jonathan C. Allen', [], ['naim']), 'Jonathan Yong': maintainers.Maintainer('Jonathan Yong', [], ['binutils', 'gcc', 'gendef', 'libmangle', 'lzip', 'lziprecover', 'mingw64-i686-binutils', 'mingw64-i686-gcc', 'mingw64-i686-headers', 'mingw64-i686-pthreads', 'mingw64-i686-runtime', 'mingw64-i686-windows-default-manifest', 'mingw64-i686-winpthreads', 'mingw64-x86_64-binutils', 'mingw64-x86_64-gcc', 'mingw64-x86_64-headers', 'mingw64-x86_64-pthreads', 'mingw64-x86_64-runtime', 'mingw64-x86_64-windows-default-manifest', 'mingw64-x86_64-winpthreads', 'w32api-headers', 'w32api-runtime']), - 'Jorge Díaz': maintainers.Maintainer('Jorge Díaz', [], ['varnish']), + 'Jorge Diaz': maintainers.Maintainer('Jorge Diaz', [], ['varnish']), 'Ken Brown': maintainers.Maintainer('Ken Brown', [], ['asymptote', 'biber', 'bzr-fastimport', 'clisp', 'emacs', 'emacs-auctex', 'fcgi', 'ffcall', 'icu', 'perl-autovivification', 'perl-Business-ISBN', 'perl-Business-ISBN-Data', 'perl-Business-ISMN', 'perl-Business-ISSN', 'perl-Capture-Tiny', 'perl-Config-AutoConf', 'perl-Data-Compare', 'perl-Data-Diver', 'perl-Data-Dump', 'perl-Date-Simple', 'perl-Encode-EUCJPASCII', 'perl-Encode-HanExtra', 'perl-Encode-JIS2K', 'perl-ExtUtils-LibBuilder', 'perl-File-Find-Rule', 'perl-File-Slurp', 'perl-File-Slurp-Unicode', 'perl-IO-HTML', 'perl-IPC-Run3', 'perl-List-AllUtils', 'perl-List-MoreUtils', 'perl-Log-Log4perl', 'perl-LWP-Protocol-https', 'perl-MIME-Charset', 'perl-Mozilla-CA', 'perl-Number-Compare', 'perl-Readonly', 'perl-Readonly-XS', 'perl-Regexp-Common', 'perl-Text-BibTeX', 'perl-Text-Glob', 'perl-Text-Roman', 'perl-Tie-Cycle', 'perl-Unicode-Collate', 'perl-Unicode-GCString', 'perl-Unicode-LineBreak', 'perl-Unicode-Normalize', 'perl-XML-LibXML-Simple', 'perl-XML-LibXSLT', 'perl-XML-Writer', 'python-fastimport', 'svm', 'texinfo', 'texlive', 'texlive-collection-basic', 'texlive-collection-basic-doc', 'texlive-collection-bibtexextra', 'texlive-collection-bibtexextra-doc', 'texlive-collection-binextra', 'texlive-collection-binextra-doc', 'texlive-collection-context', 'texlive-collection-context-doc', 'texlive-collection-fontsextra', 'texlive-collection-fontsextra-doc', 'texlive-collection-fontsrecommended', 'texlive-collection-fontsrecommended-doc', 'texlive-collection-fontutils', 'texlive-collection-fontutils-doc', 'texlive-collection-formatsextra', 'texlive-collection-games', 'texlive-collection-genericextra', 'texlive-collection-genericextra-doc', 'texlive-collection-genericrecommended', 'texlive-collection-genericrecommended-doc', 'texlive-collection-htmlxml', 'texlive-collection-humanities', 'texlive-collection-humanities-doc', 'texlive-collection-langafrican', 'texlive-collection-langarabic', 'texlive-collection-langchinese', 'texlive-collection-langcjk', 'texlive-collection-langcyrillic', 'texlive-collection-langczechslovak', 'texlive-collection-langenglish', 'texlive-collection-langeuropean', 'texlive-collection-langfrench', 'texlive-collection-langgerman', 'texlive-collection-langgreek', 'texlive-collection-langindic', 'texlive-collection-langitalian', 'texlive-collection-langjapanese', 'texlive-collection-langkorean', 'texlive-collection-langother', 'texlive-collection-langpolish', 'texlive-collection-langportuguese', 'texlive-collection-langspanish', 'texlive-collection-latex', 'texlive-collection-latex-doc', 'texlive-collection-latexextra', 'texlive-collection-latexextra-doc', 'texlive-collection-latexrecommended', 'texlive-collection-latexrecommended-doc', 'texlive-collection-luatex', 'texlive-collection-luatex-doc', 'texlive-collection-mathextra', 'texlive-collection-mathextra-doc', 'texlive-collection-metapost', 'texlive-collection-metapost-doc', 'texlive-collection-music', 'texlive-collection-music-doc', 'texlive-collection-omega', 'texlive-collection-pictures', 'texlive-collection-pictures-doc', 'texlive-collection-plainextra', 'texlive-collection-pstricks', 'texlive-collection-pstricks-doc', 'texlive-collection-publishers', 'texlive-collection-publishers-doc', 'texlive-collection-science', 'texlive-collection-science-doc', 'texlive-collection-xetex', 'texlive-collection-xetex-doc']), 'Klaus Grue': maintainers.Maintainer('Klaus Grue', [], ['logiweb']), 'Kostya Altukhov': maintainers.Maintainer('Kostya Altukhov', [], ['colordiff', 'gaffitter']),