Changeset 300


Ignore:
Timestamp:
Jan 27, 2008, 9:22:16 PM (11 years ago)
Author:
bruno
Message:

Adds support for supplemental files in projects (such as init scripts different for different distributions such as in collectl)

Location:
devel/pb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r298 r300  
    9999die pb_syntax() if (not defined $action);
    100100
    101 my ($pbrc, $filteredfiles, $defpkgdir, $extpkgdir);
     101my ($pbrc, $filteredfiles, $supfiles, $defpkgdir, $extpkgdir);
    102102my $pbinit = undef;
    103103$pbinit = 1 if ($action =~ /^newproj$/);
     
    106106# And get global params
    107107if (defined $opts{'p'}) {
    108     ($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $defpkgdir, $extpkgdir)
     108    ($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $supfiles, $defpkgdir, $extpkgdir)
    109109    = pb_env_init($opts{'p'},$pbinit);
    110110} else {
    111     ($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $defpkgdir, $extpkgdir)
     111    ($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $supfiles, $defpkgdir, $extpkgdir)
    112112    = pb_env_init(undef,$pbinit);
    113113}
     
    233233
    234234            # Find all build files first relatively to PBROOT
     235            # Find also all specific files referenced in the .pb conf file
    235236            my %bfiles;
     237            my %pkgfiles;
    236238            print $LOG "DEBUG dir: $ENV{'PBCONF'}/$pbpkg\n" if ($debug >= 1);
    237239            $build{"$ddir-$dver"} = "yes";
     
    242244                    $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dtype/$f";
    243245                    $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
     246                    if (defined $supfiles->{$pbpkg}) {
     247                        $pkgfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dtype/$f" if ($f =~ /$supfiles->{$pbpkg}/);
     248                    }
    244249                }
    245250                closedir(BDIR);
     
    250255                    $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dfam/$f";
    251256                    $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
     257                    if (defined $supfiles->{$pbpkg}) {
     258                        $pkgfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dfam/$f" if ($f =~ /$supfiles->{$pbpkg}/);
     259                    }
    252260                }
    253261                closedir(BDIR);
     
    258266                    $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir/$f";
    259267                    $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
     268                    if (defined $supfiles->{$pbpkg}) {
     269                        $pkgfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir/$f" if ($f =~ /$supfiles->{$pbpkg}/);
     270                    }
    260271                }
    261272                closedir(BDIR);
     
    266277                    $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver/$f";
    267278                    $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
     279                    if (defined $supfiles->{$pbpkg}) {
     280                        $pkgfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver/$f" if ($f =~ /$supfiles->{$pbpkg}/);
     281                    }
    268282                }
    269283                closedir(BDIR);
     
    280294            # destination dir depends on the type of file
    281295            if (defined $ptr) {
    282                 foreach my $f (values %bfiles) {
     296                foreach my $f (values %bfiles,values %pkgfiles) {
    283297                    pb_filter_file_pb("$ENV{'PBROOT'}/$f",$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$dtype,$pbsuf,$ENV{'PBPROJ'},$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$defpkgdir,$extpkgdir,$pbpackager,$chglog);
    284298                }
  • devel/pb/lib/ProjectBuilder/Base.pm

    r299 r300  
    9696my %extpkgdir = ();
    9797my %filteredfiles = ();
     98my %supfiles = ();
    9899
    99100if ((-f "$ENV{'PBCONF'}/$proj.pb") and (not defined $pbinit)) {
     
    102103    # Valid version names (optional)
    103104    # List of files to filter (optional)
    104     my ($defpkgdir, $extpkgdir, $version, $filteredfiles, $pkgv, $pkgt) = pb_conf_read("$ENV{'PBCONF'}/$proj.pb","defpkgdir","extpkgdir","version","filteredfiles","projver","projtag");
     105    my ($defpkgdir, $extpkgdir, $version, $filteredfiles, $supfiles, $pkgv, $pkgt) = pb_conf_read("$ENV{'PBCONF'}/$proj.pb","defpkgdir","extpkgdir","version","filteredfiles","supfiles","projver","projtag");
    105106    print "DEBUG: defpkgdir: ".Dumper($defpkgdir)."\n" if ($debug >= 1);
    106107    print "DEBUG: extpkgdir: ".Dumper($extpkgdir)."\n" if ($debug >= 1);
    107108    print "DEBUG: version: ".Dumper($version)."\n" if ($debug >= 1);
    108109    print "DEBUG: filteredfiles: ".Dumper($filteredfiles)."\n" if ($debug >= 1);
     110    print "DEBUG: supfiles: ".Dumper($supfiles)."\n" if ($debug >= 1);
    109111    die "Unable to find defpkgdir in $ENV{'PBCONF'}/$proj.pb" if (not defined $defpkgdir);
    110112    # Global
     
    115117    # Global
    116118    %filteredfiles = %$filteredfiles if (defined $filteredfiles);
     119    %supfiles = %$supfiles if (defined $supfiles);
    117120    #
    118121    # Get global Version/Tag
     
    226229#filteredfiles pkg1 = Makefile.PL
    227230#filteredfiles pkg1-doc = configure.in
     231#supfiles pkg1 = pkg1.init
    228232EOF
    229233        close(CONF);
     
    644648
    645649umask 0022;
    646 return($proj,$debug,$LOG,\%pbrc, \%filteredfiles, \%defpkgdir, \%extpkgdir);
     650return($proj,$debug,$LOG,\%pbrc, \%filteredfiles, \%supfiles, \%defpkgdir, \%extpkgdir);
    647651}
    648652
Note: See TracChangeset for help on using the changeset viewer.