Subversion Repositories DevTools

Rev

Rev 7387 | Rev 7394 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7387 Rev 7389
Line 107... Line 107...
107
    'tagdir'          => {'mandatory' => 1      , 'fmt' => 'dir'},
107
    'tagdir'          => {'mandatory' => 1      , 'fmt' => 'dir'},
108
    'forcedirscan'    => {'default'   => 100    , 'fmt' => 'period'},
108
    'forcedirscan'    => {'default'   => 100    , 'fmt' => 'period'},
109
    'tagMaxPackages'  => {'default'   => 10     , 'fmt' => 'int'},
109
    'tagMaxPackages'  => {'default'   => 10     , 'fmt' => 'int'},
110
    'tagage'          => {'default'   => '10d'  , 'fmt' => 'period'},
110
    'tagage'          => {'default'   => '10d'  , 'fmt' => 'period'},
111
    'cleanPeriod'     => {'default'   => '30m'  , 'fmt' => 'period'},
111
    'cleanPeriod'     => {'default'   => '30m'  , 'fmt' => 'period'},
-
 
112
    'maxFileAge'      => {'default'   => '24h'  , 'fmt' => 'period'},
-
 
113
    'txdetail'        => {'default'   => 0      , 'fmt' => 'bool'},
112
    
114
    
113
 
115
 
114
);
116
);
115
 
117
 
116
 
118
 
Line 410... Line 412...
410
    foreach my $entry  (@tarZipFiles) {
412
    foreach my $entry  (@tarZipFiles) {
411
        $entry =~ m~.*/(.*)$~;
413
        $entry =~ m~.*/(.*)$~;
412
        my $fname = $1;
414
        my $fname = $1;
413
 
415
 
414
        if (!exists $tagPkgList{$fname}) {
416
        if (!exists $tagPkgList{$fname}) {
-
 
417
 
-
 
418
            my ($mtime) = Utils::mtime($entry);
-
 
419
            my $age = time() - $mtime;
-
 
420
            $logger->verbose3( "File Age: $age, $conf->{maxFileAge}");
-
 
421
            if ( $age > $conf->{maxFileAge} ) {
415
            $logger->warn("cleanZipStore. Remove: $fname");
422
                $logger->logmsg("cleanZipStore. Remove: $fname");
416
            unlink $entry;
423
                unlink $entry;
417
            $logger->warn("cleanZipStore. Cannot Remove: $fname") if (-f $entry);
424
                $logger->warn("cleanZipStore. Cannot Remove: $fname") if (-f $entry);
-
 
425
            }
418
        } else {
426
        } else {
419
            $logger->verbose("cleanZipStore. Retain: $fname");
427
            $logger->verbose("cleanZipStore. Retain: $fname");
420
 
428
 
421
        }
429
        }
422
    }
430
    }
Line 444... Line 452...
444
    my $srcDir = catdir( $conf->{'dpkg_archive'}, $pname, $version);
452
    my $srcDir = catdir( $conf->{'dpkg_archive'}, $pname, $version);
445
    my $tgtdir = catfile( $conf->{'dpkg_archive'}, '.dpkg_archive', 'tarStore' );
453
    my $tgtdir = catfile( $conf->{'dpkg_archive'}, '.dpkg_archive', 'tarStore' );
446
    my $zfile = $pname . '__' . $version . '.tgz';
454
    my $zfile = $pname . '__' . $version . '.tgz';
447
    my $tfile = catfile($tgtdir, $zfile);
455
    my $tfile = catfile($tgtdir, $zfile);
448
    my $tfileTmp = $tfile . '.TEMP';
456
    my $tfileTmp = $tfile . '.TEMP';
-
 
457
    my $startTime = time;
449
 
458
 
450
    #
459
    #
451
    #   Does the source exist
460
    #   Does the source exist
452
    if (! -d $srcDir) {
461
    if (! -d $srcDir) {
453
        $logger->warn("Package not found: $pname, $version");
462
        $logger->warn("Package not found: $pname, $version");
Line 485... Line 494...
485
    #   Rename the TEMP file, so that the tgz file creation appears atomic
494
    #   Rename the TEMP file, so that the tgz file creation appears atomic
486
    if ($cmdRv eq 0 && -f $tfileTmp) {
495
    if ($cmdRv eq 0 && -f $tfileTmp) {
487
        rename $tfileTmp, $tfile || $logger->warn("Rename error: $tfileTmp");
496
        rename $tfileTmp, $tfile || $logger->warn("Rename error: $tfileTmp");
488
    }
497
    }
489
 
498
 
-
 
499
 
-
 
500
    #
-
 
501
    #   Display the size of the package (tarZipped)
-
 
502
    #       Diagnostic use
-
 
503
    #
-
 
504
    if ( -f $tfile && $conf->{txdetail}) {
-
 
505
        my $tzfsize = -s $tfile; 
-
 
506
        my $size = sprintf "%.3f", $tzfsize / 1024 / 1024 / 1024 ;
-
 
507
        my $duration = time - $startTime;
-
 
508
        $logger->logmsg("tarZipPackage: Stats: $pname, $version, $size Gb, $duration Secs");
-
 
509
    }
-
 
510
 
-
 
511
 
490
    if ( -f $tfile ) {
512
    if ( -f $tfile ) {
491
        $statistics{txCount}++;
513
        $statistics{txCount}++;
492
        $logger->verbose2("tarZipPackage:Done: $pname/$version");
514
        $logger->verbose2("tarZipPackage:Done: $pname/$version");
493
        $cmdRv = 1;
515
        $cmdRv = 1;
494
    } else {
516
    } else {
Line 522... Line 544...
522
    #
544
    #
523
    #   Find the tag in all blat transfer areas
545
    #   Find the tag in all blat transfer areas
524
    #   
546
    #   
525
    my $tag = "$pname::$version";
547
    my $tag = "$pname::$version";
526
    my @tagList = glob ("$tagRoot/*/$tag");
548
    my @tagList = glob ("$tagRoot/*/$tag");
-
 
549
    $logger->verbose2("triggerTransfer: $tagRoot/*/$tag: @tagList");
527
    foreach my $target ( @tagList )
550
    foreach my $target ( @tagList )
528
    {
551
    {
529
        $logger->verbose2("triggerTransfer: $target");
552
        $logger->verbose2("triggerTransfer: $target");
530
        $target =~ m~^(.*)/~;
553
        $target =~ m~^(.*)/~;
531
        my $triggerFile = catfile($1, '.trigger');
554
        my $triggerFile = catfile($1, '.trigger');