- Timestamp:
- Apr 6, 2019, 3:24:26 AM (6 years ago)
- Location:
- devel/pb-modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/etc/pb.yml
r2388 r2410 840 840 default: origin 841 841 842 pbgpgserver: 843 default: ipv4.pool.sks-keyservers.net 844 842 845 # Number of process in // for pb 843 846 #pbparallel: -
devel/pb-modules/etc/pb.yml.pod
r2375 r2410 610 610 Example: pbgpgcheck: 611 611 Lintel: 0 612 613 =item B<pbgpgserver> 614 615 Nature: Mandatory 616 Key: project (as defined in the -p option or PBPROJ environment variable) 617 Value: The GPG server to use when looking for GPG keys. 618 Conffile: pb 619 Example: pbgpgserver: 620 default: ipv4.pool.sks-keyservers.net 612 621 613 622 =item B<pbinstalltype> -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r2394 r2410 571 571 } 572 572 573 =item B<pb_distro_setuposrepo>574 575 This function sets up potential additional repository for the setup phase576 577 =cut578 579 sub pb_distro_setuposrepo {580 581 my $pbos = shift;582 583 return(pb_distro_setuprepo_gen_conf($pbos,pb_distro_conffile(),"osrepo"));584 }585 586 =item B<pb_distro_setuprepo>587 588 This function sets up potential additional repository to the build environment589 590 =cut591 592 sub pb_distro_setuprepo {593 594 my $pbos = shift;595 596 return(pb_distro_setuprepo_gen_conf($pbos,"$ENV{'PBDESTDIR'}/pbrc.yml","addrepo"));597 }598 599 573 # Internal 600 574 sub pb_distro_compare_repo { … … 619 593 } 620 594 595 596 =item B<pb_distro_setuposrepo> 597 598 This function sets up potential additional repository for the setup phase 599 600 =cut 601 602 sub pb_distro_setuposrepo { 603 604 my $pbos = shift; 605 606 pb_log(3, "INFO: Adding osrepo from config file\n"); 607 return(pb_distro_setuprepo_gen_conf($pbos,pb_distro_conffile(),"osrepo")); 608 } 609 610 =item B<pb_distro_setuprepo> 611 612 This function sets up potential additional repository to the build environment 613 614 =cut 615 616 sub pb_distro_setuprepo { 617 618 my $pbos = shift; 619 620 pb_log(3, "INFO: Adding addrepo from config file\n"); 621 return(pb_distro_setuprepo_gen_conf($pbos,"$ENV{'PBDESTDIR'}/pbrc.yml","addrepo")); 622 } 621 623 =item B<pb_distro_setuprepo_gen_conf> 622 624 … … 639 641 return undef if ($param eq ""); 640 642 643 pb_log(1, "INFO: Adding repos $param\n"); 641 644 return(pb_distro_setuprepo_gen($pbos,$param)); 642 645 } … … 752 755 pb_system("wget -O $ENV{'PBTMP'}/Release $debrepo/Release","Downloading $debrepo/Release"); 753 756 pb_system("wget -O $ENV{'PBTMP'}/Release.gpg $debrepo/Release.gpg","Downloading $debrepo/Release.gpg"); 754 my $signature; 755 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; 757 my $signature = undef; 758 my ($pbgpgserver) = pb_conf_get("pbgpgserver"); 759 confess "Unable to find a GPG server in configuration, please define pbgpgserver" if (not defined $pbgpgserver); 760 my $keyserver = $pbgpgserver->{$ENV{'PBPROJ'}}; 761 $keyserver = $pbgpgserver->{'default'} if (not defined $keyserver); 762 confess "Unable to find a GPG server in configuration, please define correctly pbgpgserver" if (not defined $keyserver); 763 open(SIGN,"LANGUAGE=C LANG=C gpg --verify --keyid-format=long $ENV{'PBTMP'}/Release.gpg $ENV{'PBTMP'}/Release 2>&1 |") || cluck "Unable to verify GPG signature from Release.gpg\n" && next; 756 764 while(<SIGN>) { 757 765 chomp(); 758 if (/^gpg: .*key ID/) {766 if (/^gpg: .*key /) { 759 767 $signature = $_; 760 $signature =~ s/^gpg: .*key ID ([A-Z0-9]+)/$1/; 761 #TODO: create a pbkeyserver conf var for that 762 pb_system("gpg --recv-keys --keyserver hkp://pgp.mit.edu $signature","Importing GPG signature for $signature"); 763 $signature = undef; 768 $signature =~ s/^gpg: .*key [ID ]*([A-Z0-9]+)/$1/; 769 pb_system("gpg --recv-keys --keyserver $keyserver $signature","Importing GPG signature for $signature"); 764 770 last; 765 771 } 766 772 } 767 773 close(SIGN); 768 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;769 while(<SIGN>) {770 chomp();771 if (/^gpg: Good signature/) {772 $signature = $_;773 $signature =~ s/^gpg: Good signature from "([^\"]+)"/$1/;774 }775 }776 close(SIGN);777 778 774 return if (not defined $signature); 775 779 776 pb_log(3, "GnuPG repo verify returned: $signature\n"); 780 unlink("$ENV{'PBTMP'}/apt.sig");781 777 pb_system("gpg -a --export -o $ENV{'PBTMP'}/apt.sig \'$signature\'","Exporting GnuPG signature of $signature"); 782 778 pb_system("sudo apt-key add $ENV{'PBTMP'}/apt.sig","Adding GnuPG signature of $signature to APT key ring");
Note:
See TracChangeset
for help on using the changeset viewer.