diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-28 14:04:30 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-28 14:04:30 +0000 |
commit | 7fd451137206d05d3d04eaff9d914184d741a68d (patch) | |
tree | 6703c330a15766896addab52144860b75ca0236c /rpmeval.c | |
parent | 647afcc5427085d413c7b49a6cc24c45100baec5 (diff) | |
download | rpm-setup-7fd451137206d05d3d04eaff9d914184d741a68d.tar rpm-setup-7fd451137206d05d3d04eaff9d914184d741a68d.tar.gz rpm-setup-7fd451137206d05d3d04eaff9d914184d741a68d.tar.bz2 rpm-setup-7fd451137206d05d3d04eaff9d914184d741a68d.tar.xz rpm-setup-7fd451137206d05d3d04eaff9d914184d741a68d.zip |
update perl_convert_version macro
Patch from Jérôme Quelin
current %perl_convert_version is defined as:
%perl_convert_version() %(perl -Mversion -le
%'$v=version->new(%{1})->normal; $v=~s/^v//; print $v')
however, this does not work when parsing strange versions such as 1.03a
or 6.0.e (yes, those exist). currently we get:
$ rpm --eval '%perl_convert_version 1.03a'
Bareword found where operator expected at -e line 1, near "1.03a"
(Missing operator before a?)
syntax error at -e line 1, near "1.03a"
Execution of -e aborted due to compilation errors.
$ rpm --eval '%perl_convert_version 6.0.e'
0.0.0
therefore, i would like to update it a bit to read:
%perl_convert_version() %(perl -Mversion -le
%'$v=version->new("%{1}")->normal; $v=~s/^v//; print $v')
(note the quotes enclosing the %{1})
using this macro on above examples, we would get 1.30.0 and 6.0.0. not
perfect, but at least it doesn't fail, and %mkrel can be used to
differentiate them.
Diffstat (limited to 'rpmeval.c')
0 files changed, 0 insertions, 0 deletions