Changeset 452 in ProjectBuilder
- Timestamp:
- May 27, 2008, 1:46:52 AM (17 years ago)
- Location:
- devel/pb
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r450 r452 1331 1331 1332 1332 pb_log(2,"Checkin $ENV{'PBROOTDIR'}/../$newver\n"); 1333 pb_cms_checkin($scheme,"$ENV{'PBROOTDIR'}/../$newver" );1333 pb_cms_checkin($scheme,"$ENV{'PBROOTDIR'}/../$newver",undef); 1334 1334 } 1335 1335 -
devel/pb/lib/ProjectBuilder/CMS.pm
r448 r452 29 29 30 30 our @ISA = qw(Exporter); 31 our @EXPORT = qw(pb_cms_init pb_cms_export pb_cms_get_uri pb_cms_copy pb_cms_checkout pb_cms_up pb_cms_checkin pb_cms_isdiff pb_cms_get_pkg pb_cms_compliant pb_cms_log );31 our @EXPORT = qw(pb_cms_init pb_cms_export pb_cms_get_uri pb_cms_copy pb_cms_checkout pb_cms_up pb_cms_checkin pb_cms_isdiff pb_cms_get_pkg pb_cms_compliant pb_cms_log pb_cms_add); 32 32 33 33 =pod … … 336 336 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 337 337 The second parameter is the directory to update from. 338 The third parameter indicates if we are in a new version creation (undef) or in a new project creation (1) 338 339 339 340 =cut … … 342 343 my $scheme = shift; 343 344 my $dir = shift; 345 my $pbinit = shift || undef; 344 346 345 347 my $ver = basename($dir); 346 if ($scheme =~ /^svn/) { 347 pb_system("svn ci -m \"updated to $ver\" $dir","Checking in $dir"); 348 my $msg = "updated to $ver"; 349 $msg = "Project $ENV{PBPROJ} creation" if (defined $pbinit); 350 351 if ($scheme =~ /^svn/) { 352 pb_system("svn ci -m \"$msg\" $dir","Checking in $dir"); 348 353 } elsif ($scheme eq "flat") { 349 354 } elsif ($scheme =~ /^cvs/) { 350 pb_system("cvs ci -m \" updated to $ver\" $dir","Checking in $dir");355 pb_system("cvs ci -m \"$msg\" $dir","Checking in $dir"); 351 356 } else { 352 357 die "cms $scheme unknown"; 353 358 } 354 359 pb_cms_up($scheme,$dir); 360 } 361 362 =item B<pb_cms_add> 363 364 This function adds to a CMS content from a local directory. 365 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 366 The second parameter is the directory/file to add. 367 368 =cut 369 370 sub pb_cms_add { 371 my $scheme = shift; 372 my $f = shift; 373 374 if ($scheme =~ /^svn/) { 375 pb_system("svn add $f","Adding $f to SVN"); 376 } elsif ($scheme eq "flat") { 377 } elsif ($scheme =~ /^cvs/) { 378 pb_system("cvs add $f","Adding $f to CVS"); 379 } else { 380 die "cms $scheme unknown"; 381 } 382 pb_cms_up($scheme,$f); 355 383 } 356 384 -
devel/pb/lib/ProjectBuilder/Env.pm
r430 r452 168 168 169 169 pb_log(2,"PBDEFDIR: $ENV{'PBDEFDIR'}\n"); 170 171 # Put under CMS the PBPROJ dir 172 if (defined $pbinit) { 173 if (! -d "$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}") { 174 pb_mkdir_p("$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}") || die "Unable to recursively create $ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}"; 175 } 176 pb_cms_add($pbconf{$ENV{'PBPROJ'}},"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}"); 177 } 178 170 179 # 171 180 # Set delivery directory … … 212 221 # return values in that case are useless 213 222 # 214 if (($action =~ /^cms2/) || ($action =~ /^newver$/) || ($action =~ / ^pbinit$/)) {223 if (($action =~ /^cms2/) || ($action =~ /^newver$/) || ($action =~ /pbinit/) || ($action =~ /^newproj$/)) { 215 224 216 225 # … … 240 249 } 241 250 closedir(DIR); 242 die "No directory found under $ENV{'PBCONFDIR'}" if (not defined $ENV{'PBROOTDIR'});243 251 pb_log(1,"WARNING: no pbroot defined, using $ENV{'PBROOTDIR'}\n"); 244 252 pb_log(1," Please use -r release if you want to use another release\n"); 253 die "No directory found under $ENV{'PBCONFDIR'}" if (not defined $ENV{'PBROOTDIR'}); 245 254 } else { 246 255 my ($pbroot) = pb_conf_read_if("$ENV{'PBDESTDIR'}/pbrc","pbroot"); … … 318 327 } else { 319 328 if (defined $pbinit) { 320 my $ptr = pb_get_pkg(); 321 my @pkgs = @$ptr; 329 my @pkgs = @ARGV; 322 330 @pkgs = ("pkg1") if (not @pkgs); 323 331 … … 837 845 pb_mkdir_p("$ENV{'PBROOTDIR'}/$pp/pbfilter") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/pbfilter"; 838 846 839 pb_log(0,"\nDo not to forget to commit the pbconf directory in your CMS if needed\n");840 847 } 848 pb_cms_add($pbconf{$ENV{'PBPROJ'}},$ENV{'PBCONFDIR'}); 849 pb_cms_checkin($pbconf{$ENV{'PBPROJ'}},"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}",$pbinit); 841 850 } else { 842 851 die "Unable to open $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
Note:
See TracChangeset
for help on using the changeset viewer.