From 7fd451137206d05d3d04eaff9d914184d741a68d Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 28 Jul 2009 14:04:30 +0000 Subject: update perl_convert_version macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- build.macros.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.1