Changeset 1985

Show
Ignore:
Timestamp:
12/13/07 11:00:55 (5 months ago)
Author:
joshr
Message:

modified to put .src.rpms in $tardir, and clean them up with same
rules as tarballs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • swish_website/bin/swish-daily.pl

    r1984 r1985  
    6767    [ \&make_install, 'Run make install' ], 
    6868    [ \&make_dist,    "Run make dist and move tarball to $config{tardir}"  ], 
    69     [ \&make_src_rpm, "Build swish-e .src.rpm" ], 
     69    [ \&make_src_rpm, "Build swish-e .src.rpm and move it to $config{tardir}" ], 
    7070    [ \&set_symlink,  "Make symlink $config{symlink} point to $config{day_dir}" ], 
    7171    [ \&remove_day_dir, "Remove old install and build directories" ], 
     
    223223 
    224224    log_message( "new .src.rpm build in $rpmbuilddir/SRPMS" ); 
     225 
     226    # now move the .src.rpm to the tardir 
     227    run_command( "mv $rpmbuilddir/SRPMS/swish-e-*.src.rpm $c->{tardir}" ); 
    225228} 
    226229 
     
    336339 
    337340    # purge old ones 
    338     purge_old_tarballs( $c ) if $c->{remove}; 
     341    purge_old_tarballs_and_srpms( $c ) if $c->{remove}; 
    339342 
    340343    return 1; 
    341344} 
    342345 
    343 sub purge_old_tarballs
     346sub purge_old_tarballs_and_srpms
    344347    my $c = shift; 
    345348    opendir( DIR, $c->{tardir} ) || die "Failed to open tardir: $!"; 
     
    350353    my @deletes; 
    351354    while ( my $file = readdir( DIR ) ) { 
    352         next unless $file =~ /^swish-e.*\.tar\.gz$/
     355        next unless ($file =~ /^swish-e.*\.tar\.gz$/ || $file =~/^swish-e.*\.src\.rpm$/)
    353356        next if (stat "$c->{tardir}/$file")[9] > $old; 
    354357        push @deletes, "$c->{tardir}/$file"; 
     
    357360 
    358361    for ( @deletes ) { 
     362        my ($type) = ($_ =~ /tar\.gz$/ ? "tar" : "srpm"); 
    359363        print unlink( $_ ) 
    360                 ? "Deleted old tar file '$_'\n" 
    361                 : "Failed to delete old tar '$_': $!\n"; 
     364                ? "Deleted old $type file '$_'\n" 
     365                : "Failed to delete old $type '$_': $!\n"; 
    362366    } 
    363367