On Fri, Mar 07, 2014 at 05:17:30PM +0100, Uwe Storbeck wrote: > So we have 2 different problems, apt-get/aptitude on stable > and apt-get on testing/unstable throw the HTTP headers into > the changelog output when using apt-cacher and aptitude on > testing/unstable fails to get the changelog because it uses a > different URL than apt-get to fetch it?
Could you test these 2 patches and see if they help? Thanks. Mark commit 588c364d252b7c8b4a39dc32c35002716a83ecaa Author: Mark Hindley <[email protected]> Date: Sat Mar 8 22:35:25 2014 +0000 Unconditionally read libcurl return with $/ = "\r\n\r\n" so we always get the headers in a single iteration. If the redirect changes protocol and does a HTTPS proxy CONNECT we get a 'HTTP/1.0 200 Connection established' response and any subsequent redirect headers end up in the body. diff --git a/apt-cacher b/apt-cacher index b3863aa..81a80ff 100755 --- a/apt-cacher +++ b/apt-cacher @@ -1611,7 +1611,7 @@ sub libcurl { # Loop to get the content with localised $/ So we get all the # headers at once while (local $_ = do { - local $/ = "\r\n\r\n" if !$response || $response->is_redirect; + local $/ = "\r\n\r\n"; <$libcurl> }) { # $cfg->{debug} && debug_message('libcurl returned ' . length($_) . ' bytes'); commit cf226dbb81e82a54ff584e4d9fb8ca6bfe71a1dd Author: Mark Hindley <[email protected]> Date: Sat Mar 8 23:03:27 2014 +0000 aptitude is not using metadata.ftp-master.debian.org for changelogs. There is a different naming scheme. Support this although I am not sure this will be the definitive situation. diff --git a/apt-cacher b/apt-cacher index 81a80ff..6adcf90 100755 --- a/apt-cacher +++ b/apt-cacher @@ -282,15 +282,22 @@ sub new_filename { elsif (is_file_type('installer', $path[-1]) or is_file_type('pdiff', $path[-1])) { # APT, Installer or Debian-live files # Need a unique filename but no freshness checks. - # As a special exception, last 2 segments of changelog files are - # enough for uniqueness - if ($path[-1] eq 'changelog') { + # Special handling for changelog servers + if ($path[-1] =~ /changelog/) { if (my $namespace = get_namespace($uri)) { - $cfg->{debug} && debug_message("Using namespace: $namespace"); + $cfg->{debug} && debug_message("Using namespace: $namespace for $path[-1]"); mkdir_namespace($namespace); $ret = $namespace . '/'; } - $ret .= join('_', @path[-2,-1]); + # For packages.debian.org changelogs last 2 segments are required + # for uniqueness + if ($path[-1] eq 'changelog') { + $ret .= join('_', @path[-2,-1]); + } + # For metadata.ftp-master.debian.org the last segment contains a unique name + else { + $ret .= $path[-1]; + } $cfg->{debug} && debug_message("Changelog file: $ret"); } else { diff --git a/lib/apt-cacher.pl b/lib/apt-cacher.pl index 16fa73c..2b96992 100755 --- a/lib/apt-cacher.pl +++ b/lib/apt-cacher.pl @@ -64,7 +64,7 @@ sub read_config { # Private _config_file => $config_file, _path_map => { - 'debian-changelogs' => ['packages.debian.org'], + 'debian-changelogs' => ['packages.debian.org', 'metadata.ftp-master.debian.org'], 'ubuntu-changelogs' => ['changelogs.ubuntu.com'] }, @@ -99,7 +99,7 @@ sub read_config { qw(vmlinuz linux initrd\.gz - changelog + (?:[-+.a-z0-9]+_(?:\d:)?[-+.~a-zA-Z0-9]+_)?changelog NEWS.Debian UBUNTU_RELEASE_NAMES\.tar\.gz(?:\.gpg)? (?:Devel|EOL)?ReleaseAnnouncement(?:\.html)? -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

