#!/usr/bin/perl use strict; use warnings; my $PG_OLDEST_VERSION; # oldest version to check my $PG_DEVEL_VERSION; # ignore devel # read pgapt config foreach my $dir (qw(. .. /srv/apt)) { next unless (-f "$dir/pgapt.conf"); open F, "$dir/pgapt.conf"; while () { $PG_OLDEST_VERSION = $1 if /^PG_OLDEST_VERSION=(.+)/; $PG_DEVEL_VERSION = $1 if /^PG_DEVEL_VERSION=(.+)/; } close F; last; } my $packages = shift || 'sid-pgdg-testing'; my $arch = shift || 'amd64'; $packages = "dists/$packages/main/binary-$arch/Packages.bz2" unless ($packages =~ m!/!); my %pkgs; # known binary packages my %templates; # binary package templates, e.g. postgresql-*-debversion my %pgversions; # all existing PostgreSQL versions $/ = ''; # slurp paragraphs open P, "bzcat $packages |" or die "$packages: $!"; while (

) { my ($pkg) = /^Package: (.+)/m or die "$packages: paragraph without Package: $_"; if ($pkg =~ /-([89]\.\d|1\d)\b/) { my $version = $1; next if ($version < $PG_OLDEST_VERSION); next if ($PG_DEVEL_VERSION and $version eq $PG_DEVEL_VERSION); $pkgs{$pkg} = 1; $pkg =~ s/-([89]\.\d|1\d)\b/-*/; $templates{$pkg} = 1; $pgversions{$version} = 1; } } close P; foreach my $template (sort keys %templates) { my @missing; foreach my $version (sort { $a <=> $b } keys %pgversions) { my $pkg = $template; $pkg =~ s/-\*/-$version/; next if ($pkgs{$pkg}); # the server packages changed the dbg package format in 10 next if ($version < 10 and $template =~ /^postgresql-(client-|plperl-|plpython3-|pltcl-)?\*-dbgsym$/); next if ($version >= 10 and $template =~ /^postgresql-\*-dbg$/); next if ($version >= 10 and $template =~ /^postgresql-contrib-\*(-dbgsym)?$/); # amcheck is only relevant for older versions next if ($version >= 11 and $template =~ /^postgresql-\*-amcheck(-dbgsym)?$/); # modules that appeared only later next if ($version <= 9.6 and $template =~ /^postgresql-\*-(auto-failover|icu-ext)(-dbgsym)?$/); push @missing, $version; } print "$template: @missing\n" if (@missing); }