source: ProjectBuilder/devel/pb/bin/pb@ 113

Last change on this file since 113 was 113, checked in by Bruno Cornec, 17 years ago

Fix some typos

  • Property svn:executable set to *
File size: 17.4 KB
Line 
1#!/usr/bin/perl -w
2#
3# Project Builder main application
4#
5# $Id$
6#
7# Copyright B. Cornec 2007
8# Provided under the GPL v2
9
10# Syntax: see at end
11
12use strict 'vars';
13use Getopt::Std;
14use Data::Dumper;
15use English;
16use AppConfig qw(:argcount :expand);
17use File::Basename;
18use File::Copy;
19use Time::localtime qw(localtime);
20use POSIX qw(strftime);
21
22# Global variables
23use lib qw (lib);
24use ProjectBuilder::Distribution qw (pb_distro_init);
25use ProjectBuilder::Changelog qw (pb_changelog);
26use ProjectBuilder::Version qw (pb_version_init);
27use 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);
28
29my %opts; # CLI Options
30my $action; # action to realize
31my $test = "FALSE";
32my $option = "";
33my @pkgs;
34my $pbtag; # Global Tag variable
35my $pbver; # Global Version variable
36my %pbver; # per package
37my %pbtag; # per package
38my $pbrev; # Global REVISION variable
39my @date=(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst());
40my $pbdate = strftime("%Y-%m-%d", @date);
41my $pbdatecvs = strftime("%Y-%m-%d %H:%M:%S", @date);
42my $debug = 0;
43my $LOG = \*STDOUT;
44
45getopts('hl:m:p:qr:tv',\%opts);
46
47my ($projectbuilderver,$projectbuilderrev) = pb_version_init();
48if (defined $opts{'h'}) {
49 pb_syntax();
50 exit(0);
51}
52if (defined $opts{'v'}) {
53 $debug++;
54}
55if (defined $opts{'q'}) {
56 $debug=-1;
57}
58if (defined $opts{'l'}) {
59 open(LOG,"> $opts{'l'}") || die "Unable to log to $opts{'l'}: $!";
60 $LOG = *LOG;
61 $debug = 0 if ($debug == -1);
62 }
63# Handles test option
64if (defined $opts{'t'}) {
65 $test = "TRUE";
66 # Works only for SVN
67 $option = "-r BASE";
68}
69
70# Handle root of the project if defined
71if (defined $opts{'r'}) {
72 $ENV{'PBROOT'} = $opts{'r'};
73}
74# Handle virtual machines if any
75if (defined $opts{'m'}) {
76 $ENV{'PBVM'} = $opts{'m'};
77}
78
79# Get Action
80$action = shift @ARGV;
81die pb_syntax() if (not defined $action);
82
83my ($pbrc, $filteredfiles, $defpkgdir, $extpkgdir);
84
85# Handles project name if any
86# And get global params
87if (defined $opts{'p'}) {
88 ($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $defpkgdir, $extpkgdir)
89 = pb_env_init($opts{'p'});
90} else {
91 ($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $defpkgdir, $extpkgdir)
92 = pb_env_init();
93}
94
95print $LOG "Project: $ENV{'PBPROJ'}\n" if ($debug >= 0);
96print $LOG "Action: $action\n" if ($debug >= 0);
97
98# Keep those project values to store them at the end each time
99my $pbprojtag = $ENV{'PBTAG'};
100my $pbprojver = $ENV{'PBVER'};
101
102# Act depending on action
103if ($action =~ /^cms2build$/) {
104 pb_cms2build();
105} elsif ($action =~ /^build2pkg$/) {
106 pb_build2pkg();
107} elsif ($action =~ /^cms2pkg$/) {
108 pb_cms2build();
109 pb_build2pkg();
110} elsif ($action =~ /^build2ssh$/) {
111 pb_build2ssh();
112} elsif ($action =~ /^pkg2ssh$/) {
113 pb_pkg2ssh();
114} elsif ($action =~ /^build2vm$/) {
115 pb_build2vm();
116} elsif ($action =~ /^cms2vm$/) {
117 pb_cms2build();
118 pb_build2vm();
119} elsif ($action =~ /^cms2ssh$/) {
120 pb_cms2build();
121 pb_build2vm();
122 pb_build2ssh();
123 pb_pkg2ssh();
124} elsif ($action =~ /^clean$/) {
125} else {
126 print $LOG "'$action' is not available\n";
127 pb_syntax();
128}
129
130sub pb_cms2build {
131
132 my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
133 @pkgs = @$ptr;
134 my $cms=pb_cms_init($ENV{'PBPROJ'});
135
136 my ($pkgv, $pkgt) = pb_conf_read("$ENV{'PBCONF'}/$ENV{'PBPROJ'}.pb","pkgver","pkgtag");
137 foreach my $pbpkg (@pkgs) {
138 if ((defined $pkgv) && (defined $pkgv->{$pbpkg})) {
139 $pbver = $pkgv->{$pbpkg};
140 } else {
141 $pbver = $ENV{'PBVER'};
142 }
143 if ((defined $pkgt) && (defined $pkgt->{$pbpkg})) {
144 $pbtag = $pkgt->{$pbpkg};
145 } else {
146 $pbtag = $ENV{'PBTAG'};
147 }
148
149 $pbrev = $ENV{'PBREVISION'};
150 print $LOG "\n";
151 print $LOG "Management of $pbpkg $pbver-$pbtag (rev $pbrev)\n";
152 die "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'});
153 # Clean up dest if necessary. The export will recreate it
154 my $dest = "$ENV{'PBDESTDIR'}/$pbpkg-$pbver";
155 pb_rm_rf($dest) if (-d $dest);
156
157 # Export CMS tree for the concerned package to dest
158 # And generate some additional files
159 $OUTPUT_AUTOFLUSH=1;
160
161 # computes in which dir we have to work
162 my $dir = $defpkgdir->{$pbpkg};
163 $dir = $extpkgdir->{$pbpkg} if (not defined $dir);
164 print "dir: $dir\n";
165 pb_cms_export($cms,$pbdatecvs,"$ENV{'PBROOT'}/$dir",$dest);
166
167 # Extract cms log history and store it
168 pb_cms_log($cms,"$ENV{'PBROOT'}/$dir","$dest/$ENV{'PBCMSLOGFILE'}");
169
170 my %build;
171
172 my ($ptr) = pb_conf_get("vmlist");
173 foreach my $d (split(/,/,$ptr->{$ENV{'PBPROJ'}})) {
174 my ($name,$ver) = split(/_/,$d);
175 chomp($ver);
176 my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($name,$ver);
177 print $LOG "DEBUG: distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf)."\n" if ($debug >= 1);
178 print $LOG "DEBUG Filtering PBDATE => $pbdate, PBTAG => $pbtag, PBVER => $pbver\n" if ($debug >= 1);
179
180 # Filter build files from the less precise up to the most with overloading
181 # Filter all files found, keeping the name, and generating in dest
182
183 # Find all build files first relatively to PBROOT
184 my %bfiles;
185 print $LOG "DEBUG dir: $ENV{'PBCONF'}/$pbpkg\n" if ($debug >= 1);
186 $build{"$ddir-$dver"} = "yes";
187 if (-d "$ENV{'PBCONF'}/$pbpkg/$dtype") {
188 opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$dtype") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$dtype: $!";
189 foreach my $f (readdir(BDIR)) {
190 next if ($f =~ /^\./);
191 $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dtype/$f";
192 $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
193 }
194 closedir(BDIR);
195 } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$dfam") {
196 opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$dfam") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$dfam: $!";
197 foreach my $f (readdir(BDIR)) {
198 next if ($f =~ /^\./);
199 $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dfam/$f";
200 $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
201 }
202 closedir(BDIR);
203 } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$ddir") {
204 opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$ddir") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$ddir: $!";
205 foreach my $f (readdir(BDIR)) {
206 next if ($f =~ /^\./);
207 $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir/$f";
208 $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
209 }
210 closedir(BDIR);
211 } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver") {
212 opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$ddir-$dver") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$ddir-$dver: $!";
213 foreach my $f (readdir(BDIR)) {
214 next if ($f =~ /^\./);
215 $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver/$f";
216 $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
217 }
218 closedir(BDIR);
219 } else {
220 $build{"$ddir-$dver"} = "no";
221 next;
222 }
223 print $LOG "DEBUG bfiles: ".Dumper(\%bfiles)."\n" if ($debug >= 1);
224
225 # Get all filters to apply
226 my $ptr = pb_get_filters($pbpkg, $dtype, $dfam, $ddir, $dver);
227
228 # Apply now all the filters on all the files concerned
229 # destination dir depends on the type of file
230 if (defined $ptr) {
231 foreach my $f (values %bfiles) {
232 pb_filter_file_pb("$ENV{'PBROOT'}/$f",$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$dtype,$pbsuf,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$defpkgdir,$extpkgdir);
233 }
234 if (defined $filteredfiles->{$pbpkg}) {
235 foreach my $f (split(/,/,$filteredfiles->{$pbpkg})) {
236 pb_filter_file("$ENV{'PBROOT'}/$dir/$f",$ptr,"$dest/$f",$pbsuf,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate);
237 }
238 }
239 }
240 }
241 if ($debug >= 0) {
242 my @found;
243 my @notfound;
244 foreach my $b (keys %build) {
245 push @found,$b if ($build{$b} =~ /yes/);
246 push @notfound,$b if ($build{$b} =~ /no/);
247 }
248 print $LOG "Build files generated for ".join(',',@found)."\n";
249 print $LOG "No Build files found for ".join(',',@notfound)."\n";
250 }
251 # Prepare the dest directory for archive
252 if (-x "$ENV{'PBCONF'}/$pbpkg/pbinit") {
253 #pb_system("cd $dest ; $ENV{'PBCONF'}/$pbpkg/pbinit","Executing init script $ENV{'PBCONF'}/$pbpkg/pbinit");
254 print $LOG "Executing init script $ENV{'PBCONF'}/$pbpkg/pbinit\n";
255 system("cd $dest ; $ENV{'PBCONF'}/$pbpkg/pbinit");
256 }
257
258 # Archive dest dir
259 chdir "$ENV{'PBDESTDIR'}" || die "Unable to change dir to $ENV{'PBDESTDIR'}";
260 # Possibility to look at PBSRC to guess more the filename
261 pb_system("tar cfz $pbpkg-$pbver.tar.gz $pbpkg-$pbver","Creating $pbpkg tar files compressed");
262 print $LOG "Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n" if ($debug >= 0);
263
264 # Keep track of what is generated for default
265 open(LAST,"> $pbrc->{$ENV{'PBPROJ'}}") || die "Unable to create $pbrc->{$ENV{'PBPROJ'}}";
266 print LAST "pbroot $pbprojver-$pbprojtag = $ENV{'PBROOT'}\n";
267 close(LAST);
268
269 # Keep track of per package version
270 if (! -f "$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") {
271 open(PKG,">$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") || die "Unable to create $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb";
272 print PKG "# Empty\n";
273 close(PKG);
274 }
275 my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
276 $pkg = { } if (not defined $pkg);
277 if ((not defined $pkg->{$pbpkg}) || ($pkg->{$pbpkg} ne "$pbver-$pbtag")) {
278 $pkg->{$pbpkg} = "$pbver-$pbtag";
279 }
280
281 print $LOG "DEBUG pkg: ".Dumper($pkg)."\n" if ($debug >= 1);
282 open(PKG,"> $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") || die "Unable to create $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb";
283 foreach my $p (keys %$pkg) {
284 print PKG "pbpkg $p = $pkg->{$p}\n";
285 }
286 close(PKG);
287 }
288}
289
290sub pb_build2pkg {
291
292 # Get list of packages to build
293 my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
294 @pkgs = @$ptr;
295
296 # Get the running distro to build on
297 my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init();
298 print $LOG "DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n" if ($debug >= 1);
299
300 # Get content saved in cms2build
301 my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
302 $pkg = { } if (not defined $pkg);
303
304 chdir "$ENV{'PBBUILDDIR'}";
305 foreach my $pbpkg (@pkgs) {
306 my $vertag = $pkg->{$pbpkg};
307 # get the version of the current package - maybe different
308 ($pbver,$pbtag) = split(/-/,$vertag);
309
310 my $src="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
311 print $LOG "Source file: $src\n" if ($debug >= 0);
312
313 if ($dtype eq "rpm") {
314 print $LOG "Working under $ENV{'PBBUILDDIR'}\n" if ($debug >= 0);
315 foreach my $d ('RPMS','SRPMS','SPECS','SOURCES','BUILD') {
316 if (! -d "$ENV{'PBBUILDDIR'}/$d") {
317 pb_mkdir_p("$ENV{'PBBUILDDIR'}/$d") || die "Please ensure that you can write into $ENV{'PBBUILDDIR'} to create $d\nchown the $ENV{'PBBUILDDIR'} directory to your uid";
318 }
319 }
320
321 # We need to first extract the spec file
322 symlink "$src","$ENV{'PBBUILDDIR'}/SOURCES/".basename($src) || die "Unable to symlink $src in $ENV{'PBBUILDDIR'}/SOURCES";
323 my @specfile;
324 @specfile = pb_extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","$ENV{'PBBUILDDIR'}/SPECS");
325
326 print $LOG "specfile: ".Dumper(\@specfile)."\n" if ($debug >= 1);
327 # set LANGUAGE to check for correct log messages
328 $ENV{'LANGUAGE'}="C";
329 #system("ls -R $ENV{'PBBUILDDIR'}") if ($debug >= 1);
330 foreach my $f (@specfile) {
331 if ($f =~ /\.spec$/) {
332 pb_system("rpmbuild --define \"_topdir $ENV{'PBBUILDDIR'}\" -ba $f","Building package with $f under $ENV{'PBBUILDDIR'}");
333 last;
334 }
335 }
336 } elsif ($dtype eq "tgz") {
337 pb_mkdir_p("$ENV{'PBBUILDDIR'}/install") if (! -d "$ENV{'PBBUILDDIR'}/install");
338 } elsif ($dtype eq "ebuild") {
339 pb_mkdir_p("$ENV{'PBBUILDDIR'}/portage") if (! -d "$ENV{'PBBUILDDIR'}/portage");
340 } else {
341 }
342 }
343}
344
345sub pb_build2ssh {
346 pb_send2ssh("Sources");
347}
348
349sub pb_pkg2ssh {
350 pb_send2ssh("Packages");
351}
352
353# By default deliver to the the public site hosting the
354# ftp structure (or whatever) or a VM
355sub pb_send2ssh {
356
357 my $cmt = shift;
358 my $host = shift || "sshhost";
359 my $login = shift || "sshlogin";
360 my $dir = shift || "sshdir";
361 my $port = shift || "sshport";
362
363 my @src;
364
365 # Get list of packages to build
366 my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
367 @pkgs = @$ptr;
368
369 # Get the running distro to build on
370 my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init();
371 print $LOG "DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n" if ($debug >= 1);
372
373 # Get content saved in cms2build
374 my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
375 $pkg = { } if (not defined $pkg);
376
377 chdir "$ENV{'PBBUILDDIR'}";
378 my $src;
379 foreach my $pbpkg (@pkgs) {
380 my $vertag = $pkg->{$pbpkg};
381 # get the version of the current package - maybe different
382 ($pbver,$pbtag) = split(/-/,$vertag);
383
384 if ($cmt eq "Sources") {
385 $src="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
386 } elsif ($cmt eq "VMs") {
387 $src="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz $ENV{'PBDESTDIR'}/pbscript $ENV{'PBETC'}";
388 } elsif ($cmt eq "Packages") {
389 if ($dtype eq "rpm") {
390 $src="$ENV{'PBBUILDDIR'}/RPMS/*/$pbpkg-$pbver-$pbtag$pbsuf.*.rpm $ENV{'PBBUILDDIR'}/SRPMS/$pbpkg-$pbver-$pbtag$pbsuf.src.rpm"
391 } elsif ($dtype eq "deb") {
392 my $tmp = "$ENV{'PBBUILDDIR'}/$pbpkg";
393 $src="$tmp"."_*.deb $tmp"."_*.dsc $tmp"."_*.tar.gz"
394 } elsif ($dtype eq "ebuild") {
395 $src="$ENV{'PBBUILDDIR'}/portage/*/$pbpkg/$pbpkg-$pbver.ebuild"
396 } elsif ($dtype eq "slackware") {
397 $src="$ENV{'PBBUILDDIR'}/build-$pbpkg/$pbpkg-$pbver-*-$pbtag.tgz"
398 } else {
399 die "Unknown dtype format $dtype";
400 }
401 # Also make a pbscript to generate yum/urpmi/apt bases
402 # $src = "$src $ENV{'PBDESTDIR'}/pbscript"
403 }
404 print $LOG "$cmt: $src\n" if ($debug >= 0);
405 push @src, $src;
406 }
407 my ($sshhost,$sshlogin,$sshdir,$sshport) = pb_conf_get($host,$login,$dir,$port);
408 my $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshhost->{$ENV{'PBPROJ'}}";
409 my $tdir;
410 if ($cmt eq "Sources") {
411 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/src";
412 } elsif ($cmt eq "VMs") {
413 $tdir = "$sshdir->{$ENV{'PBPROJ'}}";
414 } elsif ($cmt eq "Packages") {
415 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$ddir/$dver";
416 } else {
417 return;
418 }
419 $port = $sshport->{$ENV{'PBPROJ'}};
420 $src = join(' ',@src);
421 pb_system("ssh -q -p $port $mac \"mkdir -p $tdir ; cd $tdir ; rm -f $src\"","Preparing $tdir on $mac");
422 pb_system("scp -p -P $port $src $mac:$tdir","$cmt delivery in $tdir on $mac");
423 pb_system("ssh -q -p $port $mac \"cd $tdir ; if [ -f pbscript ]; then chmod 755 ./pbscript ; ./pbscript\"","Executing pbscript on $mac");
424 if ($cmt eq "VMs") {
425 pb_system("scp -p -P $port $mac:$tdir/.... ...","Package recovery in $tdir from $mac");
426 }
427}
428
429sub pb_build2vm {
430 my ($vm,$all) = pb_get_vm();
431
432 # Prepare the script to be executed on the VM
433 # in $ENV{'PBDESTDIR'}/pbscript
434 # Launch the VM
435 # Gather all required files to send them to the VM
436 pb_send2ssh("VMs","vmhost","vmlogin","vmdir","vmport");
437
438 # Send tar files when we do a global generation
439 pb_build2ssh() if ($all == 1);
440}
441
442sub pb_get_pkg {
443
444my @pkgs;
445my $defpkgdir = shift;
446my $extpkgdir = shift;
447
448# Get packages list
449if (not defined $ARGV[0]) {
450 @pkgs = keys %$defpkgdir;
451} elsif ($ARGV[0] =~ /^all$/) {
452 @pkgs = keys %$defpkgdir;
453 push(@pkgs, keys %$extpkgdir);
454} else {
455 @pkgs = @ARGV;
456}
457print $LOG "Packages: ".join(',',@pkgs)."\n" if ($debug >= 0);
458return(\@pkgs);
459}
460
461#
462# Return the list of VMs we are working on
463# $all is a flag to know if we return all of them
464# or only some (if all we publish also tar files in addition to pkgs
465#
466sub pb_get_vm {
467
468my @vm;
469my $all = 0;
470
471# Get VM list
472if ((not defined $ENV{'PBVM'}) || ($ENV{'PBVM'} =~ /^all$/)) {
473 my ($ptr) = pb_conf_get("vmlist");
474 $ENV{'PBVM'} = $ptr->{$ENV{'PBPROJ'}};
475 $all = 1;
476}
477@vm = split(/,/,$ENV{'PBVM'});
478print $LOG "VMs: ".join(',',@vm)."\n";
479return(\@vm,$all);
480}
481
482sub pb_extract_build_files {
483
484my $src=shift;
485my $dir=shift;
486my $ddir=shift;
487my @files;
488
489pb_system("tar xfpz $src $dir","Extracting build files");
490opendir(DIR,"$dir") || die "Unable to open directory $dir";
491foreach my $f (readdir(DIR)) {
492 next if ($f =~ /^\./);
493 move("$dir/$f","$ddir") || die "Unable to move $dir/$f to $ddir";
494 print $LOG "mv $dir/$f $ddir\n" if ($debug >= 1);
495 push @files,"$ddir/$f";
496}
497closedir(DIR);
498# Not enough but still a first cleanup
499pb_rm_rf("$dir");
500return(@files);
501}
502
503sub pb_syntax {
504
505 print "pb (aka project-builder) Version $projectbuilderver-$projectbuilderrev\n";
506 print "\n";
507 print "Syntax: pb [-vhqt][-r pbroot][-p project][-m \"mach-1[,...]\"] <action> [<pkg1>...]\n";
508 print "\n";
509 print "-h : This help file\n";
510 print "-q : Quiet mode\n";
511 print "-t : Test mode (not done yet)\n";
512 print "-v : Verbose mode\n";
513 print "\n";
514 print "-m machine : Name of the virtual Machines you want\n";
515 print " to build on (space separated) \n";
516 print " (or use the env variable PBVM) \n";
517 print "\n";
518 print "-p project : Name of the project you're working on\n";
519 print " (or use the env variable PBPROJ) \n";
520 print "\n";
521 print "-r pbroot : Path Name of project under the CMS \n";
522 print " (or use the env variable PBROOT) \n";
523 print "\n";
524 print "<params> can be the name of packages\n";
525 print "<action> can be:\n";
526 print "\n";
527 print "\tcms2build: Create tar files for the project under your CMS\n";
528 print "\t CMS supported are SVN and CVS\n";
529 print "\t parameters are packages to build\n";
530 print "\t if not using default list\n";
531 print "\n";
532 print "\tbuild2pkg: Create packages for your running distribution \n";
533 print "\t first parameter is version-tag to build\n";
534 print "\t if not using default version-tag\n";
535 print "\t following parameters are packages to build\n";
536 print "\t if not using default list\n";
537 print "\n";
538 print "\tbuild2ssh: Send the tar files to a SSH host \n";
539 print "\n";
540 print "\tpkg2ssh: Send the packages built to a SSH host \n";
541 print "\n";
542 print "\tcms2pkg: cms2build + build2pkg\n";
543 print "\n";
544}
Note: See TracBrowser for help on using the repository browser.