- my $srchash = substr $source, 0, 1;
- my $version_fh = new IO::File "$config{version_packages_dir}/$srchash/$source", 'r';
- $version->load($version_fh);
+ my $srchash = substr $source, 0, 1;
+ next unless -e "$config{version_packages_dir}/$srchash/$source";
+ push @versions_files, "$config{version_packages_dir}/$srchash/$source";
+}
+
+$etag = etag_does_not_match(cgi=>$q,
+ additional_data=>[@cgi_var{(qw(package ignore_boring),
+ qw(collapse))
+ },
+ $this,
+ $VERSION],
+ files => [@versions_files
+ ],
+ );
+if (not $etag) {
+ print $q->header(-status => 304);
+ print "304: Not modified\n";
+ exit 0;
+}
+
+my $version = Debbugs::Versions->new(\&Debbugs::Versions::Dpkg::vercmp);
+for my $version_fn (@versions_files) {
+ my $version_fh = IO::File->new($version_fn, 'r') or
+ warn "Unable to open $version_fn for reading: $!";
+ $version->load($version_fh);