Changeset 1537 in ProjectBuilder


Ignore:
Timestamp:
May 13, 2012, 11:55:55 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • 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)
  • CMS.pm: provide stack trace on error. (Eric Anderson)
Location:
devel/pb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r1511 r1537  
    4040
    4141# Global variables
     42$Global::pb_stop_on_error = 1;
    4243my %opts;                   # CLI Options
    4344my $action;                 # action to realize
     
    159160
    160161Only valid with the checkssh action, it alllows to automatically relaunch the build of the failed packages
     162
     163=item B<--no-stop-on-error>
     164
     165Continue through errors with best effort.
    161166
    162167=back
     
    460465 vmopt default = -m 384
    461466
     467=head1 COMMAND DETAILS
     468
     469=head2 newproj
     470
     471The newproj command creates a new project-builder project.  To run this command you first need to define two variables in your ~/.pbrc file:
     472
     473 pbconfurl I<project> = file:///home/anderse/.git/project-builder-config/I<project>
     474 pbdefdir default = $ENV{HOME}/cache-project-builder
     475
     476The first line defines the version controlled configuration information and the second defines the root directory for project-builder to use.
     477
     478You can then run the command:
     479
     480 % pb -p I<$project> -r I<$version> newproj
     481
     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.
     483
     484=head2 cms2build
     485
     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:
     487
     488 % pb -p $project -r $version cms2build
     489
     490To create the $pbdefdir/$project/delivery/$project-$version.{,pbconf}.tar.gz files, the $version-$projtag.pb and pbrc files in the same directory.
     491
     492=head2 build2pkg
     493
     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.
     495
     496
    462497=head1 AUTHORS
    463498
     
    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);
    502538
     
    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                # ...so 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    }
    22672307
    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/CMS.pm

    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.