Changeset 1537

May 13, 2012, 11:55:55 AM (7 years ago)
  • pb: Set pb_stop_on_error, add option to continue through errors. Add documentation of the newproj, cms2build and build2pkg steps. Only try to apply patches if the apply script exists. Warn if we would prune to the first listed VM rather than ignoring later ones silently. Only try to sign changes files if they exist, and only try to sign things if there is something to sign. (Eric Anderson)
  • provide stack trace on error. (Eric Anderson)
2 edited


  • devel/pb/bin/pb

    r1511 r1537  
    4141# Global variables
     42$Global::pb_stop_on_error = 1;
    4243my %opts;                   # CLI Options
    4344my $action;                 # action to realize
    160161Only valid with the checkssh action, it alllows to automatically relaunch the build of the failed packages
     163=item B<--no-stop-on-error>
     165Continue through errors with best effort.
    460465 vmopt default = -m 384
     467=head1 COMMAND DETAILS
     469=head2 newproj
     471The newproj command creates a new project-builder project.  To run this command you first need to define two variables in your ~/.pbrc file:
     473 pbconfurl I<project> = file:///home/anderse/.git/project-builder-config/I<project>
     474 pbdefdir default = $ENV{HOME}/cache-project-builder
     476The first line defines the version controlled configuration information and the second defines the root directory for project-builder to use.
     478You can then run the command:
     480 % pb -p I<$project> -r I<$version> newproj
     482to create the new project. Running the newproj command will then generate the file $pbdefdir/$project/pbconf/$version/$project.pb.  You will need to edit that file in order to run any of the later commands.
     484=head2 cms2build
     486The cms2build command takes your files from the content management system and makes the two tar files that are necessary for building files. Before running this command, you need to run the newproj command, and edit the $project.pb configuration file. In particular, you need to set the pburl, pbrepo, pbwf, pbpackager, projver, projtag, testver, deliver, and defpkgdir lines as described in the configuration file. Then you can run a command like:
     488 % pb -p $project -r $version cms2build
     490To create the $pbdefdir/$project/delivery/$project-$version.{,pbconf}.tar.gz files, the $version-$projtag.pb and pbrc files in the same directory.
     492=head2 build2pkg
     494The build2pkg command takes the tar files created in the cms2build step and attempts to build the binary packages for your current operating system. In order for this step to work, you may need to edit the files in one of the $pbdefdir/$project/pbconf/$version/$project/{deb,rpm,pkg} directories. Those files will be used to try to build your package. Note that if you change those files, you need to re-run the cms2build step.
    462497=head1 AUTHORS
    499534        "version|V=s" => \$opts{'V'},
    500535        "keep|k" => \$opts{'k'},
     536        "stop-on-error!" => \$Global::pb_stop_on_error,
    501537) || pb_syntax(-1,0);
    13561392            if (@f) {
    13571393                # We have patches...
    1358                 if ($debsrcfmt =~ /^1.*/) {
     1394                my $patch_file = "debian/patches/pbapplypatch";
     1395                if (($debsrcfmt =~ /^1.*/) && (-x $patch_file)) {
    13591396                    # In that case we need to apply the patches ourselves locally
    1360                     pb_system("cat debian/patches/pbapplypatch","APPLY","verbose");
    1361                     pb_system("debian/patches/pbapplypatch","Applying patches to $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} tree");
     1397                    pb_system("cat $patch_file","APPLY","verbose");
     1398                    pb_system("$patch_file","Applying patches to $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} tree");
    13621399                }
    13631400                # modify the name of files to be Debian compliant
    22642301    die "No VM/VE/RM defined, unable to launch" if (not defined $v);
    22652302    # Keep only the first VM in case many were given
    2266     $v =~ s/,.*//;
     2303    if ($v =~ /,/) {
     2304        pb_log(0,"WARNING: pruning to just the first of several vms listed ($v)\n");
     2305        $v =~ s/,.*//;
     2306    }
    22682308    my $pbos = pb_distro_get_context($v);
    40424082    my $changes = "";
    40434083    foreach my $c (split(/ /,$made)) {
    4044         $changes .= " $ENV{'PBBUILDDIR'}/$c" if ($c =~ /\.changes$/);
     4084        $changes .= " $ENV{'PBBUILDDIR'}/$c" if (($c =~ /\.changes$/) && (-f "$ENV{PBBUILDDIR}/$c"));
    40454085    }
    40464086    my $debsigncmd = pb_check_req("debsign",1);
    4047     pb_system("$debsigncmd -m\'$ENV{'PBPACKAGER'}\' $changes","Signing DEB packages");
     4087    pb_system("$debsigncmd -m\'$ENV{'PBPACKAGER'}\' $changes","Signing DEB packages") if ($changes ne "");
    40484088} else {
    40494089    pb_log(0,"I don't know yet how to sign packages for type $pbos->{'type'}.\nPlease give feedback to dev team\n");
  • devel/pb/lib/ProjectBuilder/

    r1535 r1537  
    391391if ((defined $testver) && (defined $testver->{$ENV{'PBPROJ'}}) && ($testver->{$ENV{'PBPROJ'}} =~ /true/i)) {
    392392    if (! -f "$dest/ChangeLog") {
    393         open(CL,"> $dest/ChangeLog") || die "Unable to create $dest/ChangeLog";
     393        open(CL,"> $dest/ChangeLog") || confess "Unable to create $dest/ChangeLog";
    394394        # We need a minimal version for debian type of build
    395395        print CL "\n";
Note: See TracChangeset for help on using the changeset viewer.