diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-11-20 22:03:26 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-11-20 22:03:26 +0000 |
commit | f7f1b3ae26aded645bd1ff771cfa5c2a7af94efe (patch) | |
tree | 1c1450fd420d16b540fc89066f8301c25c2916b0 /ports-mgmt | |
parent | 61eded1947b44cfec63c05d9246bf0ef420bbffb (diff) | |
download | ports-f7f1b3ae26aded645bd1ff771cfa5c2a7af94efe.tar.gz ports-f7f1b3ae26aded645bd1ff771cfa5c2a7af94efe.zip |
Notes
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/porteasy/Makefile | 2 | ||||
-rw-r--r-- | ports-mgmt/porteasy/src/porteasy.pl | 23 |
2 files changed, 18 insertions, 7 deletions
diff --git a/ports-mgmt/porteasy/Makefile b/ports-mgmt/porteasy/Makefile index 4f86b3f3fc39..c27e404fa916 100644 --- a/ports-mgmt/porteasy/Makefile +++ b/ports-mgmt/porteasy/Makefile @@ -8,7 +8,7 @@ # PORTNAME= porteasy -PORTVERSION= 2.8.1 +PORTVERSION= 2.8.2 CATEGORIES= misc MASTER_SITES= # none DISTFILES= # none diff --git a/ports-mgmt/porteasy/src/porteasy.pl b/ports-mgmt/porteasy/src/porteasy.pl index 7a14ab9e3be8..3801b5d5cdd6 100644 --- a/ports-mgmt/porteasy/src/porteasy.pl +++ b/ports-mgmt/porteasy/src/porteasy.pl @@ -33,7 +33,7 @@ use strict; use Fcntl; use Getopt::Long; -my $VERSION = "2.8.1"; +my $VERSION = "2.8.2"; my $COPYRIGHT = "Copyright (c) 2000-2004 Dag-Erling Smørgrav. " . "All rights reserved."; @@ -42,6 +42,7 @@ sub ANONCVS_ROOT { ":ext:anoncvs\@anoncvs.FreeBSD.org:/home/ncvs" } sub REQ_EXPLICIT { 1 } sub REQ_IMPLICIT { 2 } +sub PATH_BZIP2 { "/usr/bin/bzip2" } sub PATH_CVS { "/usr/bin/cvs" } sub PATH_FETCH { "/usr/bin/fetch" } sub PATH_LDCONFIG { "/sbin/ldconfig" } @@ -352,11 +353,21 @@ 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", - "http://www.freebsd.org/ports/$ifn"); + cd($portsdir); + $ifn = capture(\&cmd, ("make", "-VINDEXFILE")); + if ($update || ! -f $ifn) { + my $izfn = "$ifn.bz2"; + info("Retrieving $izfn"); + if (!cmd(&PATH_FETCH, $verbose ? "-mv" : "-m", + "http://www.freebsd.org/ports/$izfn") || ! -f $izfn) { + bsd::errx(1, "Failed to retrieve index file"); + } + if (! -f $ifn || (stat($izfn))[9] > (stat($ifn))[9]) { + info("Decompressing $izfn"); + if (!cmd(&PATH_BZIP2, "-dfk", $izfn)) { + bsd::errx(1, "Failed to decompress index file"); + } + } } $index = "$portsdir/$ifn"; if (! -f $index) { |