Bug 267696 - create_tarball.rb fails with later version of ruby
Summary: create_tarball.rb fails with later version of ruby
Status: RESOLVED FIXED
Alias: None
Product: kdesdk-scripts
Classification: Developer tools
Component: Miscellaneous (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-05 12:17 UTC by David Houlden
Modified: 2011-04-10 00:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Force appdata["add{Docs,Po}"] to be an array to fix a (possible) bug caught by Ruby 1.9 (717 bytes, patch)
2011-04-08 03:57 UTC, Michael Pyne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Houlden 2011-03-05 12:17:24 UTC
Version:           unspecified (using KDE 4.5.5) 
OS:                Linux

Running create_tarball.rb -n -a kmymoney I get the following error.

Last KDE version found: 4.6.1
Considering kmymoney
Processing kmymoney
Fetching extragear/office/kmymoney into kmymoney-4.5...
Fetching l10n docs for office/kmymoney ...
./create_tarball.rb:296:in `block (2 levels) in <main>': undefined
method `each' for "kmymoney":String (NoMethodError)
      from ./create_tarball.rb:293:in `each'
      from ./create_tarball.rb:293:in `block in <main>'
      from ./create_tarball.rb:142:in `each'
      from ./create_tarball.rb:142:in `<main>'

This happens using ruby version 1.9.1p430 (2010-08-16 revision 28998) [i486-linux]

If I go back to svn revision 1178314 of createtarball it works.

One of the kmymoney developers is using the latest svn version of createtarball with ruby 1.8.6 (2009-06-08 patchlevel 369) [x86_64-linux] and this also works.

So, there seems to be a problem with the latest svn version of createtarball and ruby version 1.9.1p430.

Reproducible: Always
Comment 1 Michael Pyne 2011-04-08 03:57:04 UTC
Created attachment 58699 [details]
Force appdata["add{Docs,Po}"] to be an array to fix a (possible) bug caught by Ruby 1.9

Not sure how I got assigned this (perhaps I made myself default for kdesdk-scripts ;) but try this patch and let me know how it goes.
Comment 2 David Houlden 2011-04-08 15:12:23 UTC
Thank you, I tried the patch and it works on my 1.9.1p431 version of ruby. I have asked on the kmymoney mailing list for someone to confirm it is ok with ruby 1.8.x.
Comment 3 Thomas Baumgart 2011-04-09 09:37:31 UTC
Thanks Micheal. I tried the patch upon Davids request here against ruby 1.8.7 on an openSUSE 11.4. Works fine.
Comment 4 Michael Pyne 2011-04-10 00:39:18 UTC
SVN commit 1227514 by mpyne:

Ensure that appPo and appDocs are always arrays.

The first time that appdata["app{Po,Docs}"] gets set, a simple string is
assigned, but it is apparently supposed to be an array of possible docs or
translations to add.

This didn't cause errors with Ruby 1.8 as the way the array was iterated also
happens to work on strings. Ruby 1.9 forces you to use each_line() on Strings
(or each_byte, each_character, etc.) and therefore fails which is how the
issue was caught.

BUG:267696


 M  +2 -2      create_tarball.rb  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1227514