Subject: clean_setup.pl binary-only cache patch
From: Jason Tishler <[email-masked]>
To: [email-masked]
Cc: Cygwin <[email-masked]>
Date: Fri, 03 Jan 2003 09:19:27 -0500

Michael,

The attached patch enables clean_setup.pl to handle binary-only
caches/mirrors.  Specifically, when no "source:" tags are in the
setup.ini file.  AFAICT, this patch does not affect operation with a
normal setup.ini file.

I'm a Perl novice, so the second hunk probably could be improved.

Anyway, are you willing to accept this patch?

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6
--- clean_setup.pl.orig	2002-12-18 07:44:50.000000000 -0500
+++ clean_setup.pl	2002-12-18 08:37:59.000000000 -0500
@@ -410,7 +410,7 @@ my $wanted = sub {
       }
       close SETUP;
       usage( 'die', 1, "Nothing found in $sSetup" )
-         if 3 != @aSetup || ! $aSetup[0];
+         if @aSetup < 2 || ! $aSetup[0];
       $aSetup{$sRel} = \@aSetup;
    }
    elsif ( ".tar.bz2" eq substr( $_, -8 ) || ".tar.gz" eq substr( $_, -7 ) ) {
@@ -450,7 +450,11 @@ foreach ( @sOldSetup ) {
 # Check found files against those listed in latest setup.ini
 my ( @sDir, $sDir, $sFile, @sDup, %sMove, @sUnlisted, @sWrongSize );
 my %aInstall = ( %{$aSetup{$sNewest}[1]} );
-my %aSource  = ( %{$aSetup{$sNewest}[2]} );
+my %aSource;
+if (exists $aSetup{$sNewest}[2]) {
+    %aSource = ( %{$aSetup{$sNewest}[2]} );
+}
+
 foreach $sName ( sort keys %sTarBall ) {
    @sDir  = sort keys %{$sTarBall{$sName}};
    $sDir  = $sDir[0];

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/