Changeset 204


Ignore:
Timestamp:
Oct 14, 2007, 8:20:11 PM (12 years ago)
Author:
bruno
Message:

Coding of newver in progress

Location:
devel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r203 r204  
    2424use ProjectBuilder::Distribution qw (pb_distro_init);
    2525use ProjectBuilder::Version qw (pb_version_init);
    26 use ProjectBuilder::Base qw (pb_conf_read pb_conf_get pb_cms_init pb_mkdir_p pb_system pb_rm_rf pb_get_filters pb_filter_file pb_filter_file_pb pb_cms_export pb_cms_log);
     26use ProjectBuilder::Base qw (pb_conf_read pb_conf_get pb_cms_init pb_mkdir_p pb_system pb_rm_rf pb_get_filters pb_filter_file pb_filter_file_pb pb_cms_export pb_cms_log pb_cms_isdiff pb_cms_copy pb_cms_checkout);
    2727
    2828my %opts;                   # CLI Options
     
    695695sub pb_newver {
    696696
     697    die "-V Version parameter needed" if ((not defined $newver) || ($newver eq ""));
    697698    my $cms=pb_cms_init($ENV{'PBPROJ'});
    698699    if ($cms->{$ENV{'PBPROJ'}} ne "svn") {
     
    702703    die "You need to have no differences before creating a new version" if ($res != 0);
    703704    my $cmsurl = pb_cms_getinfo($cms);
    704     my $newurl = dirname($cmsurl).$newver;
    705     pb_cms_copy($cmsurl,$newurl);
    706     pb_cms_checkout($newurl);
     705    my $newurl = dirname($cmsurl)."/$newver";
     706    pb_cms_copy($cms,$cmsurl,$newurl);
     707    pb_cms_checkout($cms,$newurl,"$ENV{'PBROOT'}/..");
    707708}
    708709
  • devel/pb/lib/ProjectBuilder/Base.pm

    r199 r204  
    354354}
    355355}
    356    
    357 
     356
     357sub pb_cms_getinfo {
     358my $cms = shift;
     359my $url = "";
     360my $void = "";
     361
     362if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
     363    open(PIPE,"LANGUAGE=C svn info $ENV{'PBROOT'} |") || die "Unable to get svn info from $ENV{'PBROOT'}";
     364    while (<PIPE>) {
     365        ($void,$url) = split(/^Repository Root:/) if (/^Repository Root:/);
     366    }
     367    close(PIPE);
     368} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
     369} else {
     370    die "cms $cms->{$ENV{'PBPROJ'}} unknown";
     371}
     372return($url);
     373}
     374
     375sub pb_cms_copy {
     376my $cms = shift;
     377my $oldurl = shift;
     378my $newurl = shift;
     379
     380if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
     381    pb_system("svn copy $oldurl $newurl","Copying $oldurl to $newurl ");
     382} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
     383} else {
     384    die "cms $cms->{$ENV{'PBPROJ'}} unknown";
     385}
     386}
     387
     388sub pb_cms_checkout {
     389my $cms = shift;
     390my $url = shift;
     391my $destination = shift;
     392
     393if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
     394    pb_system("svn co $url $destination","Checking $url to $destination ");
     395} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
     396} else {
     397    die "cms $cms->{$ENV{'PBPROJ'}} unknown";
     398}
     399}
     400
     401sub pb_cms_isdiff {
     402my $cms = shift;
     403
     404if ($cms->{$ENV{'PBPROJ'}} eq "svn") {
     405    open(PIPE,"svn diff $ENV{'PBROOT'} |") || die "Unable to get svn diff from $ENV{'PBROOT'}";
     406    my $l = 0;
     407    while (<PIPE>) {
     408        $l++;
     409    }
     410    return($l);
     411} elsif ($cms->{$ENV{'PBPROJ'}} eq "cvs") {
     412} else {
     413    die "cms $cms->{$ENV{'PBPROJ'}} unknown";
     414}
     415}
    358416
    359417# Get all filters to apply
  • devel/pbconf/project-builder/rpm/project-builder.spec

    r203 r204  
    3838
    3939%install
    40 make install
     40%makeinstall_std
    4141
    4242%clean
Note: See TracChangeset for help on using the changeset viewer.