diff -Nru extrepo-0.4/debian/changelog extrepo-0.6/debian/changelog --- extrepo-0.4/debian/changelog 2019-11-20 12:56:28.000000000 +0000 +++ extrepo-0.6/debian/changelog 2019-12-04 09:39:46.000000000 +0000 @@ -1,3 +1,25 @@ +extrepo (0.6) unstable; urgency=medium + + * Rebuild with changes listed in previous upload actually working. When you + build & test on two machines, it's important to keep your git checkouts in + sync... + + -- Wouter Verhelst Wed, 04 Dec 2019 11:39:46 +0200 + +extrepo (0.5) unstable; urgency=medium + + * debian/tests/notfound: add + * ExtRepo::Data: use the LoadFoile method from YAML::XS, rather than + Load, as the latter seems to sometimes be problematic (and we need + to dump YAML data to file for gpg validation anyway) + * ExtRepo::Data: parse gpgv's --status-fd output rather than relying + on exit state, which is not reliable. + * extrepo: add "use utf8" to be somewhat more unicode-clean + * ExtRepo::Commands::Enable: Fix parsing of enabled policies. While at + it, replace map by a for loop, which seems easier to understand. + + -- Wouter Verhelst Wed, 04 Dec 2019 11:34:32 +0200 + extrepo (0.4) unstable; urgency=medium * debian/control: depend on libdpkg-perl, too diff -Nru extrepo-0.4/debian/tests/control extrepo-0.6/debian/tests/control --- extrepo-0.4/debian/tests/control 2019-11-20 12:55:13.000000000 +0000 +++ extrepo-0.6/debian/tests/control 2019-12-04 09:12:42.000000000 +0000 @@ -1,4 +1,4 @@ -Tests: search +Tests: search notfound Depends: extrepo Tests: enable diff -Nru extrepo-0.4/debian/tests/notfound extrepo-0.6/debian/tests/notfound --- extrepo-0.4/debian/tests/notfound 1970-01-01 00:00:00.000000000 +0000 +++ extrepo-0.6/debian/tests/notfound 2019-12-04 09:37:48.000000000 +0000 @@ -0,0 +1,9 @@ +#!/bin/bash + +if extrepo search thisrepodoesnotexist 2>/dev/null +then + echo "failed: return value does not indicate failure" + exit 1 +else + echo "ok" +fi diff -Nru extrepo-0.4/extrepo extrepo-0.6/extrepo --- extrepo-0.4/extrepo 2019-11-18 08:32:56.000000000 +0000 +++ extrepo-0.6/extrepo 2019-12-04 09:12:42.000000000 +0000 @@ -2,6 +2,7 @@ use strict; use warnings; +use utf8; =head1 NAME diff -Nru extrepo-0.4/.gitlab-ci.yml extrepo-0.6/.gitlab-ci.yml --- extrepo-0.4/.gitlab-ci.yml 2019-11-09 12:56:38.000000000 +0000 +++ extrepo-0.6/.gitlab-ci.yml 2019-12-04 09:12:42.000000000 +0000 @@ -6,3 +6,5 @@ - "*.deb" script: - gitlab-ci-git-buildpackage-all + only: + - branches diff -Nru extrepo-0.4/lib/Debian/ExtRepo/Commands/Enable.pm extrepo-0.6/lib/Debian/ExtRepo/Commands/Enable.pm --- extrepo-0.4/lib/Debian/ExtRepo/Commands/Enable.pm 2019-11-09 17:30:55.000000000 +0000 +++ extrepo-0.6/lib/Debian/ExtRepo/Commands/Enable.pm 2019-12-04 09:12:42.000000000 +0000 @@ -43,8 +43,16 @@ my @components; my $components; my $enabled = 0; + my %enabled_policies; + foreach my $policy(@{$config->{enabled_policies}}) { + $enabled_policies{$policy}=1; + } if(exists($repo->{policies})) { - @components = map { grep ($repo->{policies}{$_}, @{$config->{enabled_policies}}) ? $_ : () } keys(%{$repo->{policies}}); + foreach my $component(keys %{$repo->{policies}}) { + if(exists($enabled_policies{$repo->{policies}{$component}})) { + push @components, $component; + } + } if(scalar(@components) > 0) { $enabled = 1; } diff -Nru extrepo-0.4/lib/Debian/ExtRepo/Commands/Search.pm extrepo-0.6/lib/Debian/ExtRepo/Commands/Search.pm --- extrepo-0.4/lib/Debian/ExtRepo/Commands/Search.pm 2019-11-20 12:55:13.000000000 +0000 +++ extrepo-0.6/lib/Debian/ExtRepo/Commands/Search.pm 2019-12-04 09:37:48.000000000 +0000 @@ -20,6 +20,7 @@ } if(!$found) { print "No matches found for $searchkey\n"; + exit 1; } } diff -Nru extrepo-0.4/lib/Debian/ExtRepo/Data.pm extrepo-0.6/lib/Debian/ExtRepo/Data.pm --- extrepo-0.4/lib/Debian/ExtRepo/Data.pm 2019-11-20 12:55:13.000000000 +0000 +++ extrepo-0.6/lib/Debian/ExtRepo/Data.pm 2019-12-04 09:37:48.000000000 +0000 @@ -1,7 +1,7 @@ package Debian::ExtRepo::Data; use Exporter; -use YAML::XS qw/Load LoadFile/; +use YAML::XS qw/LoadFile/; use LWP::UserAgent; use File::Temp qw/tempdir tempfile/; @@ -38,6 +38,7 @@ my $extrepo_gpg = $response->decoded_content; my $dir = tempdir(CLEANUP => 1); my ($yaml_fh, $extrepo_yaml_file) = tempfile(DIR => $dir); + binmode $yaml_fh, ':utf8'; print $yaml_fh $extrepo_yaml; close $yaml_fh; @@ -45,12 +46,19 @@ print $gpg_fh $extrepo_gpg; close $gpg_fh; - system("gpgv", "--keyring", "/etc/extrepo/keyring.gpg", $extrepo_gpg_file, $extrepo_yaml_file) == 0 or die "could not validate gpg signature, exiting\n"; + my $validated = 0; + open my $gpgv, "gpgv --homedir /dev/null --keyring /etc/extrepo/keyring.gpg --status-fd 1 $extrepo_gpg_file $extrepo_yaml_file|"; + while(<$gpgv>) { + if(/VALIDSIG/) { + $validated = 1; + last; + } + } + die "could not validate gpg signature, exiting\n" unless $validated; print "\n\n"; - unlink($extrepo_yaml_file); unlink($extrepo_gpg_file); - - return Load($extrepo_yaml); + + return LoadFile($extrepo_yaml_file); }