aboutsummaryrefslogtreecommitdiffstats
path: root/misc/porteasy
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-05-24 21:10:16 +0800
committerdes <des@FreeBSD.org>2004-05-24 21:10:16 +0800
commit6dd7d38377635da47ee69861ea92bee16805301d (patch)
treed41a51fb2f59b2cc70c85916187555c59d778484 /misc/porteasy
parent0a5a8486f63968e806feffab290c317a486d0dfa (diff)
downloadfreebsd-ports-gnome-6dd7d38377635da47ee69861ea92bee16805301d.tar.gz
freebsd-ports-gnome-6dd7d38377635da47ee69861ea92bee16805301d.tar.zst
freebsd-ports-gnome-6dd7d38377635da47ee69861ea92bee16805301d.zip
Try to fetch an up-to-date index from http://www.freebsd.org/ports/.
Diffstat (limited to 'misc/porteasy')
-rw-r--r--misc/porteasy/Makefile2
-rw-r--r--misc/porteasy/src/porteasy.821
-rw-r--r--misc/porteasy/src/porteasy.pl38
3 files changed, 46 insertions, 15 deletions
diff --git a/misc/porteasy/Makefile b/misc/porteasy/Makefile
index a86e5f28e1e5..7f9415ea66f4 100644
--- a/misc/porteasy/Makefile
+++ b/misc/porteasy/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= porteasy
-PORTVERSION= 2.7.14
+PORTVERSION= 2.7.15
CATEGORIES= misc
MASTER_SITES= # none
DISTFILES= # none
diff --git a/misc/porteasy/src/porteasy.8 b/misc/porteasy/src/porteasy.8
index 032cfefc544d..0382bd721f40 100644
--- a/misc/porteasy/src/porteasy.8
+++ b/misc/porteasy/src/porteasy.8
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 10, 2004
+.Dd May 24, 2004
.Dt PORTEASY 8
.Os
.Sh NAME
@@ -153,12 +153,22 @@ This section describes the operations performed by
.Nm
and the order in which they are performed.
.Bl -tag -width indent
-.It Update index
+.It Update ports tree infrastructure
If the
.Fl u
-option was specified and some unqualified port names were listed on
-the command line, the index file is updated using
+option was specified, the root of the ports tree and important
+subdirectories
+.Po
+.Pa Mk ,
+.Pa Templates
+and
+.Pa Tools
+.Pc
+are updated using
.Xr cvs 1 .
+If possible, an up-to-date index is retrieved from the
+.Fx
+website; otherwise, the version obtained from CVS will be used.
.It Select ports
The selection list is initialized with the ports listed on the command
line (and, if the
@@ -172,7 +182,8 @@ If a certain match is not found,
prints a list of possible matches and exits.
.Pp
All direct and indirect dependencies (except, if the
-.Fl e option was specified,
+.Fl e
+option was specified,
those that are already installed) are also selected and marked as
dependencies.
.It Update ports tree and discover dependencies
diff --git a/misc/porteasy/src/porteasy.pl b/misc/porteasy/src/porteasy.pl
index 9f5562efdea0..1dfbf82ad467 100644
--- a/misc/porteasy/src/porteasy.pl
+++ b/misc/porteasy/src/porteasy.pl
@@ -33,7 +33,7 @@ use strict;
use Fcntl;
use Getopt::Long;
-my $VERSION = "2.7.14";
+my $VERSION = "2.7.15";
my $COPYRIGHT = "Copyright (c) 2000-2004 Dag-Erling Smørgrav. " .
"All rights reserved.";
@@ -45,6 +45,7 @@ sub REQ_IMPLICIT { 2 }
sub CVS_PASSFILE { "%%PREFIX%%/share/porteasy/cvspass" }
sub PATH_CVS { "/usr/bin/cvs" }
+sub PATH_FETCH { "/usr/bin/fetch" }
sub PATH_LDCONFIG { "/sbin/ldconfig" }
sub PATH_MAKE { "/usr/bin/make" }
@@ -317,9 +318,9 @@ sub ecks() {
}
#
-# Update the index file
+# Update the root of the ports tree
#
-sub update_index() {
+sub update_root() {
my $parent; # Parent directory
@@ -328,12 +329,12 @@ sub update_index() {
if (! -d "ports/CVS") {
cd($parent);
cvs("checkout", "-l", "ports")
- or bsd::errx(1, "error checking out the index file");
+ or bsd::errx(1, "error checking out the root of the ports tree");
cd($portsdir);
} else {
cd($portsdir);
cvs("update", "-l")
- or bsd::errx(1, "error updating the index file");
+ or bsd::errx(1, "error updating the root of the ports tree");
}
if ($packages && ! -d "$portsdir/packages") {
mkdir("$portsdir/packages", 0777)
@@ -341,11 +342,29 @@ sub update_index() {
}
cvs("update", "Mk", "Templates", "Tools")
or bsd::errx(1, "error updating the ports infrastructure");
- $index = "$portsdir/INDEX-" . substr($release, 0, 1);
+ $moved = "$portsdir/MOVED";
+}
+
+#
+# Update the index
+#
+sub update_index() {
+
+ my $ifn; # Index file name
+
+ $ifn = capture(\&cmd, ("make", "-f$portsdir/Makefile", "-VINDEXFILE"));
+ if ($update) {
+ info("Retrieving $ifn");
+ cmd(&PATH_FETCH, $verbose ? "-mv" : "-m", "-o$portsdir/$ifn.www",
+ "http://www.freebsd.org/ports/$ifn");
+ }
+ $index = "$portsdir/$ifn.www";
+ if (! -f $index) {
+ $index = "$portsdir/$ifn";
+ }
if (! -f $index) {
$index = "$portsdir/INDEX";
}
- $moved = "$portsdir/MOVED";
}
#
@@ -357,6 +376,7 @@ sub read_index() {
my $line; # Line from file
return if ($have_index);
+ update_index();
info("Reading $index");
sysopen(INDEX, $index, O_RDONLY)
or bsd::err(1, "can't open $index");
@@ -1177,9 +1197,9 @@ MAIN:{
bsd::errx(1, "No CVS root, please use the -r option or set \$CVSROOT");
}
- # Step 1: update the ports index
+ # Step 1: update the ports tree infrastructure
$release = `uname -r`;
- update_index();
+ update_root();
# Step 2: build list of explicitly required ports
foreach my $arg (@ARGV) {