quarta-feira, julho 25, 2007

Weird behavior of Lua RPM scriptlets

RPM allows packagers to write scriptlets and macros in specfiles using the Lua language. That's a really nice feature but seems nobody is using it and thus it is not being properly tested:
$ rpm -q --qf '%{VERSION}\n' --specfile teste.spec
error: line 8: Unknown tag: ðâ
error: query of specfile teste.spec failed, can't parse
$ cat teste.spec
%{lua: print("Name: foo") }
%{lua: print("Version: bar") }
Release: 1
Group: Foo/bar
License: GPL
Summary: summary
Buildroot: %_tmpdir/%name
Note the unknown tag rpm is complaining about "ðâ", which seems to be gargabage. It happens always when calling print more than once and can't be reproduced with "rpm --eval". Really weird.

My dirty workaround was to append all needed lines in a table and then dump all these lines with only one call of print().

Um comentário:

Anônimo disse...

Sim, provavelmente por isso e