Changeset 1678 in ProjectBuilder
- Timestamp:
- Nov 16, 2012, 9:06:13 PM (12 years ago)
- Location:
- devel/pb-modules/lib/ProjectBuilder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r1653 r1678 266 266 if (not defined $lsbf) { 267 267 print STDERR "no lsb entry defined for osrelambfile\n"; 268 die"You modified upstream delivery and lost !\n";268 confess "You modified upstream delivery and lost !\n"; 269 269 } 270 270 … … 296 296 } else { 297 297 print STDERR "Unable to read $lsbf file\n"; 298 die"Please report to the maintainer bruno_at_project-builder.org\n";298 confess "Please report to the maintainer bruno_at_project-builder.org\n"; 299 299 } 300 300 } … … 328 328 329 329 # Protection 330 die"Missing install command for $pbos->{name}-$pbos->{version}-$pbos->{arch}" unless (defined $pbos->{install} && $pbos->{install} =~ /\w/);330 confess "Missing install command for $pbos->{name}-$pbos->{version}-$pbos->{arch}" unless (defined $pbos->{install} && $pbos->{install} =~ /\w/); 331 331 pb_apply_conf_proxy($pbos); 332 332 … … 347 347 # Check that all deps have been installed correctly 348 348 $deps = pb_distro_getdeps($f, $pbos); 349 die"Some dependencies did not install ($deps)" if ((defined $deps) && ($deps =~ /\S/));349 confess "Some dependencies did not install ($deps)" if ((defined $deps) && ($deps =~ /\S/)); 350 350 } 351 351 … … 387 387 my $oldsep = $/; 388 388 $/ = $sep; 389 open(DESC,"$f") || die"Unable to open $f";389 open(DESC,"$f") || confess "Unable to open $f"; 390 390 while (<DESC>) { 391 391 pb_log(4,"read: $_\n"); … … 459 459 my $res = pb_system("dpkg -L $p","Looking for $p","mayfail"); 460 460 next if ($res eq 0); 461 open(CMD,"dpkg -l $p |") or die"Unable to run dpkg -l $p: $!";461 open(CMD,"dpkg -l $p |") or confess "Unable to run dpkg -l $p: $!"; 462 462 my $ok = 0; 463 463 while (<CMD>) { … … 583 583 $dirdest = "/etc/zypp/repos.d"; 584 584 } else { 585 die"Unknown location for repository file for '$pbos->{install}' command";585 confess "Unknown location for repository file for '$pbos->{install}' command"; 586 586 } 587 587 my $dest = "$dirdest/$bn"; 588 588 return if (pb_distro_compare_repo($ENV{'PBTMP'}/$bn,$dest)); 589 die"Missing directory $dirdest ($reponame)" unless (-d $dirdest);589 confess "Missing directory $dirdest ($reponame)" unless (-d $dirdest); 590 590 pb_system("sudo mv $ENV{'PBTMP'}/$bn $dirdest/$bn","Adding $reponame repository") if (not -f "$dirdest/$bn"); 591 591 } elsif ($bn =~ /\.addmedia/) { -
devel/pb-modules/lib/ProjectBuilder/VCS.pm
r1586 r1678 35 35 36 36 our @ISA = qw(Exporter); 37 our @EXPORT = qw(pb_vcs_export pb_vcs_get_uri pb_vcs_copy pb_vcs_checkout pb_vcs_up pb_vcs_checkin pb_vcs_isdiff pb_vcs_add pb_vcs_ cmd);37 our @EXPORT = qw(pb_vcs_export pb_vcs_get_uri pb_vcs_copy pb_vcs_checkout pb_vcs_up pb_vcs_checkin pb_vcs_isdiff pb_vcs_add pb_vcs_add_if_not_in pb_vcs_cmd); 38 38 ($VERSION,$REVISION) = pb_version_init(); 39 39 … … 112 112 } else { 113 113 # Look at svk admin hotcopy 114 die"Unable to export from svk without a source defined";114 confess "Unable to export from svk without a source defined"; 115 115 } 116 116 } elsif ($scheme eq "dir") { … … 131 131 if ($@) { 132 132 # File::MimeInfo not found 133 die("ERROR: Install File::MimeInfo to handle scheme $scheme\n");133 confess("ERROR: Install File::MimeInfo to handle scheme $scheme\n"); 134 134 } 135 135 … … 220 220 pb_system("cd $dir ; $vcscmd -d $account\@$host:$path export $cvsopt -d $base $tmp1","Exporting $tmp1 from $source under CVS to $destdir "); 221 221 } else { 222 die"cms $scheme unknown";222 confess "cms $scheme unknown"; 223 223 } 224 224 return(undef); … … 243 243 244 244 if ($scheme =~ /^svn/) { 245 open(PIPE,"LANGUAGE=C $vcscmd info $dir |") || return("");245 open(PIPE,"LANGUAGE=C $vcscmd info $dir 2> /dev/null |") || return(""); 246 246 while (<PIPE>) { 247 247 ($void,$res) = split(/^URL:/) if (/^URL:/); … … 251 251 chomp($res); 252 252 } elsif ($scheme =~ /^svk/) { 253 open(PIPE,"LANGUAGE=C $vcscmd info $dir |") || return("");253 open(PIPE,"LANGUAGE=C $vcscmd info $dir 2> /dev/null |") || return(""); 254 254 my $void2 = ""; 255 255 while (<PIPE>) { … … 267 267 chomp($res); 268 268 } elsif ($scheme =~ /^git/) { 269 open(GIT,"git --git-dir=$dir/.git remote -v |") || return("");269 open(GIT,"git --git-dir=$dir/.git remote -v 2> /dev/null |") || return(""); 270 270 while (<GIT>) { 271 271 next unless (/^origin\s+(\S+) \(push\)$/); … … 277 277 } elsif ($scheme =~ /^cvs/) { 278 278 # This path is always the root path of CVS, but we may be below 279 open(FILE,"$dir/CVS/Root") || die"$dir isn't CVS controlled";279 open(FILE,"$dir/CVS/Root") || confess "$dir isn't CVS controlled"; 280 280 $res = <FILE>; 281 281 chomp($res); … … 286 286 $rdir = dirname($rdir); 287 287 } 288 die"Unable to find a CVSROOT dir in the parents of $dir" if (! -d "$rdir/CVSROOT");288 confess "Unable to find a CVSROOT dir in the parents of $dir" if (! -d "$rdir/CVSROOT"); 289 289 #compute our place under that root dir - should be a relative path 290 290 $dir =~ s|^$rdir||; … … 300 300 $res = $prefix.$res.$suffix; 301 301 } else { 302 die"cms $scheme unknown";302 confess "cms $scheme unknown"; 303 303 } 304 304 pb_log(1,"pb_vcs_get_uri returns $res\n"); … … 332 332 # Nothing to do. 333 333 } else { 334 die"cms $scheme unknown for project management";334 confess "cms $scheme unknown for project management"; 335 335 } 336 336 } … … 385 385 pb_vcs_export($url,undef,$destination); 386 386 } else { 387 die"cms $scheme unknown";387 confess "cms $scheme unknown"; 388 388 } 389 389 } … … 411 411 # Nothing to do. 412 412 } else { 413 die"cms $scheme unknown";413 confess "cms $scheme unknown"; 414 414 } 415 415 } … … 437 437 # Nothing to do. 438 438 } else { 439 die"cms $scheme unknown";439 confess "cms $scheme unknown"; 440 440 } 441 441 pb_vcs_up($scheme,$dir); 442 } 443 444 =item B<pb_vcs_add_if_not_in> 445 446 This function adds to a VCS content from a local directory if the content wasn't already managed under th VCS. 447 The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...) 448 The second parameter is a list of directory/file to add. 449 450 =cut 451 452 sub pb_vcs_add_if_not_in { 453 my $scheme = shift; 454 my @f = @_; 455 my $vcscmd = pb_vcs_cmd($scheme); 456 457 if ($scheme =~ /^((hg)|(git)|(svn)|(svk)|(cvs))/o) { 458 for my $f (@f) { 459 my $uri = pb_vcs_get_uri($scheme,$f); 460 pb_vcs_add($scheme,$f) if ($uri !~ /^$scheme/); 461 } 462 } elsif ($scheme =~ /^(flat)|(ftp)|(http)|(file)\b/o) { 463 # Nothing to do. 464 } else { 465 confess "cms $scheme unknown"; 466 } 442 467 } 443 468 … … 460 485 # Nothing to do. 461 486 } else { 462 die"cms $scheme unknown";487 confess "cms $scheme unknown"; 463 488 } 464 489 pb_vcs_up($scheme,@f); … … 480 505 481 506 if ($scheme =~ /^((svn)|(cvs)|(svk))/o) { 482 open(PIPE,"$vcscmd diff $dir |") || die"Unable to get $vcscmd diff from $dir";507 open(PIPE,"$vcscmd diff $dir |") || confess "Unable to get $vcscmd diff from $dir"; 483 508 $l = 0; 484 509 while (<PIPE>) { … … 490 515 $l = 0; 491 516 } else { 492 die"cms $scheme unknown";517 confess "cms $scheme unknown"; 493 518 } 494 519 pb_log(1,"pb_vcs_isdiff returns $l\n"); … … 552 577 return($cmd."$command -o "); 553 578 } else { 554 die"Unable to handle $scheme.\nNo wget/curl available, please install one of those";579 confess "Unable to handle $scheme.\nNo wget/curl available, please install one of those"; 555 580 } 556 581 }
Note:
See TracChangeset
for help on using the changeset viewer.