Changeset 409 in ProjectBuilder for devel/pb/lib/ProjectBuilder/CMS.pm
- Timestamp:
- Apr 25, 2008, 3:13:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/lib/ProjectBuilder/CMS.pm
r405 r409 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 pb_cms_create_authors);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); 32 32 33 33 =pod … … 35 35 =head1 NAME 36 36 37 ProjectBuilder::CMS, part of the project-builder.org - module dealing with configuration management system functions suitable for pbinit calls.37 ProjectBuilder::CMS, part of the project-builder.org 38 38 39 39 =head1 DESCRIPTION … … 41 41 This modules provides configuration management system functions suitable for pbinit calls. 42 42 43 =cut 44 45 # Setup environment for CMS system for URL passed 43 =head1 USAGE 44 45 =over 4 46 47 =item B<pb_cms_init> 48 49 This function setup the environment for the CMS system related to the URL given by the pburl configuration parameter. 50 The potential parameter indicates whether we should inititate the context or not. 51 It sets up environement variables (PBPROJDIR, PBDIR, PBREVISION, PBCMSLOGFILE) 52 53 =cut 54 46 55 sub pb_cms_init { 47 56 … … 95 104 return($scheme,$pburl->{$ENV{'PBPROJ'}}); 96 105 } 106 107 =item B<pb_cms_export> 108 109 This function exports a CMS content to a directory. 110 The first parameter is the URL of the CMS content. 111 The second parameter is the directory in which it is locally exposed (result of a checkout). 112 The third parameter is the directory where we want to deliver it (result of export). 113 114 =cut 97 115 98 116 sub pb_cms_export { … … 186 204 } 187 205 188 # This function is only called with a real CMS system 206 =item B<pb_cms_get_uri> 207 208 This function is only called with a real CMS system and gives the URL stored in the checked out directory. 209 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 210 The second parameter is the directory in which it is locally exposed (result of a checkout). 211 212 =cut 213 189 214 sub pb_cms_get_uri { 190 215 … … 234 259 } 235 260 261 =item B<pb_cms_copy> 262 263 This function copies a CMS content to another. 264 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 265 The second parameter is the URL of the original CMS content. 266 The third parameter is the URL of the destination CMS content. 267 268 Only coded for SVN now. 269 270 =cut 271 236 272 sub pb_cms_copy { 237 273 my $scheme = shift; … … 248 284 } 249 285 286 =item B<pb_cms_checkout> 287 288 This function checks a CMS content out to a directory. 289 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 290 The second parameter is the URL of the CMS content. 291 The third parameter is the directory where we want to deliver it (result of export). 292 293 =cut 294 250 295 sub pb_cms_checkout { 251 296 my $scheme = shift; … … 264 309 } 265 310 311 =item B<pb_cms_up> 312 313 This function updates a local directory with the CMS content. 314 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 315 The second parameter is the directory to update. 316 317 =cut 318 266 319 sub pb_cms_up { 267 320 my $scheme = shift; … … 272 325 } elsif ($scheme eq "flat") { 273 326 } elsif ($scheme =~ /^cvs/) { 274 } else { 275 die "cms $scheme unknown"; 276 } 277 } 327 pb_system("cvs up $dir","Updating $dir"); 328 } else { 329 die "cms $scheme unknown"; 330 } 331 } 332 333 =item B<pb_cms_checkin> 334 335 This function updates a CMS content from a local directory. 336 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 337 The second parameter is the directory to update from. 338 339 =cut 278 340 279 341 sub pb_cms_checkin { … … 286 348 } elsif ($scheme eq "flat") { 287 349 } elsif ($scheme =~ /^cvs/) { 350 pb_system("cvs ci -m \"updated to $ver\" $dir","Checking in $dir"); 288 351 } else { 289 352 die "cms $scheme unknown"; … … 291 354 pb_cms_up($scheme,$dir); 292 355 } 356 357 =item B<pb_cms_isdiff> 358 359 This function returns a integer indicating the number f differences between the CMS content and the local directory where it's checked out. 360 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 361 The second parameter is the directory to consider. 362 363 =cut 293 364 294 365 sub pb_cms_isdiff { … … 318 389 } 319 390 320 # 321 # Return the list of packages we are working on in a CMS action 322 # 391 =item B<pb_cms_isdiff> 392 393 This function returns the list of packages we are working on in a CMS action. 394 The first parameter is the default list of packages from the configuration file. 395 The second parameter is the optional list of packages from the configuration file. 396 397 =cut 398 323 399 sub pb_cms_get_pkg { 324 400 … … 340 416 } 341 417 342 # 343 # Check pbconf/project cms compliance 344 # 418 =item B<pb_cms_compliant> 419 420 This function checks the compliance of the project and the pbconf directory. 421 The first parameter is the key name of the value that needs to be read in the configuration file. 422 The second parameter is the environment variable this key will populate. 423 The third parameter is the location of the pbconf dir. 424 The fourth parameter is the URI of the CMS content related to the pbconf dir. 425 The fifth parameter indicates whether we should inititate the context or not. 426 427 =cut 428 345 429 sub pb_cms_compliant { 346 430 … … 403 487 } 404 488 489 =item B<pb_cms_create_authors> 490 491 This function creates a AUTHORS files for the project. It call it AUTHORS.pb if an AUTHORS file already exists. 492 The first parameter is the source file for authors information. 493 The second parameter is the directory where to create the final AUTHORS file. 494 The third parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 495 496 =cut 497 405 498 sub pb_cms_create_authors { 406 499 … … 411 504 return if ($authors eq "/dev/null"); 412 505 open(SAUTH,$authors) || die "Unable to open $authors"; 413 # Save a potentially existing AUTHORS file and write instead to iAUTHORS.pb506 # Save a potentially existing AUTHORS file and write instead to AUTHORS.pb 414 507 my $ext = ""; 415 508 if (-f "$dest/AUTHORS") { … … 438 531 } 439 532 533 =item B<pb_cms_log> 534 535 This function creates a ChangeLog file for the project. 536 The first parameter is the schema of the CMS systems (svn, cvs, svn+ssh, ...) 537 The second parameter is the directory where the CMS content was checked out. 538 The third parameter is the directory where to create the final ChangeLog file. 539 The fourth parameter is unused. 540 The fifth parameter is the source file for authors information. 541 542 It may use a tool like svn2cl or cvs2cl to generate it if present, or the log file from the CMS if not. 543 544 =cut 545 546 440 547 sub pb_cms_log { 441 548 … … 483 590 } 484 591 592 =back 593 594 =head1 WEB SITES 595 596 The main Web site of the project is available at L<http://www.project-builder.org/>. Bug reports should be filled using the trac instance of the project at L<http://trac.project-builder.org/>. 597 598 =head1 USER MAILING LIST 599 600 None exists for the moment. 601 602 =head1 AUTHORS 603 604 The Project-Builder.org team L<http://trac.project-builder.org/> lead by Bruno Cornec L<mailto:bruno@project-builder.org>. 605 606 =head1 COPYRIGHT 607 608 Project-Builder.org is distributed under the GPL v2.0 license 609 described in the file C<COPYING> included with the distribution. 610 611 =cut 612 485 613 1;
Note:
See TracChangeset
for help on using the changeset viewer.