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

Last change on this file since 288 was 288, checked in by Bruno Cornec, 16 years ago
  • Document -i option
  • send packages before halting the VM (useful when you wait for them :-)
  • Property svn:executable set to *
File size: 31.7 KB
RevLine 
[5]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
[22]10# Syntax: see at end
[9]11
[18]12use strict 'vars';
[5]13use Getopt::Std;
[9]14use Data::Dumper;
15use English;
[16]16use AppConfig qw(:argcount :expand);
17use File::Basename;
[26]18use File::Copy;
[13]19use Time::localtime qw(localtime);
20use POSIX qw(strftime);
[5]21
[73]22# Global variables
[17]23use lib qw (lib);
[74]24use ProjectBuilder::Distribution qw (pb_distro_init);
25use ProjectBuilder::Version qw (pb_version_init);
[204]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);
[5]27
28my %opts; # CLI Options
[9]29my $action; # action to realize
30my $test = "FALSE";
31my $option = "";
32my @pkgs;
[95]33my $pbtag; # Global Tag variable
34my $pbver; # Global Version variable
[141]35my $pbscript; # Name of the script
[77]36my %pbver; # per package
37my %pbtag; # per package
[53]38my $pbrev; # Global REVISION variable
[16]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);
[112]41my $pbdatecvs = strftime("%Y-%m-%d %H:%M:%S", @date);
[108]42my $debug = 0;
[152]43my $pbaccount; # Login to use to connect to the VM
[162]44my $pbport; # Port to use to connect to the VM
[199]45my $newver; # New version to create
[262]46my $iso; # ISO iage for the VM to create
[108]47my $LOG = \*STDOUT;
[5]48
[262]49getopts('a:hi:l:m:P:p:qr:s:tvV:',\%opts);
[5]50
[75]51my ($projectbuilderver,$projectbuilderrev) = pb_version_init();
[21]52if (defined $opts{'h'}) {
[74]53 pb_syntax();
[21]54 exit(0);
55}
56if (defined $opts{'v'}) {
57 $debug++;
58}
59if (defined $opts{'q'}) {
60 $debug=-1;
61}
[22]62if (defined $opts{'l'}) {
63 open(LOG,"> $opts{'l'}") || die "Unable to log to $opts{'l'}: $!";
64 $LOG = *LOG;
65 $debug = 0 if ($debug == -1);
66 }
[9]67# Handles test option
68if (defined $opts{'t'}) {
69 $test = "TRUE";
70 # Works only for SVN
71 $option = "-r BASE";
72}
[5]73
[67]74# Handle root of the project if defined
75if (defined $opts{'r'}) {
76 $ENV{'PBROOT'} = $opts{'r'};
77}
[91]78# Handle virtual machines if any
79if (defined $opts{'m'}) {
80 $ENV{'PBVM'} = $opts{'m'};
81}
[141]82if (defined $opts{'s'}) {
83 $pbscript = $opts{'s'};
84}
[152]85if (defined $opts{'a'}) {
86 $pbaccount = $opts{'a'};
87}
[162]88if (defined $opts{'P'}) {
89 $pbport = $opts{'P'};
90}
[199]91if (defined $opts{'V'}) {
92 $newver = $opts{'V'};
93}
[262]94if (defined $opts{'i'}) {
95 $iso = $opts{'i'};
96}
[108]97
98# Get Action
99$action = shift @ARGV;
100die pb_syntax() if (not defined $action);
101
102my ($pbrc, $filteredfiles, $defpkgdir, $extpkgdir);
[273]103my $pbinit = undef;
104$pbinit = 1 if ($action =~ /^newproj$/);
[108]105
[59]106# Handles project name if any
[108]107# And get global params
[59]108if (defined $opts{'p'}) {
[107]109 ($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $defpkgdir, $extpkgdir)
[273]110 = pb_env_init($opts{'p'},$pbinit);
[59]111} else {
[107]112 ($ENV{'PBPROJ'},$debug,$LOG, $pbrc, $filteredfiles, $defpkgdir, $extpkgdir)
[273]113 = pb_env_init(undef,$pbinit);
[59]114}
115
[108]116print $LOG "Project: $ENV{'PBPROJ'}\n" if ($debug >= 0);
[22]117print $LOG "Action: $action\n" if ($debug >= 0);
[9]118
[91]119# Keep those project values to store them at the end each time
[83]120my $pbprojtag = $ENV{'PBTAG'};
121my $pbprojver = $ENV{'PBVER'};
122
[9]123# Act depending on action
124if ($action =~ /^cms2build$/) {
[77]125 pb_cms2build();
126} elsif ($action =~ /^build2pkg$/) {
127 pb_build2pkg();
128} elsif ($action =~ /^cms2pkg$/) {
129 pb_cms2build();
130 pb_build2pkg();
[88]131} elsif ($action =~ /^build2ssh$/) {
132 pb_build2ssh();
[220]133} elsif ($action =~ /^cms2ssh$/) {
134 pb_cms2build();
135 pb_build2ssh();
[88]136} elsif ($action =~ /^pkg2ssh$/) {
137 pb_pkg2ssh();
[91]138} elsif ($action =~ /^build2vm$/) {
139 pb_build2vm();
140} elsif ($action =~ /^cms2vm$/) {
141 pb_cms2build();
142 pb_build2vm();
[141]143} elsif ($action =~ /^launchvm$/) {
[262]144 pb_launchvm($ENV{'PBVM'},0);
[142]145} elsif ($action =~ /^script2vm$/) {
146 pb_script2vm($pbscript);
[199]147} elsif ($action =~ /^newver$/) {
148 pb_newver();
[262]149} elsif ($action =~ /^newvm$/) {
150 pb_launchvm($ENV{'PBVM'},1);
[273]151} elsif ($action =~ /^newproj$/) {
152 # Nothing to do - already done in pb_env_init
[106]153} elsif ($action =~ /^clean$/) {
[77]154} else {
155 print $LOG "'$action' is not available\n";
156 pb_syntax();
157}
158
159sub pb_cms2build {
160
[112]161 my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
[22]162 @pkgs = @$ptr;
[112]163 my $cms=pb_cms_init($ENV{'PBPROJ'});
[9]164
[98]165 my ($pkgv, $pkgt) = pb_conf_read("$ENV{'PBCONF'}/$ENV{'PBPROJ'}.pb","pkgver","pkgtag");
[174]166
167 # declare packager for filtering
168 my ($tmp) = pb_conf_get("packager");
169 my $pbpackager = $tmp->{$ENV{'PBPROJ'}};
170
[27]171 foreach my $pbpkg (@pkgs) {
[115]172 $ENV{'PBPKG'} = $pbpkg;
[274]173 $ENV{'PBVER'} = $pbprojver;
174 $ENV{'PBTAG'} = $pbprojtag;
[98]175 if ((defined $pkgv) && (defined $pkgv->{$pbpkg})) {
176 $pbver = $pkgv->{$pbpkg};
[115]177 $ENV{'PBVER'} = $pbver;
[9]178 } else {
[16]179 $pbver = $ENV{'PBVER'};
[9]180 }
[98]181 if ((defined $pkgt) && (defined $pkgt->{$pbpkg})) {
182 $pbtag = $pkgt->{$pbpkg};
[115]183 $ENV{'PBTAG'} = $pbtag;
[9]184 } else {
[16]185 $pbtag = $ENV{'PBTAG'};
[9]186 }
[95]187
[16]188 $pbrev = $ENV{'PBREVISION'};
[112]189 print $LOG "\n";
190 print $LOG "Management of $pbpkg $pbver-$pbtag (rev $pbrev)\n";
[9]191 die "Unable to get env var PBDESTDIR" if (not defined $ENV{'PBDESTDIR'});
[16]192 # Clean up dest if necessary. The export will recreate it
[27]193 my $dest = "$ENV{'PBDESTDIR'}/$pbpkg-$pbver";
[74]194 pb_rm_rf($dest) if (-d $dest);
[9]195
196 # Export CMS tree for the concerned package to dest
197 # And generate some additional files
198 $OUTPUT_AUTOFLUSH=1;
[29]199
[9]200 # computes in which dir we have to work
[113]201 my $dir = $defpkgdir->{$pbpkg};
202 $dir = $extpkgdir->{$pbpkg} if (not defined $dir);
[114]203 print "def:".Dumper($defpkgdir)." ext: ".Dumper($extpkgdir)." \n" if ($debug >= 1);
[112]204 pb_cms_export($cms,$pbdatecvs,"$ENV{'PBROOT'}/$dir",$dest);
[9]205
[285]206 # Get project info on authors and log file
207 my $chglog = "$ENV{'PBCONF'}/$pbpkg/pbcl";
208 $chglog = "$ENV{'PBCONF'}/pbcl" if (! -f $chglog);
209 $chglog = undef if (! -f $chglog);
210
211 my $authors = "$ENV{'PBCONF'}/$pbpkg/pbauthors";
212 $authors = "$ENV{'PBCONF'}/pbauthors" if (! -f $authors);
213 $authors = "/dev/null" if (! -f $authors);
214
[9]215 # Extract cms log history and store it
[285]216 if ((defined $chglog) && (! -f "$dest/NEWS")) {
217 print $LOG "Generating NEWS file from $chglog\n";
218 copy($chglog,"$dest/NEWS") || die "Unable to create $dest/NEWS";
219 }
220 pb_cms_log($cms,"$ENV{'PBROOT'}/$dir",$dest,$chglog,$authors);
[29]221
[21]222 my %build;
[91]223
224 my ($ptr) = pb_conf_get("vmlist");
225 foreach my $d (split(/,/,$ptr->{$ENV{'PBPROJ'}})) {
226 my ($name,$ver) = split(/_/,$d);
[11]227 chomp($ver);
[99]228 my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($name,$ver);
229 print $LOG "DEBUG: distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf)."\n" if ($debug >= 1);
[22]230 print $LOG "DEBUG Filtering PBDATE => $pbdate, PBTAG => $pbtag, PBVER => $pbver\n" if ($debug >= 1);
[13]231
[16]232 # Filter build files from the less precise up to the most with overloading
[13]233 # Filter all files found, keeping the name, and generating in dest
[16]234
235 # Find all build files first relatively to PBROOT
236 my %bfiles;
[27]237 print $LOG "DEBUG dir: $ENV{'PBCONF'}/$pbpkg\n" if ($debug >= 1);
[21]238 $build{"$ddir-$dver"} = "yes";
[27]239 if (-d "$ENV{'PBCONF'}/$pbpkg/$dtype") {
240 opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$dtype") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$dtype: $!";
[16]241 foreach my $f (readdir(BDIR)) {
242 next if ($f =~ /^\./);
[27]243 $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dtype/$f";
[16]244 $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
245 }
[13]246 closedir(BDIR);
[27]247 } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$dfam") {
248 opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$dfam") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$dfam: $!";
[16]249 foreach my $f (readdir(BDIR)) {
250 next if ($f =~ /^\./);
[27]251 $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$dfam/$f";
[16]252 $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
253 }
254 closedir(BDIR);
[27]255 } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$ddir") {
256 opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$ddir") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$ddir: $!";
[16]257 foreach my $f (readdir(BDIR)) {
258 next if ($f =~ /^\./);
[27]259 $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir/$f";
[16]260 $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
261 }
[13]262 closedir(BDIR);
[27]263 } elsif (-d "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver") {
264 opendir(BDIR,"$ENV{'PBCONF'}/$pbpkg/$ddir-$dver") || die "Unable to open dir $ENV{'PBCONF'}/$pbpkg/$ddir-$dver: $!";
[16]265 foreach my $f (readdir(BDIR)) {
266 next if ($f =~ /^\./);
[27]267 $bfiles{$f} = "$ENV{'PBCONF'}/$pbpkg/$ddir-$dver/$f";
[16]268 $bfiles{$f} =~ s~$ENV{'PBROOT'}~~;
269 }
[13]270 closedir(BDIR);
271 } else {
[21]272 $build{"$ddir-$dver"} = "no";
[13]273 next;
274 }
[22]275 print $LOG "DEBUG bfiles: ".Dumper(\%bfiles)."\n" if ($debug >= 1);
[13]276
[15]277 # Get all filters to apply
[77]278 my $ptr = pb_get_filters($pbpkg, $dtype, $dfam, $ddir, $dver);
[15]279
[19]280 # Apply now all the filters on all the files concerned
281 # destination dir depends on the type of file
282 if (defined $ptr) {
283 foreach my $f (values %bfiles) {
[285]284 pb_filter_file_pb("$ENV{'PBROOT'}/$f",$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$dtype,$pbsuf,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$defpkgdir,$extpkgdir,$pbpackager,$chglog);
[16]285 }
[15]286 }
[18]287 }
[21]288 if ($debug >= 0) {
289 my @found;
290 my @notfound;
291 foreach my $b (keys %build) {
292 push @found,$b if ($build{$b} =~ /yes/);
293 push @notfound,$b if ($build{$b} =~ /no/);
294 }
[22]295 print $LOG "Build files generated for ".join(',',@found)."\n";
296 print $LOG "No Build files found for ".join(',',@notfound)."\n";
[21]297 }
[236]298 # Get the generic filter (all.pbf) and
299 # apply those to the non-build files including those
300 # generated by pbinit if applicable
301
302 # Get only all.pbf filter
[237]303 $ptr = pb_get_filters($pbpkg);
[236]304
305 my $liste ="";
306 if (defined $filteredfiles->{$pbpkg}) {
307 foreach my $f (split(/,/,$filteredfiles->{$pbpkg})) {
308 pb_filter_file("$ENV{'PBROOT'}/$dir/$f",$ptr,"$dest/$f",$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager);
[238]309 $liste = "$f $liste";
[236]310 }
311 }
[239]312 print $LOG "Files ".$liste."have been filtered\n";
[236]313
[265]314 # Prepare the dest directory for archive
315 if (-x "$ENV{'PBCONF'}/$pbpkg/pbinit") {
[266]316 pb_filter_file("$ENV{'PBCONF'}/$pbpkg/pbinit",$ptr,"$ENV{'PBTMP'}/pbinit",$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager);
317 chmod 0755,"$ENV{'PBTMP'}/pbinit";
318 pb_system("cd $dest ; $ENV{'PBTMP'}/pbinit","Executing init script from $ENV{'PBCONF'}/$pbpkg/pbinit");
[265]319 }
320
[18]321 # Archive dest dir
[69]322 chdir "$ENV{'PBDESTDIR'}" || die "Unable to change dir to $ENV{'PBDESTDIR'}";
[25]323 # Possibility to look at PBSRC to guess more the filename
[94]324 pb_system("tar cfz $pbpkg-$pbver.tar.gz $pbpkg-$pbver","Creating $pbpkg tar files compressed");
[31]325 print $LOG "Under $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz\n" if ($debug >= 0);
[83]326
[70]327 # Keep track of what is generated for default
[113]328 open(LAST,"> $pbrc->{$ENV{'PBPROJ'}}") || die "Unable to create $pbrc->{$ENV{'PBPROJ'}}";
[83]329 print LAST "pbroot $pbprojver-$pbprojtag = $ENV{'PBROOT'}\n";
330 close(LAST);
331
332 # Keep track of per package version
333 if (! -f "$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") {
334 open(PKG,">$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") || die "Unable to create $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb";
335 print PKG "# Empty\n";
336 close(PKG);
337 }
[89]338 my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
[83]339 $pkg = { } if (not defined $pkg);
[88]340 if ((not defined $pkg->{$pbpkg}) || ($pkg->{$pbpkg} ne "$pbver-$pbtag")) {
341 $pkg->{$pbpkg} = "$pbver-$pbtag";
[83]342 }
343
[88]344 print $LOG "DEBUG pkg: ".Dumper($pkg)."\n" if ($debug >= 1);
[83]345 open(PKG,"> $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb") || die "Unable to create $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb";
[88]346 foreach my $p (keys %$pkg) {
347 print PKG "pbpkg $p = $pkg->{$p}\n";
[83]348 }
349 close(PKG);
[288]350
351 # Final cleanup
352 pb_rm_rf($dest) if (-d $dest);
[9]353 }
[77]354}
[22]355
[77]356sub pb_build2pkg {
357
[22]358 # Get list of packages to build
[112]359 my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
[22]360 @pkgs = @$ptr;
361
362 # Get the running distro to build on
[99]363 my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init();
364 print $LOG "DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n" if ($debug >= 1);
[22]365
[83]366 # Get content saved in cms2build
[89]367 my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
[83]368 $pkg = { } if (not defined $pkg);
369
[174]370 # declare packager
371 my ($tmp) = pb_conf_get("packager");
372 my $pbpackager = $tmp->{$ENV{'PBPROJ'}};
373
[25]374 chdir "$ENV{'PBBUILDDIR'}";
[126]375 my $made = ""; # pkgs made during build
[27]376 foreach my $pbpkg (@pkgs) {
[88]377 my $vertag = $pkg->{$pbpkg};
[77]378 # get the version of the current package - maybe different
379 ($pbver,$pbtag) = split(/-/,$vertag);
380
[27]381 my $src="$ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
[67]382 print $LOG "Source file: $src\n" if ($debug >= 0);
[25]383
[149]384 print $LOG "Working directory: $ENV{'PBBUILDDIR'}\n" if ($debug >= 0);
[25]385 if ($dtype eq "rpm") {
386 foreach my $d ('RPMS','SRPMS','SPECS','SOURCES','BUILD') {
[28]387 if (! -d "$ENV{'PBBUILDDIR'}/$d") {
[96]388 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";
[28]389 }
[25]390 }
391
[188]392 symlink "$src","$ENV{'PBBUILDDIR'}/SOURCES/".basename($src) || die "Unable to symlink $src in $ENV{'PBBUILDDIR'}/SOURCES";
[25]393 # We need to first extract the spec file
[28]394 my @specfile;
[77]395 @specfile = pb_extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","$ENV{'PBBUILDDIR'}/SPECS");
[25]396
[28]397 print $LOG "specfile: ".Dumper(\@specfile)."\n" if ($debug >= 1);
[25]398 # set LANGUAGE to check for correct log messages
399 $ENV{'LANGUAGE'}="C";
[28]400 #system("ls -R $ENV{'PBBUILDDIR'}") if ($debug >= 1);
401 foreach my $f (@specfile) {
402 if ($f =~ /\.spec$/) {
[174]403 pb_system("rpmbuild --define \"packager $pbpackager\" --define \"_topdir $ENV{'PBBUILDDIR'}\" -ba $f","Building package with $f under $ENV{'PBBUILDDIR'}");
[28]404 last;
405 }
406 }
[136]407 $made="$made RPMS/*/$pbpkg-$pbver-$pbtag$pbsuf.*.rpm SRPMS/$pbpkg-$pbver-$pbtag$pbsuf.src.rpm";
[149]408 if (-f "/usr/bin/rpmlint") {
409 pb_system("rpmlint $made","Checking validity of rpms with rpmlint");
[150]410 }
[118]411 } elsif ($dtype eq "deb") {
[149]412 chdir "$ENV{'PBBUILDDIR'}" || die "Unable to chdir to $ENV{'PBBUILDDIR'}";
[274]413 pb_system("tar xfz $src","Extracting sources");
[149]414
415 chdir "$pbpkg-$pbver" || die "Unable to chdir to $pbpkg-$pbver";
416 symlink "pbconf/$ddir-$dver","debian" || die "Unable to symlink to pbconf/$ddir-$dver";
[199]417 chmod 0755,"debian/rules";
[149]418 pb_system("dpkg-buildpackage -us -uc -rfakeroot","Building package");
[136]419 $made="$made $pbpkg"."_*.deb $pbpkg"."_*.dsc $pbpkg"."_*.tar.gz";
[87]420 } elsif ($dtype eq "ebuild") {
[149]421 my @ebuildfile;
422 # For gentoo we need to take pb as subsystem name
423 pb_mkdir_p("$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg") if (! -d "$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg");
424
425 # We need to first extract the ebuild file
426 @ebuildfile = pb_extract_build_files($src,"$pbpkg-$pbver/pbconf/$ddir-$dver/","$ENV{'PBBUILDDIR'}/portage/pb/$pbpkg");
427
428 # Prepare the build env for gentoo
429 my $found = 0;
430 my $pbbd = $ENV{'PBBUILDDIR'};
[150]431 $pbbd =~ s|/|\\/|g;
[149]432 open(MAKE,"/etc/make.conf") || die "Unable to open /etc/make.conf";
433 while (<MAKE>) {
434 $found = 1 if (/$pbbd\/portage/);
435 }
436 close(MAKE);
437 if ($found == 0) {
438 pb_system("sudo \'echo \"$ENV{'PBBUILDDIR'}/portage\" >> /etc/make.conf\'");
439 }
440 $found = 0;
441 open(KEYW,"/etc/portage/package.keywords") || die "Unable to open /etc/portage/package.keywords";
442 while (<KEYW>) {
443 $found = 1 if (/portage\/pb/);
444 }
445 close(KEYW);
446 if ($found == 0) {
447 pb_system("sudo \'echo \"portage/pb\" >> /etc/portage/package.keywords\'");
448 }
449
450 # Build
451 foreach my $f (@ebuildfile) {
452 if ($f =~ /\.ebuild$/) {
453 pb_system("ebuild $f digest ; ebuild $f package");
454 }
455 }
456 print $LOG "ebuild file: ".Dumper(\@ebuildfile)."\n" if ($debug >= 1);
457
458 $made="$made portage/pb/$pbpkg/$pbpkg-$pbver.ebuild";
[118]459 } elsif ($dtype eq "slackware") {
[136]460 $made="$made build-$pbpkg/$pbpkg-$pbver-*-$pbtag.tgz";
[118]461 pb_mkdir_p("$ENV{'PBBUILDDIR'}/install") if (! -d "$ENV{'PBBUILDDIR'}/install");
[87]462 } else {
[118]463 die "Unknown dtype format $dtype";
[87]464 }
465 }
[118]466 # Keep track of what is generated so that we can get them back from VMs
[129]467 open(KEEP,"> $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to create $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
[118]468 print KEEP "$made\n";
469 close(KEEP);
[87]470}
471
[88]472sub pb_build2ssh {
[90]473 pb_send2ssh("Sources");
474}
[87]475
[90]476sub pb_pkg2ssh {
477 pb_send2ssh("Packages");
478}
479
[108]480# By default deliver to the the public site hosting the
481# ftp structure (or whatever) or a VM
[90]482sub pb_send2ssh {
483
484 my $cmt = shift;
[118]485 my $vm = shift || undef;
[142]486 my $vmexist = shift || 0; # 0 is FALSE
[200]487 my $vmpid = shift || 0; # 0 is FALSE
[108]488 my $host = shift || "sshhost";
489 my $login = shift || "sshlogin";
490 my $dir = shift || "sshdir";
491 my $port = shift || "sshport";
[203]492 my $tmout = shift || "vmtmout";
[158]493 my $cmd = "";
[90]494
[87]495 # Get list of packages to build
[112]496 my $ptr = pb_get_pkg($defpkgdir,$extpkgdir);
[87]497 @pkgs = @$ptr;
498
[136]499 # Get the running distro to consider
[118]500 my ($odir,$over) = (undef, undef);
501 if (defined $vm) {
502 ($odir,$over) = split(/_/,$vm);
503 }
504 my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init($odir,$over);
[99]505 print $LOG "DEBUG: distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n" if ($debug >= 1);
[87]506
507 # Get content saved in cms2build
[89]508 my ($pkg) = pb_conf_read("$ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb","pbpkg");
[87]509 $pkg = { } if (not defined $pkg);
510
[118]511 my $src = "";
[87]512 chdir "$ENV{'PBBUILDDIR'}";
513 foreach my $pbpkg (@pkgs) {
[88]514 my $vertag = $pkg->{$pbpkg};
[87]515 # get the version of the current package - maybe different
516 ($pbver,$pbtag) = split(/-/,$vertag);
517
[118]518 if (($cmt eq "Sources") || ($cmt eq "VMs")) {
[158]519 $src = "$src $ENV{'PBDESTDIR'}/$pbpkg-$pbver.tar.gz";
[166]520 if ($cmd eq "") {
521 $cmd = "ln -sf $pbpkg-$pbver.tar.gz $pbpkg-latest.tar.gz";
522 } else {
523 $cmd = "$cmd ; ln -sf $pbpkg-$pbver.tar.gz $pbpkg-latest.tar.gz";
524 }
[118]525 }
526 }
527 if ($cmt eq "VMs") {
[132]528 $src="$src $ENV{'PBDESTDIR'}/pbscript $ENV{'PBCONF'}/$ENV{'PBPROJ'}.pb $ENV{'PBDESTDIR'}/$pbprojver-$pbprojtag.pb $ENV{'PBETC'}";
[142]529 } elsif ($cmt eq "Script") {
530 $src="$src $ENV{'PBDESTDIR'}/pbscript";
[118]531 } elsif ($cmt eq "Packages") {
532 # Get package list from file made during build2pkg
[129]533 open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
[126]534 $src = <KEEP>;
[118]535 chomp($src);
536 close(KEEP);
537 if ($dtype eq "rpm") {
538 # Also make a pbscript to generate yum/urpmi bases
[108]539 # $src = "$src $ENV{'PBDESTDIR'}/pbscript"
[118]540 } elsif ($dtype eq "deb") {
541 # Also make a pbscript to generate apt bases
542 # $src = "$src $ENV{'PBDESTDIR'}/pbscript"
[90]543 }
[87]544 }
[132]545 # Remove potential leading spaces (cause pb with basename)
546 $src =~ s/^ *//;
[129]547 my $basesrc = "";
[131]548 foreach my $i (split(/ +/,$src)) {
549 $basesrc .= " ".basename($i);
[130]550 }
[118]551
[128]552 print $LOG "Sources handled ($cmt): $src\n" if ($debug >= 0);
[203]553 my ($sshhost,$sshlogin,$sshdir,$sshport,$vmtmout) = pb_conf_get($host,$login,$dir,$port,$tmout);
[88]554 my $mac = "$sshlogin->{$ENV{'PBPROJ'}}\@$sshhost->{$ENV{'PBPROJ'}}";
[152]555 # Overwrite account value if passed as parameter
556 $mac = "$pbaccount\@$sshhost->{$ENV{'PBPROJ'}}" if (defined $pbaccount);
[108]557 my $tdir;
[136]558 my $bdir;
[142]559 if (($cmt eq "Sources") || ($cmt eq "Script")) {
[108]560 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/src";
561 } elsif ($cmt eq "VMs") {
[136]562 $tdir = dirname("$sshdir->{$ENV{'PBPROJ'}}")."/delivery";
563 $bdir = dirname("$sshdir->{$ENV{'PBPROJ'}}")."/build";
564 # Remove a potential $ENV{'HOME'} as bdir should be relative to pb's home
565 $bdir =~ s|\$ENV.+\}/||;
[90]566 } elsif ($cmt eq "Packages") {
[108]567 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$ddir/$dver";
[90]568 } else {
569 return;
[22]570 }
[239]571 my $nport = $sshport->{$ENV{'PBPROJ'}};
572 $nport = "$pbport" if (defined $pbport);
573
[136]574 # Remove a potential $ENV{'HOME'} as tdir should be relative to pb's home
[132]575 $tdir =~ s|\$ENV.+\}/||;
576
[203]577 my $tm = $vmtmout->{$ENV{'PBPROJ'}};
[239]578 pb_system("ssh -q -p $nport $mac \"mkdir -p $tdir ; cd $tdir ; echo \'for i in $basesrc; do if [ -f \$i ]; then rm -f \$i; fi; done\ ; $cmd' | bash\"","Preparing $tdir on $mac");
579 pb_system("cd $ENV{'PBBUILDDIR'} ; scp -p -P $nport $src $mac:$tdir 2> /dev/null","$cmt delivery in $tdir on $mac");
580 pb_system("ssh -q -p $nport $mac \"echo \'cd $tdir ; if [ -f pbscript ]; then ./pbscript; fi\' | bash\"","Executing pbscript on $mac if needed");
[108]581 if ($cmt eq "VMs") {
[128]582 # Get back info on pkg produced, compute their name and get them from the VM
[239]583 pb_system("scp -p -P $nport $mac:$bdir/pbgen-$pbprojver-$pbprojtag $ENV{'PBBUILDDIR'} 2> /dev/null","Get package names in $bdir on $mac");
[129]584 open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
[118]585 my $src = <KEEP>;
586 chomp($src);
587 close(KEEP);
[131]588 $src =~ s/^ *//;
[136]589 pb_mkdir_p("$ENV{'PBBUILDDIR'}/$odir/$over");
[139]590 # Change pgben to make the next send2ssh happy
[143]591 my $made = "";
[139]592 open(KEEP,"> $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag") || die "Unable to write $ENV{'PBBUILDDIR'}/pbgen-$pbprojver-$pbprojtag";
[136]593 foreach my $p (split(/ +/,$src)) {
[139]594 my $j = basename($p);
[239]595 pb_system("scp -p -P $nport $mac:\'$bdir/$p\' $ENV{'PBBUILDDIR'}/$odir/$over 2> /dev/null","Package recovery of $j in $bdir from $mac");
[144]596 $made="$made $odir/$over/$j" if (($dtype ne "rpm") || ($j !~ /.src.rpm$/));
[136]597 }
[143]598 print KEEP "$made\n";
[139]599 close(KEEP);
[239]600 pb_system("ssh -q -p $nport $mac \"rm -rf $tdir $bdir\"","VM cleanup on $mac");
[288]601 pb_send2ssh("Packages","$odir"."_"."$over");
[142]602 if (! $vmexist) {
[239]603 pb_system("ssh -q -p $nport $mac \"sudo /sbin/halt -p \"; sleep $tm ; echo \'if [ -d /proc/$vmpid ]; then kill -9 $vmpid; fi \' | bash ; sleep 10","VM $vm halt (pid $vmpid)");
[142]604 }
[141]605 pb_rm_rf("$ENV{'PBBUILDDIR'}/$odir");
[108]606 }
[9]607}
[16]608
[142]609sub pb_script2vm {
610 my $pbscript=shift;
[141]611
612 # Prepare the script to be executed on the VM
613 # in $ENV{'PBDESTDIR'}/pbscript
[142]614 if ((defined $pbscript ) && ($pbscript ne "$ENV{'PBDESTDIR'}/pbscript")) {
615 copy($pbscript,"$ENV{'PBDESTDIR'}/pbscript") || die "Unable to create $ENV{'PBDESTDIR'}/pbscript";
616 chmod 0755,"$ENV{'PBDESTDIR'}/pbscript";
617 }
[141]618
[142]619 my ($vm,$all) = pb_get_vm();
620
[141]621 foreach my $v (@$vm) {
[142]622 # Launch the VM
[262]623 my ($vmexist,$vmpid) = pb_launchvm($v,0);
[141]624
[274]625 # Skip that VM if it something went wrong
626 next if (($vmpid == 0) && ($vmexist ==0));
627
[142]628 # Gather all required files to send them to the VM
629 # and launch the build thourgh pbscript
[200]630 pb_send2ssh("Script","$v",$vmexist,$vmpid,"vmhost","vmlogin","pbrc","vmport","vmtmout");
[169]631
[142]632 }
633}
634
635sub pb_launchvm {
636 my $vm = shift;
[262]637 my $create = shift || 0; # By default do not create a VM
[142]638
[262]639 die "-i iso parameter needed" if (((not defined $iso) || ($iso eq "")) && ($create != 0));
[142]640 die "No VM defined, unable to launch" if (not defined $vm);
641 # Keep only the first VM in case many were given
642 $vm =~ s/,.*//;
643
644 # Launch the VMs
[262]645 my ($ptr,$vmopt,$vmport,$vmpath,$vmtmout,$vmsize) = pb_conf_get("vmtype","vmopt","vmport","vmpath","vmtmout","vmsize");
[142]646 my $vmtype = $ptr->{$ENV{'PBPROJ'}};
[262]647 if (not defined $ENV{'PBVMOPT'}) {
[142]648 $ENV{'PBVMOPT'} = "";
649 }
[262]650 if (defined $vmopt->{$ENV{'PBPROJ'}}) {
651 $ENV{'PBVMOPT'} .= " $vmopt->{$ENV{'PBPROJ'}}";
652 }
[239]653 my $nport = $vmport->{$ENV{'PBPROJ'}};
654 $nport = "$pbport" if (defined $pbport);
[142]655
656 my $cmd;
657 my $vmcmd; # has to be used for pb_check_ps
658 my $vmm; # has to be used for pb_check_ps
659 if ($vmtype eq "qemu") {
660 my $arch = `uname -m`;
661 chomp($arch);
662 my $qemucmd32;
663 my $qemucmd64;
664 if ($arch eq "x86_64") {
665 $qemucmd32 = "/usr/bin/qemu-system-i386";
666 $qemucmd64 = "/usr/bin/qemu";
[141]667 } else {
[142]668 $qemucmd32 = "/usr/bin/qemu";
669 $qemucmd64 = "/usr/bin/qemu-system-x86_64";
[141]670 }
[142]671 if ($vm =~ /_64/) {
672 $vmcmd = "$qemucmd64 -no-kqemu";
673 } else {
674 $vmcmd = "$qemucmd32";
675 }
676 $vmm = "$vmpath->{$ENV{'PBPROJ'}}/$vm.qemu";
[262]677 if ($create != 0) {
678 $ENV{'PBVMOPT'} .= " -cdrom $iso -boot d";
[142]679 }
[239]680 $cmd = "$vmcmd $ENV{'PBVMOPT'} -redir tcp:$nport:10.0.2.15:22 $vmm"
[142]681 } elsif ($vmtype eq "xen") {
682 } elsif ($vmtype eq "vmware") {
683 } else {
684 die "VM of type $vmtype not supported. Report to the dev team";
685 }
[199]686 my ($tmpcmd,$void) = split(/ +/,$cmd);
687 my $vmexist = pb_check_ps($tmpcmd,$vmm);
[200]688 my $vmpid = 0;
[142]689 if (! $vmexist) {
[262]690 if ($create != 0) {
691 pb_system("/usr/bin/qemu-img create -f qcow2 $vmm $vmsize->{$ENV{'PBPROJ'}}","Creating the QEMU VM");
692 }
693 if (! -f "$vmm") {
[274]694 print "Unable to find VM $vmm\n";
695 } else {
696 pb_system("$cmd &","Launching the VM $vmm");
697 pb_system("sleep $vmtmout->{$ENV{'PBPROJ'}}","Waiting for VM $vm to come up");
698 $vmpid = pb_check_ps($tmpcmd,$vmm);
[262]699 }
[200]700 } else {
701 print "Found an existing VM $vmm (pid $vmexist)\n";
[141]702 }
[200]703 return($vmexist,$vmpid);
[141]704}
[142]705
[105]706sub pb_build2vm {
[108]707 # Prepare the script to be executed on the VM
708 # in $ENV{'PBDESTDIR'}/pbscript
[220]709 my ($ntp) = pb_conf_get("vmntp");
710 my $vmntp = $ntp->{$ENV{'PBPROJ'}};
[118]711 open(SCRIPT,"> $ENV{'PBDESTDIR'}/pbscript") || die "Unable to create $ENV{'PBDESTDIR'}/pbscript";
712 print SCRIPT "#!/bin/bash\n";
[126]713 print SCRIPT "echo ... Execution needed\n";
[132]714 print SCRIPT "# This is in directory delivery\n";
[118]715 print SCRIPT "# Setup the variables required for building\n";
716 print SCRIPT "export PBPROJ=$ENV{'PBPROJ'}\n";
[132]717 print SCRIPT "# Preparation for pb\n";
718 print SCRIPT "mkdir -p ../pbconf\n";
719 print SCRIPT "mv $ENV{'PBPROJ'}.pb ../pbconf\n";
720 print SCRIPT "mv .pbrc \$HOME\n";
721 print SCRIPT "cd ..\n";
[268]722 # Force new date to be in the future compared to the date of the tar file by adding 1 minute
[226]723 my @date=(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst());
[268]724 $date[1]++;
[220]725 my $upddate = strftime("%m%d%H%M%Y", @date);
726 print SCRIPT "echo Setting up date on $vmntp...\n";
[268]727 # Or use ntpdate if available
[220]728 print SCRIPT "sudo date $upddate\n";
[118]729 print SCRIPT "export PBROOT=\`pwd\`\n";
730 print SCRIPT "# Build\n";
[127]731 my $p = "";
[272]732 $p = join(' ',@ARGV) if (defined $ARGV[0]);
[132]733 print SCRIPT "echo Building packages on VM...\n";
[166]734 print SCRIPT "pb -p $ENV{'PBPROJ'} build2pkg $p\n";
[118]735 close(SCRIPT);
736 chmod 0755,"$ENV{'PBDESTDIR'}/pbscript";
737
[142]738 my ($vm,$all) = pb_get_vm();
739
[106]740 # Send tar files when we do a global generation
741 pb_build2ssh() if ($all == 1);
[118]742
743 foreach my $v (@$vm) {
[142]744 # Launch the VM
[262]745 my ($vmexist,$vmpid) = pb_launchvm($v,0);
[118]746
[274]747 # Skip that VM if it something went wrong
748 next if (($vmpid == 0) && ($vmexist == 0));
749
[142]750 # Gather all required files to send them to the VM
751 # and launch the build thourgh pbscript
[200]752 pb_send2ssh("VMs","$v",$vmexist,$vmpid,"vmhost","vmlogin","pbrc","vmport","vmtmout");
[118]753 }
[105]754}
755
[262]756
[199]757sub pb_newver {
758
[204]759 die "-V Version parameter needed" if ((not defined $newver) || ($newver eq ""));
[199]760 my $cms=pb_cms_init($ENV{'PBPROJ'});
761 if ($cms->{$ENV{'PBPROJ'}} ne "svn") {
762 die "Only SVN is supported at the moment";
763 }
764 my $res = pb_cms_isdiff($cms);
765 die "You need to have no differences before creating a new version" if ($res != 0);
766 my $cmsurl = pb_cms_getinfo($cms);
[204]767 my $newurl = dirname($cmsurl)."/$newver";
768 pb_cms_copy($cms,$cmsurl,$newurl);
[208]769 pb_cms_checkout($cms,$newurl,"$ENV{'PBROOT'}/../$newver");
770 my $oldver=basename($cmsurl);
[211]771 open(FILE,"$ENV{'PBROOT'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb") || die "Unable to open $ENV{'PBROOT'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb";
772 open(OUT,"> $ENV{'PBROOT'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb.new") || die "Unable to write to $ENV{'PBROOT'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb.new";
[208]773 while(<FILE>) {
[209]774 s/projver\s+$ENV{'PBPROJ'}\s*=\s*$oldver/projver $ENV{'PBPROJ'} = $newver/;
[211]775 print OUT $_;
[208]776 }
777 close(FILE);
[211]778 close(OUT);
779 rename("$ENV{'PBROOT'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb.new","$ENV{'PBROOT'}/../$newver/pbconf/$ENV{'PBPROJ'}.pb");
[208]780 pb_cms_checkin($cms,"$ENV{'PBROOT'}/../$newver");
[199]781}
782
[77]783sub pb_get_pkg {
[16]784
[22]785my @pkgs;
[108]786my $defpkgdir = shift;
787my $extpkgdir = shift;
[22]788
789# Get packages list
790if (not defined $ARGV[0]) {
[112]791 @pkgs = keys %$defpkgdir;
[22]792} elsif ($ARGV[0] =~ /^all$/) {
[112]793 @pkgs = keys %$defpkgdir;
794 push(@pkgs, keys %$extpkgdir);
[22]795} else {
796 @pkgs = @ARGV;
797}
798print $LOG "Packages: ".join(',',@pkgs)."\n" if ($debug >= 0);
799return(\@pkgs);
800}
801
[105]802#
803# Return the list of VMs we are working on
804# $all is a flag to know if we return all of them
805# or only some (if all we publish also tar files in addition to pkgs
806#
[91]807sub pb_get_vm {
808
809my @vm;
[105]810my $all = 0;
[91]811
812# Get VM list
[105]813if ((not defined $ENV{'PBVM'}) || ($ENV{'PBVM'} =~ /^all$/)) {
[108]814 my ($ptr) = pb_conf_get("vmlist");
[274]815 my $ptr2 = $ptr->{$ENV{'PBPROJ'}};
816 $ptr2 =~ s/,/_64,/g;
817 $ptr2 =~ s/$/_64/g;
818 $ENV{'PBVM'} = "$ptr->{$ENV{'PBPROJ'}},$ptr2";
[105]819 $all = 1;
[91]820}
[274]821print $LOG "VMs: $ENV{'PBVM'}\n";
[105]822@vm = split(/,/,$ENV{'PBVM'});
823return(\@vm,$all);
[91]824}
825
[145]826# Returns the pid of a running VM command using a specific VM file
[142]827sub pb_check_ps {
828 my $vmcmd = shift;
829 my $vmm = shift;
830 my $vmexist = 0; # FALSE by default
831
832 open(PS, "ps auxhww|") || die "Unable to call ps";
833 while (<PS>) {
834 next if (! /$vmcmd/);
835 next if (! /$vmm/);
836 my ($void1, $void2);
837 ($void1, $vmexist, $void2) = split(/ +/);
838 last;
839 }
840 return($vmexist);
841}
842
843
[77]844sub pb_extract_build_files {
[25]845
846my $src=shift;
847my $dir=shift;
[26]848my $ddir=shift;
[28]849my @files;
[25]850
[188]851if ($src =~ /tar\.gz$/) {
852 pb_system("tar xfpz $src $dir","Extracting build files");
853} elsif ($src =~ /tar\.bz2$/) {
854 pb_system("tar xfpj $src $dir","Extracting build files");
855} else {
856 die "Unknown compression algorithm for $src";
857}
[25]858opendir(DIR,"$dir") || die "Unable to open directory $dir";
859foreach my $f (readdir(DIR)) {
860 next if ($f =~ /^\./);
[26]861 move("$dir/$f","$ddir") || die "Unable to move $dir/$f to $ddir";
[28]862 print $LOG "mv $dir/$f $ddir\n" if ($debug >= 1);
863 push @files,"$ddir/$f";
[25]864}
865closedir(DIR);
[26]866# Not enough but still a first cleanup
[74]867pb_rm_rf("$dir");
[28]868return(@files);
[25]869}
870
[74]871sub pb_syntax {
[21]872
[53]873 print "pb (aka project-builder) Version $projectbuilderver-$projectbuilderrev\n";
874 print "\n";
[288]875 print "Syntax: pb [-vhqt][-r pbroot][-p project][[-s script -a account -P port] -m \"mach-1[,...]\"][-i iso] <action> [<pkg1>...]\n";
[21]876 print "\n";
877 print "-h : This help file\n";
878 print "-q : Quiet mode\n";
879 print "-t : Test mode (not done yet)\n";
880 print "-v : Verbose mode\n";
881 print "\n";
[142]882 print "-m machine : Name of the Virtual Machines (VM) you want\n";
883 print " to build on (coma separated). All if none precised\n";
[91]884 print " (or use the env variable PBVM) \n";
[69]885 print "\n";
[141]886 print "-s script : Name of the script you want\n";
887 print " to execute on the related VMs.\n";
888 print "\n";
[288]889 print "-i iso : Name of the ISO image of the distribution you want\n";
890 print " to install on the related VMs.\n";
891 print "\n";
[152]892 print "-a account : Name of the account to use\n";
893 print " to connect on the related VMs.\n";
894 print "\n";
[199]895 print "-P port : Number of the port to use\n";
896 print " to connect on the related VMs.\n";
897 print "\n";
[21]898 print "-p project : Name of the project you're working on\n";
899 print " (or use the env variable PBPROJ) \n";
900 print "\n";
[91]901 print "-r pbroot : Path Name of project under the CMS \n";
902 print " (or use the env variable PBROOT) \n";
903 print "\n";
[199]904 print "-V newver : New version of the project to create\n";
905 print " from the current one. \n";
906 print "\n";
[21]907 print "<action> can be:\n";
908 print "\n";
[105]909 print "\tcms2build: Create tar files for the project under your CMS\n";
[21]910 print "\t CMS supported are SVN and CVS\n";
[22]911 print "\t parameters are packages to build\n";
912 print "\t if not using default list\n";
[21]913 print "\n";
914 print "\tbuild2pkg: Create packages for your running distribution \n";
915 print "\n";
[169]916 print "\tcms2pkg: cms2build + build2pkg\n";
917 print "\n";
[105]918 print "\tbuild2ssh: Send the tar files to a SSH host \n";
919 print "\n";
[220]920 print "\tcms2ssh: cms2build + build2ssh\n";
921 print "\n";
[105]922 print "\tpkg2ssh: Send the packages built to a SSH host \n";
923 print "\n";
[142]924 print "\tbuild2vm: Create packages in VMs, launching them if needed\n";
925 print "\t and send those packages to a SSH host once built\n";
926 print "\t VM type supported are QEMU \n";
[136]927 print "\n";
[169]928 print "\tcms2vm: cms2build + build2vm\n";
929 print "\n";
[142]930 print "\tlaunchvm: Launch one virtual machine\n";
[141]931 print "\n";
[142]932 print "\tscript2vm: Launch one virtual machine if needed \n";
[285]933 print "\t and executes a script on it \n";
[142]934 print "\n";
[262]935 print "\tnewvm: Create a new virtual machine\n";
[199]936 print "\n";
[262]937 print "\tnewver: Create a new version of the project derived \n";
938 print "\t from the current one \n";
939 print "\n";
[273]940 print "\tnewproj: Create a new project and a template set of \n";
941 print "\t configuration files under pbconf \n";
942 print "\n";
[21]943}
Note: See TracBrowser for help on using the repository browser.