Bug 796149 - OCaml dependency generation broken again (with patch)
Summary: OCaml dependency generation broken again (with patch)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-22 11:46 UTC by Richard W.M. Jones
Modified: 2012-03-30 19:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-30 19:07:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
0001-Correctly-quote-tr-blank-in-OCaml-dependency-scripts.patch (1.47 KB, patch)
2012-02-22 11:47 UTC, Richard W.M. Jones
no flags Details | Diff

Description Richard W.M. Jones 2012-02-22 11:46:46 UTC
Description of problem:

OCaml dependency generation is broken because of a change
in /bin/sh.  We used the following command:

  tr [:blank:] '\n'

Because of some change in /bin/sh, the unquoted [:blank:]
turns into a 'b' character.  Quoting it ('[:blank:]') fixes
the issue.

So please apply the attached patch to rpm which adds the
necessary quoting.

Version-Release number of selected component (if applicable):

4.9.1.2

Steps to Reproduce:

$ echo /usr/lib64/ocaml/bigarray.cma | /usr/lib/rpm/ocaml-find-requires.sh 
Fatal error: exception Sys_error("igarray.cma: No such file or directory")
Fatal error: exception Sys_error("igarray.cma: No such file or directory")
ocaml(runtime) = 3.12.1

(Note this breaks because 'bigarray' contains a 'b' character)

With the patched ocaml-find-requires.sh, it works:

$ echo /usr/lib64/ocaml/bigarray.cma | /tmp/ocaml-find-requires.sh 
ocaml(Array) = 720848e0b508273805ef38d884a57618
ocaml(Complex) = 9aea79838f042027ab9539d587834bc8
ocaml(Pervasives) = db723a1798b122e08919a2bfed062514
ocaml(Unix) = 2a19929a535447ed0c8fc58ae3adc1a0
ocaml(runtime) = 3.12.1

Comment 1 Richard W.M. Jones 2012-02-22 11:47:44 UTC
Created attachment 564924 [details]
0001-Correctly-quote-tr-blank-in-OCaml-dependency-scripts.patch

Patch against rpm.git.

Comment 2 Richard W.M. Jones 2012-02-22 12:09:38 UTC
By the way the cause of the bug is even more interesting.  It
only happens if you have a file called 'b' in the current
directory (I was running that from /tmp where I have a temporary
file called 'b').

[:blank:] (unquoted) is treated as a shell glob.

When it doesn't match anything, it is passed through to the
tr command.  But if you have a file called 'a', 'b', 'l' etc
then it suddenly matches that file.

Anyway, the patch in comment 1 should still be applied.

(Thanks to Jim Meyering for the explanation)

Comment 3 Panu Matilainen 2012-03-07 07:19:59 UTC
Applied upstream, thanks. Leaving open for Fedora tracking.

Comment 4 Panu Matilainen 2012-03-30 19:07:00 UTC
Oh and this is fixed in rawhide in rpm >= 4.9.90 now. For older versions this is the kind of fix that I expect to pull into a 4.9.x maintenance release as well, when the time comes.


Note You need to log in before you can comment on or make changes to this bug.