Skip to content

Commit

Permalink
[ci] improve OBS::Test::Util::get_package_version
Browse files Browse the repository at this point in the history
remove everthing from version string which is not digit or dot
  • Loading branch information
M0ses authored and coolo committed Nov 14, 2018
1 parent bae728e commit 5d847e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dist/t/lib/OBS/Test/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use warnings;
sub get_package_version {
my ($pkg, $num) = @_;
my @pkg_ver = `rpm -q --qf '%{version}' $pkg`;
my @ver_raw = split(/\./,$pkg_ver[0]);
my $raw_ver = $pkg_ver[0];
chomp $raw_ver;
$raw_ver =~ s/^([\d\.]*).*/$1/;
my @ver_raw = split(/\./, $raw_ver);
my @ver = splice(@ver_raw, 0, $num);
return join('.',@ver);
}
Expand Down

0 comments on commit 5d847e3

Please sign in to comment.