Changeset 13 for devel/pb/bin/pb.pl


Ignore:
Timestamp:
Jul 30, 2007, 1:32:55 PM (12 years ago)
Author:
bruno
Message:

Deal with rpm build process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb.pl

    r11 r13  
    1515use Data::Dumper;
    1616use English;
     17use Time::localtime qw(localtime);
     18use POSIX qw(strftime);
    1719
    1820use lib qw (lib etc);
     
    127129            print " OK\n";
    128130        }
     131        my @date=(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst());
     132        my $pbdate = strftime("%Y-%m-%d", @date);
     133
    129134        open(D,"$ENV{'PBCONF'}/DISTROS") || die "Unable to find $ENV{'PBCONF'}/DISTROS\n";
    130135        while (<D>) {
     
    135140            my ($ddir, $dver, $dfam, $dtype, $dsuf) = distro_init($dir,$ver);
    136141            #print Dumper($ddir, $dver, $dfam, $dtype, $dsuf);
     142            #print "Filtering DDD => $pbdate, TTT => $tag, RRR => $tag$dsuf, VVV => $v\n";
     143
     144            # Filter build files from the most precise up to the less
     145            # Filter all files found, keeping the name, and generating in dest
     146            my @bfiles;
     147            print "dir: $ENV{'PBCONF'}/$p/$ddir-$dver\n";
     148            if (-d "$ENV{'PBCONF'}/$p/$ddir-$dver") {
     149                opendir(BDIR,"$ENV{'PBCONF'}/$p/$ddir-$dver" || die "Unable to open dir $ENV{'PBCONF'}/$p/$ddir-$dver: $!");
     150                @bfiles = grep { ! /^\./ && -f "$ENV{'PBCONF'}/$p/$ddir-$dver/$_" } readdir(BDIR);
     151                closedir(BDIR);
     152            } elsif (-d "$ENV{'PBCONF'}/$p/$ddir") {
     153                opendir(BDIR,"$ENV{'PBCONF'}/$p/$ddir" || die "Unable to open dir $ENV{'PBCONF'}/$p/$ddir: $!");
     154                @bfiles = grep { ! /^\./ && -f "$ENV{'PBCONF'}/$p/$ddir/$_" } readdir(BDIR);
     155                closedir(BDIR);
     156            } elsif (-d "$ENV{'PBCONF'}/$p/$dfam") {
     157                opendir(BDIR,"$ENV{'PBCONF'}/$p/$dfam" || die "Unable to open dir $ENV{'PBCONF'}/$p/$dfam: $!");
     158                @bfiles = grep { ! /^\./ && -f "$ENV{'PBCONF'}/$p/$dfam/$_" } readdir(BDIR);
     159                closedir(BDIR);
     160            } elsif (-d "$ENV{'PBCONF'}/$p/$dtype") {
     161                opendir(BDIR,"$ENV{'PBCONF'}/$p/$dtype" || die "Unable to open dir $ENV{'PBCONF'}/$p/$dtype: $!");
     162                @bfiles = grep { ! /^\./ && -f "$ENV{'PBCONF'}/$p/$dtype/$_" } readdir(BDIR);
     163                closedir(BDIR);
     164            } else {
     165                print "No Build Files found for $ddir-$dver\n";
     166                next;
     167            }
     168
    137169        }
    138170        close(D);
     171
    139172    }
    140173} else {
Note: See TracChangeset for help on using the changeset viewer.