Commit 36550e66 authored by Mike Hibler's avatar Mike Hibler

New approach, new attitude and hopefully new result.

parent d549f5b5
......@@ -781,7 +781,8 @@ sub FetchFileFatal($$) {
#
# Locate the proper version of a package to install by looking
# at the available package tarballs.
# at the available package tarballs. Note that we do "ls -t"
# so that if there is more than one package, we will return the latest.
#
# Must be called "in phase" since we will PhaseFail on errors.
#
......@@ -791,18 +792,27 @@ sub GetPackage($$) {
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
my $pname = `ls $packagedir/$prefix-*.txz 2>/dev/null`;
my @pname = `ls -t $packagedir/$prefix-*.txz 2>/dev/null`;
if ($?) {
$pname = `ls $packagedir/$prefix-*.tbz 2>/dev/null`;
@pname = `ls -t $packagedir/$prefix-*.tbz 2>/dev/null`;
if ($?) {
$pname = `ls $packagedir/$prefix-*.tgz 2>/dev/null`;
@pname = `ls -t $packagedir/$prefix-*.tgz 2>/dev/null`;
PhaseFail("Cannot find $prefix package in $packagedir!")
if ($?);
}
}
chomp($pname);
chomp(@pname);
return $pname;
if (@pname > 1) {
# if it matched more than one package, find one with exactly one '-'
foreach my $pn (@pname) {
if ($pn =~ /^$packagedir\/$prefix-[^-]+\.t[bgx]z$/) {
return $pn;
}
}
}
return $pname[0];
}
#
......
......@@ -104,8 +104,8 @@ sub Install($$$)
AddPackage($pname, $packagedir);
};
Phase "p5-JSON", "Looking for p5-JSON and installing", sub {
DoneIfPackageInstalled("p5-JSON-2");
my $pname = GetPackage("p5-JSON-2", $packagedir);
DoneIfPackageInstalled("p5-JSON");
my $pname = GetPackage("p5-JSON", $packagedir);
AddPackage($pname, $packagedir);
};
}
......
......@@ -88,8 +88,8 @@ sub Install($$$)
# As of 05/2014, the 9.0 stuff is still needed on geniracks.
#
Phase "p5-JSON", "Looking for p5-JSON and installing", sub {
DoneIfPackageInstalled("p5-JSON-2");
my $pname = GetPackage("p5-JSON-2", $packagedir);
DoneIfPackageInstalled("p5-JSON");
my $pname = GetPackage("p5-JSON", $packagedir);
AddPackage($pname, $packagedir);
};
}
......
......@@ -53,7 +53,7 @@ sub Install($$$)
ExecQuietFatal("cd $BUILDDIR; make install");
};
Phase "json", "Installing json port", sub {
DoneIfPackageInstalled("p5-JSON-2");
DoneIfPackageInstalled("p5-JSON");
ExecQuietFatal("cd /usr/ports/converters/p5-JSON; make install");
};
Phase "hmac", "Installing hmac digest port", sub {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment