[arch-commits] Commit in docutils/repos/community-any (6 files)

Sébastien Luttringer seblu at nymeria.archlinux.org
Mon Jul 7 00:43:25 UTC 2014


    Date: Monday, July 7, 2014 @ 02:43:25
  Author: seblu
Revision: 115222

archrelease: copy trunk to community-any

Added:
  docutils/repos/community-any/01-rst2odt_prepstyles-elementtree.patch
    (from rev 115221, docutils/trunk/01-rst2odt_prepstyles-elementtree.patch)
  docutils/repos/community-any/PKGBUILD
    (from rev 115221, docutils/trunk/PKGBUILD)
  docutils/repos/community-any/python2-docutils.install
    (from rev 115221, docutils/trunk/python2-docutils.install)
Deleted:
  docutils/repos/community-any/01-python33-relative-import.patch
  docutils/repos/community-any/PKGBUILD
  docutils/repos/community-any/python2-docutils.install

-----------------------------------------+
 01-python33-relative-import.patch       |  196 ------------------------------
 01-rst2odt_prepstyles-elementtree.patch |   68 ++++++++++
 PKGBUILD                                |  164 ++++++++++++-------------
 python2-docutils.install                |   18 +-
 4 files changed, 161 insertions(+), 285 deletions(-)

Deleted: 01-python33-relative-import.patch
===================================================================
--- 01-python33-relative-import.patch	2014-07-07 00:43:11 UTC (rev 115221)
+++ 01-python33-relative-import.patch	2014-07-07 00:43:25 UTC (rev 115222)
@@ -1,196 +0,0 @@
-From 12e5aa7b94e0a0ec37e754527e06707005d28d1c Mon Sep 17 00:00:00 2001
-From: milde <milde at 929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
-Date: Wed, 11 Jul 2012 12:25:14 +0000
-Subject: [PATCH] Fix [3541369] Relative __import__ also with Python 3.3.
-
-git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@7486 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
----
- docutils/HISTORY.txt                               |    1 +
- docutils/docutils/_compat.py                       |   11 +++++++++++
- docutils/docutils/languages/__init__.py            |    8 ++++++--
- docutils/docutils/parsers/__init__.py              |    5 ++++-
- .../docutils/parsers/rst/directives/__init__.py    |    6 +++++-
- .../docutils/parsers/rst/languages/__init__.py     |    6 +++++-
- docutils/docutils/readers/__init__.py              |    5 ++++-
- docutils/docutils/writers/__init__.py              |    7 +++++--
- 8 files changed, 41 insertions(+), 8 deletions(-)
-
-diff --git a/docutils/docutils/_compat.py b/docutils/docutils/_compat.py
-index 1450534..19654a6 100644
---- a/docutils/docutils/_compat.py
-+++ b/docutils/docutils/_compat.py
-@@ -35,3 +35,14 @@ else:
-     # using this hack since 2to3 "fixes" the relative import
-     # when using ``from io import BytesIO``
-     BytesIO = __import__('io').BytesIO
-+
-+if sys.version_info < (2,5):
-+    import __builtin__
-+
-+    def __import__(name, globals={}, locals={}, fromlist=[], level=-1):
-+        """Compatibility definition for Python 2.4.
-+
-+        Silently ignore the `level` argument missing in Python < 2.5.
-+        """
-+        # we need the level arg because the default changed in Python 3.3
-+        return __builtin__.__import__(name, globals, locals, fromlist)
-diff --git a/docutils/docutils/languages/__init__.py b/docutils/docutils/languages/__init__.py
-index 675bb0e..57d3ec2 100644
---- a/docutils/docutils/languages/__init__.py
-+++ b/docutils/docutils/languages/__init__.py
-@@ -11,7 +11,11 @@ This package contains modules for language-dependent features of Docutils.
- 
- __docformat__ = 'reStructuredText'
- 
-+import sys
-+
- from docutils.utils import normalize_language_tag
-+if sys.version_info < (2,5):
-+    from docutils._compat import __import__
- 
- _languages = {}
- 
-@@ -26,7 +30,7 @@ def get_language(language_code, reporter=None):
-         if tag in _languages:
-             return _languages[tag]
-         try:
--            module = __import__(tag, globals(), locals())
-+            module = __import__(tag, globals(), locals(), level=1)
-         except ImportError:
-             continue
-         _languages[tag] = module
-@@ -35,6 +39,6 @@ def get_language(language_code, reporter=None):
-         reporter.warning(
-             'language "%s" not supported: ' % language_code +
-             'Docutils-generated text will be in English.')
--    module = __import__('en', globals(), locals())
-+    module = __import__('en', globals(), locals(), level=1)
-     _languages[tag] = module # warn only one time!
-     return module
-diff --git a/docutils/docutils/parsers/__init__.py b/docutils/docutils/parsers/__init__.py
-index 2683376..341e358 100644
---- a/docutils/docutils/parsers/__init__.py
-+++ b/docutils/docutils/parsers/__init__.py
-@@ -8,7 +8,10 @@ This package contains Docutils parser modules.
- 
- __docformat__ = 'reStructuredText'
- 
-+import sys
- from docutils import Component
-+if sys.version_info < (2,5):
-+    from docutils._compat import __import__
- 
- 
- class Parser(Component):
-@@ -43,5 +46,5 @@ def get_parser_class(parser_name):
-     parser_name = parser_name.lower()
-     if parser_name in _parser_aliases:
-         parser_name = _parser_aliases[parser_name]
--    module = __import__(parser_name, globals(), locals())
-+    module = __import__(parser_name, globals(), locals(), level=1)
-     return module.Parser
-diff --git a/docutils/docutils/parsers/rst/directives/__init__.py b/docutils/docutils/parsers/rst/directives/__init__.py
-index b00a676..fdc70d7 100644
---- a/docutils/docutils/parsers/rst/directives/__init__.py
-+++ b/docutils/docutils/parsers/rst/directives/__init__.py
-@@ -10,8 +10,12 @@ __docformat__ = 'reStructuredText'
- 
- import re
- import codecs
-+import sys
-+
- from docutils import nodes
- from docutils.parsers.rst.languages import en as _fallback_language_module
-+if sys.version_info < (2,5):
-+    from docutils._compat import __import__
- 
- 
- _directive_registry = {
-@@ -109,7 +113,7 @@ def directive(directive_name, language_module, document):
-         # Error handling done by caller.
-         return None, messages
-     try:
--        module = __import__(modulename, globals(), locals())
-+        module = __import__(modulename, globals(), locals(), level=1)
-     except ImportError, detail:
-         messages.append(document.reporter.error(
-             'Error importing directive module "%s" (directive "%s"):\n%s'
-diff --git a/docutils/docutils/parsers/rst/languages/__init__.py b/docutils/docutils/parsers/rst/languages/__init__.py
-index 53017d7..5a151e4 100644
---- a/docutils/docutils/parsers/rst/languages/__init__.py
-+++ b/docutils/docutils/parsers/rst/languages/__init__.py
-@@ -12,7 +12,11 @@ reStructuredText.
- 
- __docformat__ = 'reStructuredText'
- 
-+import sys
-+
- from docutils.utils import normalize_language_tag
-+if sys.version_info < (2,5):
-+    from docutils._compat import __import__
- 
- _languages = {}
- 
-@@ -21,7 +25,7 @@ def get_language(language_code):
-         if tag in _languages:
-             return _languages[tag]
-         try:
--            module = __import__(tag, globals(), locals())
-+            module = __import__(tag, globals(), locals(), level=1)
-         except ImportError:
-             continue
-         _languages[tag] = module
-diff --git a/docutils/docutils/readers/__init__.py b/docutils/docutils/readers/__init__.py
-index a28248f..e3e6fb5 100644
---- a/docutils/docutils/readers/__init__.py
-+++ b/docutils/docutils/readers/__init__.py
-@@ -8,9 +8,12 @@ This package contains Docutils Reader modules.
- 
- __docformat__ = 'reStructuredText'
- 
-+import sys
- 
- from docutils import utils, parsers, Component
- from docutils.transforms import universal
-+if sys.version_info < (2,5):
-+    from docutils._compat import __import__
- 
- 
- class Reader(Component):
-@@ -103,5 +106,5 @@ def get_reader_class(reader_name):
-     reader_name = reader_name.lower()
-     if reader_name in _reader_aliases:
-         reader_name = _reader_aliases[reader_name]
--    module = __import__(reader_name, globals(), locals())
-+    module = __import__(reader_name, globals(), locals(), level=1)
-     return module.Reader
-diff --git a/docutils/docutils/writers/__init__.py b/docutils/docutils/writers/__init__.py
-index e30dbf6..8fcee0c 100644
---- a/docutils/docutils/writers/__init__.py
-+++ b/docutils/docutils/writers/__init__.py
-@@ -8,11 +8,14 @@ This package contains Docutils Writer modules.
- 
- __docformat__ = 'reStructuredText'
- 
--
- import os.path
-+import sys
-+
- import docutils
- from docutils import languages, Component
- from docutils.transforms import universal
-+if sys.version_info < (2,5):
-+    from docutils._compat import __import__
- 
- 
- class Writer(Component):
-@@ -130,5 +133,5 @@ def get_writer_class(writer_name):
-     writer_name = writer_name.lower()
-     if writer_name in _writer_aliases:
-         writer_name = _writer_aliases[writer_name]
--    module = __import__(writer_name, globals(), locals())
-+    module = __import__(writer_name, globals(), locals(), level=1)
-     return module.Writer
--- 
-1.6.5.GIT
-

Copied: docutils/repos/community-any/01-rst2odt_prepstyles-elementtree.patch (from rev 115221, docutils/trunk/01-rst2odt_prepstyles-elementtree.patch)
===================================================================
--- 01-rst2odt_prepstyles-elementtree.patch	                        (rev 0)
+++ 01-rst2odt_prepstyles-elementtree.patch	2014-07-07 00:43:25 UTC (rev 115222)
@@ -0,0 +1,68 @@
+--- a/tools/rst2odt_prepstyles.py
++++ b/tools/rst2odt_prepstyles.py
+@@ -12,7 +12,15 @@
+ #
+ # Author: Michael Schutte <michi at uiae.at>
+ 
+-from lxml import etree
++try:
++    from xml.etree import ElementTree as etree
++except ImportError:
++    try:
++        from elementtree import ElementTree as etree
++    except ImportError:
++        raise ImportError('Missing an implementation of ElementTree. ' \
++                'Please install either Python >= 2.5 or ElementTree.')
++
+ import sys
+ import zipfile
+ from tempfile import mkstemp
+@@ -27,12 +35,22 @@
+ def prepstyle(filename):
+     
+     zin = zipfile.ZipFile(filename)
+-    styles = zin.read("styles.xml")
+-    
+-    root = etree.fromstring(styles)
+-    for el in root.xpath("//style:page-layout-properties", 
+-        namespaces=NAMESPACES):
+-        for attr in el.attrib:
++    styles = zin.open("styles.xml")
++
++    root = None
++    # some extra effort to preserve namespace prefixes
++    for event, elem in etree.iterparse(styles, events=("start", "start-ns")):
++        if event == "start-ns":
++            etree.register_namespace(elem[0], elem[1])
++        elif event == "start":
++            if root is None:
++                root = elem
++
++    styles.close()
++
++    for el in root.findall(".//style:page-layout-properties",
++            namespaces=NAMESPACES):
++        for attr in el.attrib.keys():
+             if attr.startswith("{%s}" % NAMESPACES["fo"]):
+                 del el.attrib[attr]
+     
+@@ -42,7 +60,7 @@
+     
+     for item in zin.infolist():
+         if item.filename == "styles.xml":
+-            zout.writestr(item, etree.tostring(root))
++            zout.writestr(item, etree.tostring(root, encoding="UTF-8"))
+         else:
+             zout.writestr(item, zin.read(item.filename))
+     
+@@ -54,8 +72,8 @@
+ def main():
+     args = sys.argv[1:]
+     if len(args) != 1:
+-        print >> sys.stderr, __doc__
+-        print >> sys.stderr, "Usage: %s STYLE_FILE.odt\n" % sys.argv[0]
++        sys.stderr.write(__doc__)
++        sys.stderr.write("\nUsage: %s STYLE_FILE.odt\n" % sys.argv[0])
+         sys.exit(1)
+     filename = args[0]
+     prepstyle(filename)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2014-07-07 00:43:11 UTC (rev 115221)
+++ PKGBUILD	2014-07-07 00:43:25 UTC (rev 115222)
@@ -1,80 +0,0 @@
-# $Id$
-# Maintainer: Sébastien Luttringer
-# Contributor : Ionut Biru <ibiru at archlinux.org>
-# Contributor: Sergej Pupykin <pupykin.s+arch at gmail.com>
-
-pkgbase=docutils
-pkgname=('python-docutils' 'python2-docutils')
-pkgver=0.11
-pkgrel=2
-pkgdesc='Set of tools for processing plaintext docs into formats such as HTML, XML, or LaTeX'
-arch=('any')
-url='http://docutils.sourceforge.net'
-license=('custom')
-makedepends=('python' 'python2')
-source=("http://downloads.sourceforge.net/$pkgbase/$pkgbase-$pkgver.tar.gz")
-md5sums=('20ac380a18b369824276864d98ec0ad6')
-
-build() {
-  cd $pkgbase-$pkgver
-#  for _p in "$srcdir"/*.patch; do
-#    msg2 "${_p##*/}"
-#    patch -p2 -i "$_p"
-#  done
-  python3 setup.py build --build-lib=build/python
-  find build/python -type f -exec \
-    sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python3,' {} \;
-  python2 setup.py build --build-lib=build/python2
-  find build/python2 -type f -exec \
-    sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \;
-}
-
-check() {
-  cd $pkgbase-$pkgver
-  # we need utf locale to valid utf8 tests
-  export LANG=en_US.UTF-8
-  # Disable python3 check
-  #msg2 'python checks'
-  #PYTHONPATH="$PWD/build/python/" python3 test3/alltests.py
-  msg2 'python2 checks'
-  PYTHONPATH="$PWD/build/python2/" python2 test/alltests.py
-}
-
-package_python-docutils() {
-  depends=('python')
-
-  cd $pkgbase-$pkgver
-  python setup.py build --build-lib=build/python \
-                  install --root="$pkgdir" --optimize=1
-  # symlink without .py
-  for f in "$pkgdir"/usr/bin/*.py; do
-      ln -s "$(basename $f)" "$pkgdir/usr/bin/$(basename $f .py)"
-  done
-  # setup license
-  install -D -m644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt"
-  install -D -m644 licenses/python* "$pkgdir/usr/share/licenses/$pkgname/"
-}
-
-package_python2-docutils() {
-  depends=('python2')
-  provides=("docutils=$pkgver")
-  replaces=('docutils')
-  install=python2-docutils.install
-
-  cd $pkgbase-$pkgver
-  python2 setup.py build --build-lib=build/python2 \
-                   install --root="$pkgdir" --optimize=1
-  # fix python-docutils conflict
-  for _f in "$pkgdir"/usr/bin/*.py; do
-      mv -v "$_f" "${_f%.py}2.py"
-  done
-  # symlink without .py
-  for _f in "$pkgdir"/usr/bin/*.py; do
-      ln -s "$(basename $_f)" "$pkgdir/usr/bin/$(basename $_f .py)"
-  done
-  # setup license
-  install -D -m644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt"
-  install -D -m644 licenses/python* "$pkgdir/usr/share/licenses/$pkgname/"
-}
-
-# vim:set ts=2 sw=2 et:

Copied: docutils/repos/community-any/PKGBUILD (from rev 115221, docutils/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2014-07-07 00:43:25 UTC (rev 115222)
@@ -0,0 +1,84 @@
+# $Id$
+# Maintainer: Sébastien Luttringer
+# Contributor : Ionut Biru <ibiru at archlinux.org>
+# Contributor: Sergej Pupykin <pupykin.s+arch at gmail.com>
+
+pkgbase=docutils
+pkgname=('python-docutils' 'python2-docutils')
+pkgver=0.12
+pkgrel=1
+pkgdesc='Set of tools for processing plaintext docs into formats such as HTML, XML, or LaTeX'
+arch=('any')
+url='http://docutils.sourceforge.net'
+license=('custom')
+makedepends=('python' 'python2')
+source=("http://downloads.sourceforge.net/$pkgbase/$pkgbase-$pkgver.tar.gz"
+        '01-rst2odt_prepstyles-elementtree.patch')
+md5sums=('4622263b62c5c771c03502afa3157768'
+         '34952e8a50692b628a8aa2dde3072f07')
+
+build() {
+  cd $pkgbase-$pkgver
+  for _p in "$srcdir"/*.patch; do
+    msg2 "${_p##*/}"
+    patch -p1 -i "$_p"
+  done
+  msg2 python3
+  python3 setup.py build --build-lib=build/python
+  find build/python -type f -exec \
+    sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python3,' {} \;
+  msg2 python2
+  python2 setup.py build --build-lib=build/python2
+  find build/python2 -type f -exec \
+    sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \;
+}
+
+check() {
+  cd $pkgbase-$pkgver
+  # we need utf locale to valid utf8 tests
+  export LANG=en_US.UTF-8
+  # Disable python3 check
+  #msg2 'python checks'
+  #PYTHONPATH="$PWD/build/python/" python3 test3/alltests.py
+  msg2 'python2 checks'
+  PYTHONPATH="$PWD/build/python2/" python2 test/alltests.py
+}
+
+package_python-docutils() {
+  depends=('python')
+
+  cd $pkgbase-$pkgver
+  python setup.py build --build-lib=build/python \
+                  install --root="$pkgdir" --optimize=1
+  # symlink without .py
+  for f in "$pkgdir"/usr/bin/*.py; do
+      ln -s "$(basename $f)" "$pkgdir/usr/bin/$(basename $f .py)"
+  done
+  # setup license
+  install -D -m644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt"
+  install -D -m644 licenses/python* "$pkgdir/usr/share/licenses/$pkgname/"
+}
+
+package_python2-docutils() {
+  depends=('python2')
+  provides=("docutils=$pkgver")
+  replaces=('docutils')
+  install=python2-docutils.install
+
+  cd $pkgbase-$pkgver
+  python2 setup.py build --build-lib=build/python2 \
+                   install --root="$pkgdir" --optimize=1
+  # fix python-docutils conflict
+  for _f in "$pkgdir"/usr/bin/*.py; do
+      mv -v "$_f" "${_f%.py}2.py"
+  done
+  # symlink without .py
+  for _f in "$pkgdir"/usr/bin/*.py; do
+      ln -s "$(basename $_f)" "$pkgdir/usr/bin/$(basename $_f .py)"
+  done
+  # setup license
+  install -D -m644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt"
+  install -D -m644 licenses/python* "$pkgdir/usr/share/licenses/$pkgname/"
+}
+
+# vim:set ts=2 sw=2 et:

Deleted: python2-docutils.install
===================================================================
--- python2-docutils.install	2014-07-07 00:43:11 UTC (rev 115221)
+++ python2-docutils.install	2014-07-07 00:43:25 UTC (rev 115222)
@@ -1,9 +0,0 @@
-post_upgrade() {
-  [ $(vercmp '0.8.1-2' "$2") -gt 0 ] && cat <<EOF || :
-python2-docutils:
-rst* binaries have been renamed to rst*2 to avoid conflict with python-docutils
-remember to update your scripts
-EOF
-}
-
-# vim:set ts=2 sw=2 ft=sh et:

Copied: docutils/repos/community-any/python2-docutils.install (from rev 115221, docutils/trunk/python2-docutils.install)
===================================================================
--- python2-docutils.install	                        (rev 0)
+++ python2-docutils.install	2014-07-07 00:43:25 UTC (rev 115222)
@@ -0,0 +1,9 @@
+post_upgrade() {
+  [ $(vercmp '0.8.1-2' "$2") -gt 0 ] && cat <<EOF || :
+python2-docutils:
+rst* binaries have been renamed to rst*2 to avoid conflict with python-docutils
+remember to update your scripts
+EOF
+}
+
+# vim:set ts=2 sw=2 ft=sh et:




More information about the arch-commits mailing list