mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Don't implement --atleast-version ourselves, incorrectly
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@12631 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
666f0da6c6
commit
638ef62cd4
@ -15,7 +15,7 @@ package make::utilities;
|
||||
use Exporter 'import';
|
||||
use POSIX;
|
||||
use Getopt::Long;
|
||||
@EXPORT = qw(make_rpath pkgconfig_get_include_dirs pkgconfig_get_lib_dirs pkgconfig_check_version translate_functions promptstring vcheck);
|
||||
@EXPORT = qw(make_rpath pkgconfig_get_include_dirs pkgconfig_get_lib_dirs pkgconfig_check_version translate_functions promptstring);
|
||||
|
||||
# Parse the output of a *_config program,
|
||||
# such as pcre_config, take out the -L
|
||||
@ -162,29 +162,6 @@ sub pkgconfig_get_include_dirs($$$;$)
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub vcheck($$)
|
||||
{
|
||||
my ($version1, $version2) = @_;
|
||||
$version1 =~ s/\-r(\d+)/\.\1/g; # minor revs/patchlevels
|
||||
$version2 =~ s/\-r(\d+)/\.\1/g;
|
||||
$version1 =~ s/p(\d+)/\.\1/g;
|
||||
$version2 =~ s/p(\d+)/\.\1/g;
|
||||
$version1 =~ s/\-//g;
|
||||
$version2 =~ s/\-//g;
|
||||
$version1 =~ s/a-z//g;
|
||||
$version2 =~ s/a-z//g;
|
||||
my @v1 = split('\.', $version1);
|
||||
my @v2 = split('\.', $version2);
|
||||
for ($curr = 0; $curr < scalar(@v2); $curr++)
|
||||
{
|
||||
if ($v1[$curr] < $v2[$curr])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub pkgconfig_check_version($$;$)
|
||||
{
|
||||
my ($packagename, $version, $module) = @_;
|
||||
@ -200,7 +177,7 @@ sub pkgconfig_check_version($$;$)
|
||||
}
|
||||
if ((defined $v) && ($v ne ""))
|
||||
{
|
||||
if (vcheck($v,$version) == 1)
|
||||
if (!system "pkg-config --atleast-version $version $packagename")
|
||||
{
|
||||
print "\033[1;32mYes (version $v)\033[0m\n";
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user