Changeset 2362 in ProjectBuilder for devel/pb-modules/lib
- Timestamp:
- Feb 25, 2019, 12:20:27 PM (5 years ago)
- Location:
- devel/pb-modules/lib/ProjectBuilder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Conf.pm
r2300 r2362 15 15 16 16 use strict; 17 use Carp 'confess';17 use Carp qw/cluck confess/; 18 18 use Data::Dumper; 19 19 use ProjectBuilder::Base; … … 185 185 # Read the content of the config file and cache it in the %h hash then available for queries 186 186 if ($PBCONFVER < 1) { 187 open(CONF,$cf) || c onfess "Unable to open $cf";187 open(CONF,$cf) || cluck "Unable to open $cf" && return($lh); 188 188 # This is the original conf file format for versions up to 0.14 189 189 while(<CONF>) { … … 331 331 confess "No configuration file defined to write into !" if (not defined $conffile); 332 332 confess "No hash defined to read from !" if (not defined $h); 333 open(CONF,"> $conffile") || c onfess "Unable to write into $conffile";333 open(CONF,"> $conffile") || cluck "Unable to write into $conffile" && return; 334 334 335 335 if ($PBCONFVER < 1) { … … 547 547 my $dest = shift; 548 548 549 open(ORIG,$orig) || c onfess "Unable to open $orig";549 open(ORIG,$orig) || cluck "Unable to open $orig" && return; 550 550 confess "Will not erase existing $dest while transforming $orig" if (-f $dest); 551 open(DEST,"> $dest") || c onfess "Unable to write into $dest";551 open(DEST,"> $dest") || cluck "Unable to write into $dest" && return; 552 552 print DEST "---\n"; 553 553 my $pbconfverbkp = $PBCONFVER; -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r2361 r2362 14 14 use strict; 15 15 use Data::Dumper; 16 use Carp 'confess';16 use Carp qw/cluck confess/; 17 17 use ProjectBuilder::Version; 18 18 use ProjectBuilder::Base; … … 228 228 while (($d,$r) = each %$single_rel_files) { 229 229 if (defined $ambiguous_rel_files->{$d}) { 230 print STDERR "The key $d is considered as both unambiguous and ambig ous.\n";230 print STDERR "The key $d is considered as both unambiguous and ambiguous.\n"; 231 231 confess "Please fix your configuration file.\n" 232 232 } … … 291 291 if ($found == 0) { 292 292 print STDERR "Unable to find a version in ".join(' ',keys %$ambiguous_rel_files)." (ambiguous)\n"; 293 print STDERR "Please report to the maintainer bruno_at_project-builder.org\n";294 293 confess "Please report to the maintainer bruno_at_project-builder.org\n"; 295 294 } else { … … 450 449 my $oldsep = $/; 451 450 $/ = $sep; 452 open(DESC,"$f") || c onfess "Unable to open $f";451 open(DESC,"$f") || cluck "Unable to open $f" && return(""); 453 452 while (<DESC>) { 454 453 pb_log(4,"read: $_\n"); … … 541 540 my $res = pb_system("dpkg -L $p","Looking for $p","mayfail"); 542 541 next if ($res eq 0); 543 open(CMD,"dpkg -l $p |") or confess "Unable to run dpkg -l $p: $!";542 open(CMD,"dpkg -l $p |") || cluck "Unable to run dpkg -l $p: $!" && next; 544 543 my $ok = 0; 545 544 while (<CMD>) { … … 689 688 $dirdest = "/etc/zypp/repos.d"; 690 689 } else { 691 confess "Unknown location for repository file for '$pbos->{install}' command"; 690 cluck "Unknown location for repository file for '$pbos->{install}' command"; 691 next; 692 692 } 693 693 my $dest = "$dirdest/$bn"; 694 694 return undef if (pb_distro_compare_repo("$ENV{'PBTMP'}/$bn",$dest) == 1); 695 confess "Missing directory $dirdest ($reponame)" unless (-d $dirdest); 695 if (! -d $dirdest) { 696 cluck "Missing directory $dirdest ($reponame)"; 697 return undef; 698 } 696 699 pb_system("sudo mv $ENV{'PBTMP'}/$bn $dest","Adding $reponame repository") if (not -f "$dest"); 697 700 # OpenSUSE does't seem to import keys automatically … … 699 702 if ($pbos->{install} =~ /\bzypper\b/) { 700 703 my $keyfile = undef; 701 open(REPO,"$dest") || c onfess "Unable to open $dest";704 open(REPO,"$dest") || cluck "Unable to open $dest" && next; 702 705 while (<REPO>) { 703 706 $keyfile = $_; … … 728 731 # Check whether GPG keys for this repo are already known and if 729 732 # not add them 730 open(REPO,"$dest") || c onfess "Unable to open $dest";733 open(REPO,"$dest") || cluck "Unable to open $dest" && next; 731 734 my $debrepo; 732 735 while (<REPO>) { … … 744 747 pb_system("wget -O $ENV{'PBTMP'}/Release.gpg $debrepo/Release.gpg","Downloading $debrepo/Release.gpg"); 745 748 my $signature; 746 open(SIGN,"LANGUAGE=C LANG=C gpg --verify $ENV{'PBTMP'}/Release.gpg $ENV{'PBTMP'}/Release 2>&1 |") || c onfess "Unable to verify GPG signature from Release.gpg\n";749 open(SIGN,"LANGUAGE=C LANG=C gpg --verify $ENV{'PBTMP'}/Release.gpg $ENV{'PBTMP'}/Release 2>&1 |") || cluck "Unable to verify GPG signature from Release.gpg\n" && next; 747 750 while(<SIGN>) { 748 751 chomp(); … … 757 760 } 758 761 close(SIGN); 759 open(SIGN,"LANGUAGE=C LANG=C gpg --verify $ENV{'PBTMP'}/Release.gpg $ENV{'PBTMP'}/Release 2>&1 |") || c onfess "Unable to verify GPG signature from $debrepo/Release.gpg\n";762 open(SIGN,"LANGUAGE=C LANG=C gpg --verify $ENV{'PBTMP'}/Release.gpg $ENV{'PBTMP'}/Release 2>&1 |") || cluck "Unable to verify GPG signature from $debrepo/Release.gpg\n" && next; 760 763 while(<SIGN>) { 761 764 chomp();
Note:
See TracChangeset
for help on using the changeset viewer.