aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-07-28 14:04:30 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-07-28 14:04:30 +0000
commit7fd451137206d05d3d04eaff9d914184d741a68d (patch)
tree6703c330a15766896addab52144860b75ca0236c
parent647afcc5427085d413c7b49a6cc24c45100baec5 (diff)
downloadrpm-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.
-rw-r--r--build.macros.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/build.macros.in b/build.macros.in
index da63c12..b7a2aeb 100644
--- a/build.macros.in
+++ b/build.macros.in
@@ -223,7 +223,7 @@ GCONF_CONFIG_SOURCE=`%{_gconftool_bin} --get-default-source` %{_gconftool_bin} -
#
-%perl_convert_version() %(perl -Mversion -E '$v=version->new(%{1})->normal; $v=~s/^v//; say $v')
+%perl_convert_version() %(perl -Mversion -le '$v=version->new("%{1}")->normal; $v=~s/^v//; print $v')
# kept for compatibility, but should not be used, especially the ugly perl_archlib!
%perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch)