Changeset 344


Ignore:
Timestamp:
Mar 31, 2008, 2:04:24 AM (11 years ago)
Author:
bruno
Message:

Lots of fixes in order to make it work for netperf from scratch (newver, cms2build, build2pkg, pbcl)

Location:
devel/pb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r341 r344  
    587587        # Possibility to look at PBSRC to guess more the filename
    588588        pb_system("tar cfz $pbpkg-$pbver.tar.gz $pbpkg-$pbver","Creating $pbpkg tar files compressed");
    589         pb_log(2,"Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n");
     589        pb_log(0,"Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n");
    590590
    591591        # Keep track of what is generated by default
  • devel/pb/lib/ProjectBuilder/Base.pm

    r343 r344  
    119119
    120120my ($pbdefdir) = pb_conf_get_if("pbdefdir");
    121 my %pbdefdir = %$pbdefdir;
    122121
    123122if (not defined $ENV{'PBDEFDIR'}) {
    124     if ((not defined $pbdefdir) || (not defined $pbdefdir{$ENV{'PBPROJ'}})) {
     123    if ((not defined $pbdefdir) || (not defined $pbdefdir->{$ENV{'PBPROJ'}})) {
    125124        pb_log(1,"WARNING: no pbdefdir defined, using /var/cache\n");
    126125        pb_log(1,"         Please create a pbdefdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
     
    129128    } else {
    130129        # That's always the environment variable that will be used
    131         $ENV{'PBDEFDIR'} = $pbdefdir{$ENV{'PBPROJ'}};
     130        $ENV{'PBDEFDIR'} = $pbdefdir->{$ENV{'PBPROJ'}};
    132131    }
    133132}
     
    225224    # transform in full path if relative
    226225    $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}/$ENV{'PBROOTDIR'}" if ($ENV{'PBROOTDIR'} !~ /^\//);
     226    pb_mkdir_p($ENV{'PBROOTDIR'}) if (defined $pbinit);
    227227    die "$ENV{'PBROOTDIR'} is not a directory" if (not -d $ENV{'PBROOTDIR'});
    228228}
     
    308308#pburl $ENV{'PBPROJ'} = dir:///src/$ENV{'PBPROJ'}-devel
    309309
     310# Check whether project is well formed
     311# (containing already a directory with the project-version name)
     312#pbwf $ENV{'PBPROJ'} = 1
     313
    310314#
    311315# Packager label
    312316#
    313 #pbpackager $ENV{'PBPROJ'} = "William Porte <bill\@$ENV{'PBPROJ'}.org>"
     317#pbpackager $ENV{'PBPROJ'} = William Porte <bill\@$ENV{'PBPROJ'}.org>
    314318#
    315319
     
    424428
    425429# PBVER is replaced by the version (\$pbver in code)
    426 #filter PBVER = \$pbver
     430filter PBVER = \$pbver
    427431
    428432# PBDATE is replaced by the date (\$pbdate in code)
    429 #filter PBDATE = \$pbdate
     433filter PBDATE = \$pbdate
    430434
    431435# PBLOG is replaced by the changelog if value is yes
     
    433437
    434438# PBTAG is replaced by the tag (\$pbtag in code)
    435 #filter PBTAG = \$pbtag
     439filter PBTAG = \$pbtag
    436440
    437441# PBREV is replaced by the revision (\$pbrev in code)
    438 #filter PBREV = \$pbrev
     442filter PBREV = \$pbrev
    439443
    440444# PBPKG is replaced by the package name (\$pbpkg in code)
    441 #filter PBPKG = \$pbpkg
     445filter PBPKG = \$pbpkg
    442446
    443447# PBPACKAGER is replaced by the packager name (\$pbpackager in code)
    444 #filter PBPACKAGER = \$pbpackager
     448filter PBPACKAGER = \$pbpackager
    445449
    446450# PBDESC contains the description of the package
     
    470474#filter PBDEP =
    471475
    472 # PBSUF is replaced by the package name (\$pbpkg in code)
    473 #filter PBSUF = \$pbsuf
     476# PBSUF is replaced by the package suffix (\$pbsuf in code)
     477filter PBSUF = \$pbsuf
    474478
    475479# PBOBS is replaced by the Obsolete line
     
    486490#
    487491# PBGRP is replaced by the group of apps
    488 #filter PBGRP = utils
     492filter PBGRP = utils
    489493
    490494# PBLIC is replaced by the license of the application
     
    507511# Specific group for Mandriva for $ENV{'PBPROJ'}
    508512# Cf: http://wiki.mandriva.com/en/Development/Packaging/Groups
    509 filter PBGRP = Archiving/Backup
     513#filter PBGRP = Archiving/Backup
    510514
    511515# PBLIC is replaced by the license of the application
     
    519523# Specific group for SuSE for $ENV{'PBPROJ'}
    520524# Cf: http://en.opensuse.org/SUSE_Package_Conventions/RPM_Groups
    521 filter PBGRP = Productivity/Archiving/Backup
     525#filter PBGRP = Productivity/Archiving/Backup
    522526
    523527# PBLIC is replaced by the license of the application
     
    593597EOF
    594598            close(CONF);
    595             open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/pkg1.dirs") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs";
     599            open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs";
    596600            print CONF << "EOF";
    597601EOF
     
    761765Source:         PBSRC
    762766BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
    763 Requires:       PBDEP
     767#Requires:       PBDEP
    764768
    765769%description
     
    10891093    pb_mkdir_p($destdir);
    10901094
     1095    # Check whether the file is well formed
     1096    # (containing already a directory with the project-version name)
     1097    my ($pbwf) = pb_conf_get_if("pbwf");
     1098    if ((defined $pbwf) && (defined $pbwf->{$ENV{'PBPROJ'}})) {
     1099        $destdir = dirname($destdir);
     1100    }
     1101
    10911102    if ($mm =~ /\/x-bzip-compressed-tar$/) {
    10921103        # tar+bzip2
     
    11051116        pb_system("cd $destdir ; unzip $path","Extracting $path in $destdir");
    11061117    }
    1107     # Maybe we created an extra level of dir under destdir
    1108     opendir(DIR,$destdir) || die "Unable to open $destdir";
    1109     my $cnt = 0;
    1110     my $d0;
    1111     foreach my $d (readdir(DIR)) {
    1112         pb_log(3,"Looking at \'$d\'...");
    1113         next if ($d =~ /^\./);
    1114         $cnt++;
    1115         $d0 = $d;
    1116     }
    1117     closedir(DIR);
    1118     # Fix that by moving everything below that extra dir under destdir
    1119     # and remove the extra dir
    1120     if ($cnt == 1) {
    1121         pb_system("cd $destdir/$d0 ; mv * .??* .. 2>/dev/null");
    1122         pb_rm_rf("$destdir/$d0");
    1123     }
    11241118} elsif ($scheme =~ /^cvs/) {
    11251119    # CVS needs a relative path !
     
    13011295if ($scheme =~ /^svn/) {
    13021296    pb_system("svn co $url $destination","Checking out $url to $destination ");
    1303 } elsif ($scheme eq "flat") {
     1297} elsif (($scheme eq "ftp") || ($scheme eq "http")) {
     1298    return;
    13041299} elsif ($scheme =~ /^cvs/) {
     1300    pb_system("cvs co $url $destination","Checking out $url to $destination ");
    13051301} else {
    13061302    die "cms $scheme unknown";
     
    13541350my $ddir = shift || "";
    13551351my $dver = shift || "";
    1356 my $ptr; # returned value pointer on the hash of filters
    1357 my %ptr;
     1352my $ptr = undef; # returned value pointer on the hash of filters
    13581353my %h;
    13591354
     
    14011396        pb_log(2,"DEBUG f:".Dumper($ptr)."\n");
    14021397    }
    1403 } else {
    1404     $ptr = { };
    1405 }
    1406 %ptr = %$ptr;
    1407 return(\%ptr);
     1398}
     1399return($ptr);
    14081400}
    14091401
     
    15911583
    15921584if ((! -d "$ENV{$envar}") || (defined $pbinit)) {
    1593     pb_log(1,"Checking out $uri\n");
    1594     pb_cms_checkout($scheme,$uri,$ENV{$envar});
     1585    if (defined $pbinit) {
     1586        pb_mkdir_p("$ENV{$envar}");
     1587    } else {
     1588        pb_log(1,"Checking out $uri\n");
     1589        pb_cms_checkout($scheme,$uri,$ENV{$envar});
     1590    }
    15951591} elsif (($scheme !~ /^cvs/) || ($scheme !~ /^svn/)) {
    15961592    # Do not compare if it's not a real cms
     
    16531649my $ver;
    16541650my $ver2;
    1655 my ($packager) = pb_conf_get("pbpackager");
     1651my ($pbpackager) = pb_conf_get("pbpackager");
     1652
     1653if (not defined $pbpackager->{$ENV{'PBPROJ'}}) {
     1654    $pbpackager->{$ENV{'PBPROJ'}} = "undefined\@noproject.noorg";
     1655}
    16561656
    16571657# If we don't need to do it, or don't have it fake something
     
    16631663    if (($dtype eq "rpm") || ($dtype eq "fc")) {
    16641664        $ver2 = "$pbver-$pbtag$dsuf";
    1665         print $OUTPUT "* $ndate $packager->{$ENV{'PBPROJ'}} $ver2\n";
     1665        print $OUTPUT "* $ndate $pbpackager->{$ENV{'PBPROJ'}} $ver2\n";
    16661666        print $OUTPUT "- Updated to $pbver\n";
    16671667        }
     
    16691669        print $OUTPUT "$pkg ($pbver) unstable; urgency=low\n";
    16701670        print $OUTPUT "\n";
    1671         print $OUTPUT " -- $packager->{$ENV{'PBPROJ'}}  $n2date\n\n\n";
     1671        print $OUTPUT " -- $pbpackager->{$ENV{'PBPROJ'}}  $n2date\n\n\n";
    16721672        }
    16731673    return;
     
    17121712            $ver2 = "$ver$dsuf";
    17131713        }
    1714         print $OUTPUT "* $ndate $packager->{$ENV{'PBPROJ'}} $ver2\n";
     1714        print $OUTPUT "* $ndate $pbpackager->{$ENV{'PBPROJ'}} $ver2\n";
    17151715        print $OUTPUT "- Updated to $ver\n";
    17161716        }
     
    17371737    if ($dtype eq "deb") {
    17381738        # Cf: http://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog
    1739         print $OUTPUT " -- $packager->{$ENV{'PBPROJ'}}  $n2date\n\n\n";
     1739        print $OUTPUT " -- $pbpackager->{$ENV{'PBPROJ'}}  $n2date\n\n\n";
    17401740        }
    17411741
Note: See TracChangeset for help on using the changeset viewer.