Author: ranger
Date: Sat Nov  3 18:34:30 2007
New Revision: 1032

URL: 
http://svn.finkproject.org/websvn/listing.php?sc=1&rev=1032&repname=user%3a+ranger
Log:
changes from dmakcs

Modified:
    trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl

Modified: trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl
URL: 
http://svn.finkproject.org/websvn/diff.php?path=/trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl&rev=1032&repname=user%3a+ranger
==============================================================================
--- trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl 
(original)
+++ trunk/experimental/scripts/generate-distfiles-and-finkinfo-mirror.pl Sat 
Nov  3 18:34:30 2007
@@ -16,6 +16,7 @@
        our $SVNROOT     = '/home/ranger/cvs/rangerrick';
 
        our $WORKDIR  = '/tmp/mirror-work';
+       our $LOGFILE  = '/tmp/mirror.log';
 }
 
 use lib $FINKROOT . '/perlmod';
@@ -36,10 +37,16 @@
 mkpath($WORKDIR . '/Fink');
 
 open (LOCKFILE, '>>' . $WORKDIR . '/mirror.lock') or die "could not open 
lockfile for append: $!";
-my $return = flock(LOCKFILE, LOCK_EX | LOCK_NB);
-die "another process is already running" if (not $return);
-
-open (LOG, '>/tmp/mirror.log');
+if (not flock(LOCKFILE, LOCK_EX | LOCK_NB)) {
+       my $msg = "Another process is already running.\n";
+       if (-f $LOGFILE && -r _) {
+               $msg .= "End of existing logfile:\n";
+               $msg .= `tail -n 10 $LOGFILE`;
+       }
+       die $msg;
+}
+
+open (LOG, '>', $LOGFILE);
 print LOG "- $0 starting " . scalar(localtime(time)) . "\n";
 
 use vars qw(
@@ -108,9 +115,10 @@
 opendir(DIR, $CHECKOUTDIR . '/dists') or die "unable to read from 
$CHECKOUTDIR/dists: $!";
 for my $dir (readdir(DIR))
 {
-       if ($dir =~ /^10/)
-       {
-               next if ($dir =~ /^10.2/);
+#      if ($dir =~ /^10/)
+       if ($dir eq '10.3' or $dir eq '10.4')
+       {
+#              next if ($dir =~ /^10.2/);
                print LOG "searching $dir\n";
                finddepth( { wanted => \&find_fetch_infofile, follow => 1 }, 
$CHECKOUTDIR . '/dists/' . $dir);
        }
@@ -127,6 +135,7 @@
        my $dist;
        my $all_downloads_passed = 1;
 
+       # dmacks ponders: doesn't the first of these make the second and third 
un-necessary?
        return unless ( $File::Find::name =~ m#\.info$# );
        return if     ( $File::Find::name =~ m#/CVS/# );
        return if     ( $File::Find::name =~ m#/10.2(-gcc3.3)?/# );


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to