Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#38951 - [xmlto] shebang reads /bin/sh but uses bashisms

Attached to Project: Arch Linux
Opened by Eric Mrak (sxtynnmach1) - Tuesday, 18 February 2014, 01:25 GMT
Last edited by Jan de Groot (JGC) - Thursday, 20 February 2014, 12:55 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Giovanni Scafora (giovanni)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The executable /usr/bin/xmlto references #!/bin/sh as the interpreter, but uses bashisms.

Additional info:
* version 0.0.25-3

Log output:
/usr/bin/xmlto: 582: [: 0: unexpected operator
/usr/bin/xmlto: 1: /usr/bin/xmlto: Bad substitution
/usr/bin/xmlto: 115: /usr/bin/xmlto: declare: not found
/usr/bin/xmlto: 119: /usr/bin/xmlto: declare: not found
/usr/bin/xmlto: 1: eval: CLEANFILES[0]=/tmp/xmlto-xsl.VEJiJ4: not found
/usr/bin/xmlto: 1: eval: CLEANFILES[1]=/tmp/xmlto-xsl.IJpD9A: not found
/usr/bin/xmlto: 201: /usr/bin/xmlto: XSL_MODS[0]=/tmp/xmlto-xsl.IJpD9A: not found
/usr/bin/xmlto: 1: eval: CLEANFILES[2]=/tmp/xmlto-xsl.KFHlMx: not found
/usr/bin/xmlto: 507: /usr/bin/xmlto: Bad substitution
/usr/bin/xmlto: 1: eval: CLEANFILES[3]=/tmp/xmlto.wnHfWz: not found
/usr/bin/xmlto: 582: [: 0: unexpected operator

Steps to reproduce:

1. symlink /bin/sh -> /usr/bin/dash
2. Try to build xdg-utils-mimeo from AUR
3. Installation fails ("declare" not found, unexpected operators, etc)
4. Edit /usr/bin/xmlto to have #!/bin/bash (or #!/usr/bin/bash) as line 1
5. Try to install xdg-utils-mimeo again.
6. Installation succeeds

When /bin/sh is symlinked to a non-bash compliant shell, xmlto will error out.

Proposed solution:
* specify #!/bin/bash or #!/usr/bin/bash as the interpreter in the xmlto executable
This task depends upon

Closed by  Jan de Groot (JGC)
Thursday, 20 February 2014, 12:55 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed now (you could verify this by looking at 1st line of /usr/bin/xmlto in the package)
Comment by Doug Newgard (Scimmia) - Tuesday, 18 February 2014, 03:03 GMT
Looking at the PKGBUILD, nothing is done during the packaging, so this is an upstream bug. Please report it there.
Comment by Eric Mrak (sxtynnmach1) - Tuesday, 18 February 2014, 03:11 GMT
Noticed some other distributions' Makefiles had @BASH@ being templated in their packages. I'll report it upstream then.
Comment by Eric Mrak (sxtynnmach1) - Tuesday, 18 February 2014, 17:39 GMT
It looks like upstream has autoconf determine the path to bash unless specified at ./configure time.

https://fedorahosted.org/xmlto/browser/configure.in

It seems on arch systems it determines that bash is /bin/sh, but on user's systems with /bin/sh symlinked to dash (or other) the binary package's executable doesn't run.

I prepended BASH=/bin/bash to the configure line in the attached PKGBUILD
   PKGBUILD (0.8 KiB)
Comment by Eric Mrak (sxtynnmach1) - Thursday, 20 February 2014, 08:28 GMT
Forgive my autoconf incompetence, but I placed BASH=/bin/bash BEFORE ./configure instead of AFTER ./configure

I have verified that the new fix works on default Arch installs as well as those with a different symlink from /bin/sh

The correct line should be:

./configure BASH=/bin/bash --prefix=/usr --mandir=/usr/share/man

This should save the configured variable reliably
Comment by Jan de Groot (JGC) - Thursday, 20 February 2014, 08:29 GMT
Executable still uses /bin/sh in the packaged version after the fix.
Comment by Giovanni Scafora (giovanni) - Thursday, 20 February 2014, 11:22 GMT
I just uploaded 0.0.25-5.
Please, let me know if it is ok now.

Loading...