Public bug reported:

Binary package hint: libxml-simple-ruby

Hi,

when running e.g. ruby on rails I get heaps of warnings:

/usr/lib/ruby/1.8/xmlsimple.rb:275: warning: already initialized constant 
KNOWN_OPTIONS
/usr/lib/ruby/1.8/xmlsimple.rb:280: warning: already initialized constant 
DEF_KEY_ATTRIBUTES
/usr/lib/ruby/1.8/xmlsimple.rb:281: warning: already initialized constant 
DEF_ROOT_NAME
/usr/lib/ruby/1.8/xmlsimple.rb:282: warning: already initialized constant 
DEF_CONTENT_KEY
/usr/lib/ruby/1.8/xmlsimple.rb:283: warning: already initialized constant 
DEF_XML_DECLARATION
/usr/lib/ruby/1.8/xmlsimple.rb:284: warning: already initialized constant 
DEF_ANONYMOUS_TAG
/usr/lib/ruby/1.8/xmlsimple.rb:285: warning: already initialized constant 
DEF_FORCE_ARRAY
/usr/lib/ruby/1.8/xmlsimple.rb:286: warning: already initialized constant 
DEF_INDENTATION
/usr/lib/ruby/1.8/xmlsimple.rb:287: warning: already initialized constant 
DEF_KEY_TO_SYMBOL

which is obviously caused because that package contains xmlsimple.rb twice, 
/usr/lib/ruby/1.8/xmlsimple.rb and /usr/lib/ruby/1.8/lib/xmlsimple.rb where one 
is a symlink to the other. 

I guess this is needed because applications expect xmlsimple at
different paths. In rails there are require statements for

require 'xmlsimple'   and
require 'lib/xmlsimple'

and interestingly the comment 
# Debian maintainers put their xmlsimple in a different location :(

so it is a debian mess. However, requiring the same file from different
paths is something the ruby interpreter cannot prevent. That's why
warnings are printed.

Please fix that (and maybe put files just where they belong).

Even if that cannot be fixed easily for whatever reason, do *NOT* use
symlinks to have a file at different places. Just write a file with a
single line 'require ...' to the other location. Thus the interpreter
can detect that it reads the same file again.

regards

** Affects: libxml-simple-ruby (Ubuntu)
     Importance: Undecided
         Status: New

-- 
already initialized constant DEF_KEY_ATTRIBUTES
https://bugs.launchpad.net/bugs/321291
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to