Commit b1492bce authored by Mike Hibler's avatar Mike Hibler

Make a change that Leigh suggested when he was here: get rid of all

hardwired version numbers in the pkg_add commands.
parent b8b55661
......@@ -408,11 +408,8 @@ Phase "portfixup", "Fixing up packages", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) {
PhaseSkip("rsync already installed");
}
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD rsync-2.6.3_1");
my $pname = GetPackage("rsync", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
if ($FBSD_VERSION == 6) {
# Temporary for template stuff
......@@ -420,23 +417,15 @@ Phase "portfixup", "Fixing up packages", sub {
if (!ExecQuiet("$PKG_INFO -x p5-XML-Simple")) {
PhaseSkip("p5-XML-Simple already installed");
}
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir ".
" $PKG_ADD p5-XML-Simple-2.14");
my $pname = GetPackage("p5-XML-Simple", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
Phase "Subversion", "Looking for Subversion", sub {
if (!ExecQuiet("$PKG_INFO -x subversion")) {
PhaseSkip("subversion already installed");
}
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir ".
" $PKG_ADD subversion-1.3.0.tbz");
my $pname = GetPackage("subversion", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
}
if ($WINSUPPORT) {
......@@ -445,11 +434,8 @@ Phase "portfixup", "Fixing up packages", sub {
!ExecQuiet("$PKG_INFO -x gcc30")) {
PhaseSkip("GCC 3.0 already installed");
}
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD gcc30-3.0.4_1");
my $pname = GetPackage("gcc30", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
}
};
......
......@@ -263,11 +263,8 @@ Phase "portfixup", "Fixing up packages", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) {
PhaseSkip("rsync already installed");
}
PhaseFail("Must have PKG_PATH environment variable set")
if (!exists($ENV{"PKG_PATH"}));
ExecQuietFatal("$PKG_ADD rsync-2.6.3_1");
my $pname = GetPackage("rsync", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
Phase "samba", "Looking for Samba and installing", sub {
if (!$WINSUPPORT) {
......@@ -276,11 +273,9 @@ Phase "portfixup", "Fixing up packages", sub {
if (!ExecQuiet("$PKG_INFO -x samba")) {
PhaseSkip("samba already installed");
}
PhaseFail("Must have PKG_PATH environment variable set")
if (!exists($ENV{"PKG_PATH"}));
ExecQuietFatal("$PKG_ADD samba-3.0.7,1");
my $pname = GetPackage("samba", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
};
......
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2003-2005 University of Utah and the Flux Group.
# Copyright (c) 2003-2006 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -455,6 +455,29 @@ sub FetchFileFatal($$) {
}
}
#
# Locate the proper version of a package to install by looking
# at the available package tarballs.
#
# Must be called "in phase" since we will PhashFail on errors.
#
sub GetPackage($$) {
my ($prefix, $packagedir) = @_;
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
my $pname = `ls $packagedir/$prefix-*.tbz`;
if ($?) {
$pname = `ls $packagedir/$prefix-*.tgz`;
PhaseFail("Cannot find $prefix package in $packagedir!")
if ($?);
}
chomp($pname);
return $pname;
}
#
# Print out the phase stack that got us here
#
......
......@@ -331,12 +331,7 @@ Phase "ports", "Installing ports", sub {
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
# Lets not hardwire the package name; whatever it is will do.
my $pname = `ls $packagedir/mailman-*.tbz`;
PhaseFail("Cannot find mailman package in $packagedir!")
if ($?);
chomp($pname);
my $pname = GetPackage("mailman", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
}
......@@ -351,12 +346,7 @@ Phase "ports", "Installing ports", sub {
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
# Lets not hardwire the package name; whatever it is will do.
my $pname = `ls $packagedir/cvsd-*.tbz`;
PhaseFail("Cannot find cvsd package in $packagedir!")
if ($?);
chomp($pname);
my $pname = GetPackage("cvsd", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
}
......@@ -371,12 +361,7 @@ Phase "ports", "Installing ports", sub {
if (!$packagedir) {
PhaseSkip("No package directory provided");
}
# Lets not hardwire the package name; whatever it is will do.
my $pname = `ls $packagedir/adodb-*.tbz`;
PhaseFail("Cannot find adodb package in $packagedir!")
if ($?);
chomp($pname);
my $pname = GetPackage("adodb", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
}
......@@ -440,11 +425,8 @@ Phase "portfixup", "Fixing up packages", sub {
if (!ExecQuiet("$PKG_INFO -x rsync")) {
PhaseSkip("rsync already installed");
}
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD rsync-2.6.3_1");
my $pname = GetPackage("rsync", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
if ($WINSUPPORT) {
Phase "samba", "Looking for Samba and installing", sub {
......@@ -454,22 +436,16 @@ Phase "portfixup", "Fixing up packages", sub {
if (!ExecQuiet("$PKG_INFO -x samba")) {
PhaseSkip("samba already installed");
}
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD samba-3.0.7,1");
my $pname = GetPackage("samba", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
Phase "gcc30", "Looking for GCC 3.0 and installing", sub {
if ($FBSD_VERSION > 4 ||
!ExecQuiet("$PKG_INFO -x gcc30")) {
PhaseSkip("GCC 3.0 already installed");
}
PhaseFail("Must provide -p (packagedir) argument!")
if (!$packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD gcc30-3.0.4_1");
my $pname = GetPackage("gcc30", $packagedir);
ExecQuietFatal("$ENV PKG_PATH=$packagedir $PKG_ADD $pname");
};
}
};
......
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