Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#12977 closed defect (fixed)

BUG: xml2po fails when upgrading gnome-desktop gnome-panel

Reported by: dbevans (David B. Evans) Owned by: rhwood@…
Priority: High Milestone:
Component: ports Version: 1.5.2
Keywords: Cc: dbevans (David B. Evans) rhwood@…
Port:

Description

when updating gnome-desktop and gnome-panel, xml2po (gnome-doc-tools) fails as follows:

--->  Fetching gnome-desktop
--->  Attempting to fetch gnome-desktop-2.20.1.tar.bz2 from http://mandril.creatis.insa-lyon.fr/linux/gnome.org/sources/gnome-desktop/2.20/
--->  Verifying checksum(s) for gnome-desktop
--->  Extracting gnome-desktop
--->  Configuring gnome-desktop
--->  Building gnome-desktop with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-desktop/work/gnome-desktop-2.20.1" && make all " returned error 2
Command output: xsltproc -o gpl-uk.omf --stringparam db2omf.basename gpl --stringparam db2omf.format 'docbook' --stringparam db2omf.dtd "-//OASIS//DTD DocBook XML V4.1.2//EN" --stringparam db2omf.lang uk --stringparam db2omf.omf_dir "/opt/local/share/omf" --stringparam db2omf.help_dir "/opt/local/share/gnome/help" --stringparam db2omf.omf_in "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-desktop/work/gnome-desktop-2.20.1/desktop-docs/gpl/gpl.omf.in"  `/opt/local/bin/pkg-config --variable db2omf gnome-doc-utils` uk/gpl.xml || { rm -f "gpl-uk.omf"; exit 1; }
xsltproc -o gpl-vi.omf --stringparam db2omf.basename gpl --stringparam db2omf.format 'docbook' --stringparam db2omf.dtd "-//OASIS//DTD DocBook XML V4.1.2//EN" --stringparam db2omf.lang vi --stringparam db2omf.omf_dir "/opt/local/share/omf" --stringparam db2omf.help_dir "/opt/local/share/gnome/help" --stringparam db2omf.omf_in "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-desktop/work/gnome-desktop-2.20.1/desktop-docs/gpl/gpl.omf.in"  `/opt/local/bin/pkg-config --variable db2omf gnome-doc-utils` vi/gpl.xml || { rm -f "gpl-vi.omf"; exit 1; }
xsltproc -o gpl-zh_CN.omf --stringparam db2omf.basename gpl --stringparam db2omf.format 'docbook' --stringparam db2omf.dtd "-//OASIS//DTD DocBook XML V4.1.2//EN" --stringparam db2omf.lang zh_CN --stringparam db2omf.omf_dir "/opt/local/share/omf" --stringparam db2omf.help_dir "/opt/local/share/gnome/help" --stringparam db2omf.omf_in "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-desktop/work/gnome-desktop-2.20.1/desktop-docs/gpl/gpl.omf.in"  `/opt/local/bin/pkg-config --variable db2omf gnome-doc-utils` zh_CN/gpl.xml || { rm -f "gpl-zh_CN.omf"; exit 1; }
xsltproc -o gpl-sv.omf --stringparam db2omf.basename gpl --stringparam db2omf.format 'docbook' --stringparam db2omf.dtd "-//OASIS//DTD DocBook XML V4.1.2//EN" --stringparam db2omf.lang sv --stringparam db2omf.omf_dir "/opt/local/share/omf" --stringparam db2omf.help_dir "/opt/local/share/gnome/help" --stringparam db2omf.omf_in "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-desktop/work/gnome-desktop-2.20.1/desktop-docs/gpl/gpl.omf.in"  `/opt/local/bin/pkg-config --variable db2omf gnome-doc-utils` sv/gpl.xml || { rm -f "gpl-sv.omf"; exit 1; }
Making all in lgpl
if ! test -d ar/; then mkdir ar/; fi
if [ -f "C/lgpl.xml" ]; then d="../"; else d="/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_gnome_gnome-desktop/work/gnome-desktop-2.20.1/desktop-docs/lgpl/"; fi; \
(cd ar/ && \
  `which xml2po` -e -p \
    "${d}ar/ar.po" \
    "${d}C/lgpl.xml" > lgpl.xml.tmp && \
    cp lgpl.xml.tmp lgpl.xml && rm -f lgpl.xml.tmp)
Traceback (most recent call last):
  File "/opt/local/bin/xml2po", line 802, in <module>
    CurrentXmlMode = load_mode(default_mode)()
  File "/opt/local/bin/xml2po", line 674, in load_mode
    module = __import__(modename)
  File "/opt/local/share/xml2po/docbook.py", line 39, in <module>
    import md5
  File "/opt/local/lib/python2.5/md5.py", line 6, in <module>
    from hashlib import md5
  File "/opt/local/lib/python2.5/hashlib.py", line 133, in <module>
    md5 = __get_builtin_constructor('md5')
  File "/opt/local/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor
    import _md5
ImportError: No module named _md5
make[3]: *** [ar/lgpl.xml] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Unable to upgrade port: 1

This appears to be related to the patch introduced in changeset [30149]. Removal of the patch fixes this problem.

Attachments (1)

patch-gnome-doc-utils-Portfile.diff (658 bytes) - added by dbevans (David B. Evans) 17 years ago.
Proposed patch for gnome-doc-utils Portfile

Download all attachments as: .zip

Change History (7)

comment:1 Changed 17 years ago by dbevans (David B. Evans)

That's gnome-doc-utils not gnome-doc-tools.

comment:2 Changed 17 years ago by rhwood@…

Priority: NormalHigh
Status: newassigned

Do you have py25-hashlib installed?

comment:3 Changed 17 years ago by rhwood@…

Cc: db.evans@… added; db.evans@… removed

Add myself to the CC list, so I directly get every change to the ticket.

comment:4 Changed 17 years ago by dbevans (David B. Evans)

As you have surmised, at the time I originally entered this ticket, I had not installed py25-hashlib.

Since your query, however, I have looked at the issue in more detail and now understand the current partitioning of python 2.5 as explained in the FAQ and also the issues behind it as indicated in Ticket #12369. I have also run a number of test builds of gnome-desktop and gnome-panel (the only two dependents of gnome-doc-utils at this point) with py25-hashlib installed and uninstalled and with gnome-doc-utils patched and unpatched and have reviewed the xml2po python code in question.

Based on the results, I conclude that for xml2po to have full functionality either with or without the patch, py25-hashlib does, indeed, need to be installed. But, also, the patch is unnecessary and breaks an intended (and useful) functionality of xml2po.

In the patched case, without py25-hashlib, the builds of gnome-desktop and gnome-panel fail as reported originally because the intended exception handling has been broken. The builds succeed if py25-hashlib is installed. (The exception case is avoided but remains a possibility if other document handlers reference modules not included in either the python25 or py25-hashlib ports).

In the unpatched case, without py25-hashlib, the exception processing in xml2po correctly determines that the default processing module (docbook.py) cannot be loaded (because docbook.py can't import md5 which is in py25-hashlib) and prints a warning message but then falls back to its automatic detection mode which is able to complete the desired processing without using md5. In gnome-desktop this involves translating the xml license document lgpl.xml. In gnome-panel this involves translating the help document, window-list.xml. In both cases, the build completes successfully with correct translations of the target documents.

Of course, if py25-hashlib is installed in this case, then the load of docbook.py is successful and processing proceeds using that code with the build completing successfully with identical results.

Unless there is some other reason for the xml2po patch being applied, I suggest that py25-hashlib be added as an explicit dependency to the gnome-doc-utils port file and that the patch be removed. This solves the problem of installing py25-hashlib without forcing an unexpected build failure on the user.

Attached is my proposed patch which implements this suggestion. Are there other issues involved that I am unaware of?

Changed 17 years ago by dbevans (David B. Evans)

Proposed patch for gnome-doc-utils Portfile

comment:5 Changed 17 years ago by gui-dos (Guido Soranzio)

Resolution: fixed
Status: assignedclosed

Fixed in r34111

comment:6 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.