From 9b0122d1a1da18a00f6a71323d98e89076a8c2b2 Mon Sep 17 00:00:00 2001 From: Dominik Hassler Date: Thu, 23 Apr 2026 15:20:29 +0000 Subject: [PATCH] do not use key/cert to access local file system based repo --- .github/workflows/unit-tests.yaml | 4 +-- lib/PkgMgr.pm | 18 +++++++------ thirdparty/cpanfile-5.42.snapshot | 43 +++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 thirdparty/cpanfile-5.42.snapshot diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 101c025..84b7122 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -21,9 +21,9 @@ jobs: # - windows-latest perl: - - '5.36' - '5.38' - '5.40' + - '5.42' # exclude: #- os: ubuntu-16.04 # perl: '5.26' @@ -54,7 +54,7 @@ jobs: - name: CPAN Cache id: cpan-cache - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: thirdparty key: ${{ matrix.os }}-cpan-${{ matrix.perl }}-${{ hashFiles('**/cpanfile') }} diff --git a/lib/PkgMgr.pm b/lib/PkgMgr.pm index 29e636a..79703c3 100644 --- a/lib/PkgMgr.pm +++ b/lib/PkgMgr.pm @@ -245,13 +245,12 @@ sub publishPackages { my ($srcRepo, $dstRepo) = $self->getSrcDstRepos($config, $repo, $opts); - my @cert = $opts->{pull} || $opts->{export} ? () - : ('--dkey', $config->{GENERAL}->{key_file}, - '--dcert', $config->{GENERAL}->{cert_file}); + my @cert; + push @cert, ('--dkey', $config->{GENERAL}->{key_file}, '--dcert', $config->{GENERAL}->{cert_file}) + if !$opts->{pull} && !$opts->{export} && $dstRepo =~ m!^https?://!; - push @cert, $config->{REPOS}->{$repo}->{restricted} ne 'yes' ? () - : ('--key', $config->{GENERAL}->{key_file}, - '--cert', $config->{GENERAL}->{cert_file}); + push @cert, ('--key', $config->{GENERAL}->{key_file}, '--cert', $config->{GENERAL}->{cert_file}) + if $config->{REPOS}->{$repo}->{restricted} eq 'yes'; # set timeout env variables $ENV{PKG_CLIENT_CONNECT_TIMEOUT} = $config->{GENERAL}->{connect_timeout}; @@ -292,8 +291,11 @@ sub rebuildRepo { my $repoPath = $self->getRepoPath($config, $repo, $opts); - my @cmd = ($PKGREPO, qw(rebuild -s), $repoPath, ($opts->{staging} || $opts->{dst} ? ('--key', - $config->{GENERAL}->{key_file}, '--cert', $config->{GENERAL}->{cert_file}) : ())); + my @cert; + push @cert, ('--key', $config->{GENERAL}->{key_file}, '--cert', $config->{GENERAL}->{cert_file}) + if $repoPath =~ m!^https?://!; + + my @cmd = ($PKGREPO, qw(rebuild -s), $repoPath, @cert); system (@cmd) && die "ERROR: rebuilding repo '$repoPath'.\n"; } diff --git a/thirdparty/cpanfile-5.42.snapshot b/thirdparty/cpanfile-5.42.snapshot new file mode 100644 index 0000000..aed80ba --- /dev/null +++ b/thirdparty/cpanfile-5.42.snapshot @@ -0,0 +1,43 @@ +# carton snapshot format: version 1.0 +DISTRIBUTIONS + Convert-ASN1-0.34 + pathname: T/TI/TIMLEGGE/Convert-ASN1-0.34.tar.gz + provides: + Convert::ASN1 0.34 + requirements: + ExtUtils::MakeMaker 0 + Crypt-OpenSSL-Guess-0.15 + pathname: A/AK/AKIYM/Crypt-OpenSSL-Guess-0.15.tar.gz + provides: + Crypt::OpenSSL::Guess 0.15 + requirements: + Config 0 + Exporter 5.57 + ExtUtils::MakeMaker 6.64 + File::Spec 0 + Symbol 0 + perl 5.008001 + Crypt-OpenSSL-X509-2.0.1 + pathname: J/JO/JONASBN/Crypt-OpenSSL-X509-2.0.1.tar.gz + provides: + Crypt::OpenSSL::X509 2.000001 + requirements: + Config 0 + Convert::ASN1 0.33 + Crypt::OpenSSL::Guess 0 + ExtUtils::MakeMaker 0 + version 0.77 + Data-Processor-1.0.9 + pathname: M/MB/MBP/Data-Processor-1.0.9.tar.gz + provides: + Data::Processor 1.000009 + Data::Processor::Error::Collection undef + Data::Processor::Error::Instance undef + Data::Processor::Generator undef + Data::Processor::PodWriter undef + Data::Processor::Transformer undef + Data::Processor::Validator undef + Data::Processor::ValidatorFactory undef + requirements: + ExtUtils::MakeMaker 0 + perl 5.008005