From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Feb 6 23:50:20 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F87B16A4CE for ; Fri, 6 Feb 2004 23:50:20 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E56D043D2F for ; Fri, 6 Feb 2004 23:50:19 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i177oJbv010481 for ; Fri, 6 Feb 2004 23:50:19 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i177oJpb010480; Fri, 6 Feb 2004 23:50:19 -0800 (PST) (envelope-from gnats) Date: Fri, 6 Feb 2004 23:50:19 -0800 (PST) Message-Id: <200402070750.i177oJpb010480@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: "Gerard O'Donnell" Subject: RE: Re: ports/62302: SIZE in distinfos causes failure with FETCH_CMD=wget X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Gerard O'Donnell List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2004 07:50:20 -0000 The following reply was made to PR ports/62302; it has been noted by GNATS. From: "Gerard O'Donnell" To: , Cc: Subject: RE: Re: ports/62302: SIZE in distinfos causes failure with FETCH_CMD=wget Date: Sat, 7 Feb 2004 17:14:32 +1030 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C3ED9D.DDFB7B00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Further to email previously, attached is a perl script if anyone wants to use to traverse the ports tree to strip SIZE information from the distinfo files so that wget works. Usage is stripSIZE.pl e.g: stripSIZE.pl /usr/ports ------=_NextPart_000_0000_01C3ED9D.DDFB7B00 Content-Type: application/octet-stream; name="stripSIZE.pl" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="stripSIZE.pl" #!/usr/bin/perl -w use integer; use strict; use Cwd; use Digest::MD5; # ------------------------------------------------------------------- my($hashRef) =3D {}; my $increment =3D "0000"; my($dirName) =3D join(' ', @ARGV) || die("Usage: $0 \n"); $hashRef =3D &process($hashRef, $dirName); print "All done!\n"; # ------------------------------------------------------------------- sub process { my($hashRef, $dirName) =3D @_; $dirName =3D~ tr|\\|/|; my($cwd) =3D cwd(); chdir($dirName) || die("Can't chdir($dirName): $!"); opendir(INX, '.') || die("Can't open($dirName): $!"); my(@fileName) =3D readdir(INX); closedir(INX); my($fileName); =20 =20 for $fileName (@fileName) { #print "Got $fileName.\n"; if ($fileName =3D~ /distinfo/i && $fileName !~ /^distinfo.*bak$/i) { print "Got $dirName/$fileName.\n"; open(INX, $fileName) || croak("Can't open($fileName): $!"); my(@line) =3D ; my $linee; my $hasSize =3D 0; foreach $linee( @line) { if ($linee =3D~ /^SIZE.*=3D.*[0-9]+/) { $hasSize =3D 1; print "HAS SIZE.\n"; } #print "$linee"; } close(INX); =20 if ($hasSize) { my $old =3D $fileName; my $new =3D "$fileName.tmp"; my $bak =3D "$fileName.bak"; open(OLD, "< $old") or die "can't open $old: $!"; open(NEW, "> $new") or die "can't open $new: $!"; # Correct typos, preserving case while () { chomp if /^SIZE.*=3D.*[0-9]+/; s/^SIZE.*=3D.*[0-9]+//g; (print NEW $_) or die "can't write to $new: $!"; } close(OLD) or die "can't close $old: $!"; close(NEW) or die "can't close $new: $!"; rename($old, $bak) or die "can't rename $old to $bak: $!"; rename($new, $old) or die "can't rename $new to $old: $!"; $hasSize =3D 0; } } # Skip ., .. next if ($fileName =3D~ /(^\.\.?)$/i); # Recurse on directories. ($hashRef =3D &process($hashRef, "$dirName/$fileName") ), next if = (-d $fileName); $increment++; if (! defined($$hashRef{$dirName}) ) { $$hashRef{$dirName} =3D {}; $$hashRef{$dirName}{$fileName} =3D {}; } } chdir($cwd) || die("Can't chdir($cwd): $!"); $hashRef; } # End of process. #-------------------------------------------------------------------- # Read a file. Pass in $chomp =3D=3D 0 to stop chomping. sub readFile { my($fileName, $chomp) =3D @_; $chomp =3D 1 if ($#_ =3D=3D 0); open(INX, $fileName) || croak("Can't open($fileName): $!"); my(@line) =3D ; close(INX); chomp(@line) if ($chomp !=3D 0); \@line; } # End of readFile. #-------------------------------------------------------------------- ------=_NextPart_000_0000_01C3ED9D.DDFB7B00--