Changeset 13


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

Deal with rpm build process

Location:
devel
Files:
2 added
3 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 {
  • devel/pb/lib/common.pm

    r11 r13  
    1818use Data::Dumper;
    1919
    20 $ENV{'PBCONF'} = "/etc/pb";
     20$ENV{'PBETC'} = "/etc/pb";
    2121
    2222sub env_init {
     
    3838# Use project configuration file
    3939#
    40 pb_init("$ENV{'PBCONF'}/$proj.pb");
     40pb_init("$ENV{'PBETC'}/$proj.pb");
    4141
    4242#
    4343# Check content
    4444#
    45 die "PBROOT doesn't exist in $ENV{'PBCONF'}/$proj.pb" if (not (defined $ENV{'PBROOT'}));
    46 die "defpkgdir doesn't exist in $ENV{'PBCONF'}/$proj.pb" if (not (defined %defpkgdir));
     45die "PBROOT doesn't exist in $ENV{'PBETC'}/$proj.pb" if (not (defined $ENV{'PBROOT'}));
     46die "defpkgdir doesn't exist in $ENV{'PBETC'}/$proj.pb" if (not (defined %defpkgdir));
    4747
    4848#
  • devel/pb/lib/distro.pm

    r11 r13  
    2323($ddir, $dver) = distro_get() if ((not defined $ddir) || (not defined $dver));
    2424
     25# There shold be unicity of names between ddir dfam and dtype
     26# In case of duplicate, bad things can happen
    2527if (($ddir =~ /debian/) ||
    2628    ($ddir =~ /ubuntu/)) {
    27     $dfam="debian";
     29    $dfam="du";
    2830    $dtype="deb";
    2931    $dsuf=".$ddir$dver";
    3032} elsif ($ddir =~ /gentoo/) {
    31     $dfam="gentoo";
     33    $dfam="gen";
    3234    $dtype="ebuild";
    3335    my $dver1 = $dver;
     
    3537    $dsuf=".$ddir$dver1";
    3638} elsif ($ddir =~ /slackware/) {
    37     $dfam="slackware";
     39    $dfam="slack";
    3840    $dtype="tgz";
    3941    $dsuf=".$dfam$dver";
    4042} elsif (($ddir =~ /suse/) ||
    4143        ($ddir =~ /sles/)) {
    42     $dfam="suse";
     44    $dfam="novell";
    4345    $dtype="rpm";
    4446    $dsuf=".$ddir$dver";
     
    4749        ($ddir =~ /fedora/) ||
    4850        ($ddir =~ /centos/)) {
    49     $dfam="redhat";
     51    $dfam="rh";
    5052    $dtype="rpm";
    5153    my $dver1 = $dver;
     
    6062} elsif (($ddir =~ /mandrake/) ||
    6163        ($ddir =~ /mandriva/)) {
    62     $dfam="mandriva";
     64    $dfam="md";
    6365    $dtype="rpm";
    6466    if ($ddir =~ /mandrake/) {
     
    7072    }
    7173} elsif ($ddir =~ /freebsd/) {
    72     $dfam="freebsd";
     74    $dfam="bsd";
    7375    $dtype="port";
    7476    my $dver1 = $dver;
Note: See TracChangeset for help on using the changeset viewer.