[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#787138: apt-ftparchive ignores APT::FTPArchive::Release::SHA512



Package: apt-utils
Version: 1.0.9.8

I'm using apt-ftparchive to create 'Release' file for a small repository. Since I don't need SHA512 sums, I disabled them in my config.

--
$ cat repo.conf
--
APT::FTPArchive::Release::Architectures "i386 amd64";
APT::FTPArchive::Release::Suite "stable";
APT::FTPArchive::Release::Codename "jessie";
APT::FTPArchive::Release::Components "main";
APT::FTPArchive::Release::Description "Local repository";
APT::FTPArchive::Release::Label "Local repository";
APT::FTPArchive::Release::Origin "localhost";

APT::FTPArchive::Release::MD5 "true";
APT::FTPArchive::Release::SHA1 "true";
APT::FTPArchive::Release::SHA256 "true";
APT::FTPArchive::Release::SHA512 "false";
--

But when I invoke apt-ftparchive, the SHA512 sums are present.

--
$ apt-ftparchive -c repo.conf release .
--
Architectures: i386 amd64
Codename: jessie
Components: main
Date: Thu, 28 May 2015 23:30:22 UTC
Description: Local repository
Label: Local repository
Origin: localhost
Suite: stable
MD5Sum:
41eaef6ee4fef49b3d7ff89ed1bfae27 1190 dists/stable/main/source/Sources
SHA1:
24153934d2f9a81a0d17cca384bcbe4f5f844fcc 1190 dists/stable/main/source/Sources
SHA256:
1e6708f6e7a1ae74dcaf91ae0da057c0bc16cb8592165726184ab18f36b93de6 1190 dists/stable/main/source/Sources
SHA512:
 0f0704e9fe6e5078dcb9dbc494854209b51556e695c475fd79d7254cc63ea3dc3d167319b1a8a4708cc45a1a1f2a11b5c21e8abb600b94c6fbed605bc99de010 1190 dists/stable/main/source/Sources
--

Just to make sure my config is valid, I changed "true" to "false" for other three hash algorithms, and here is my output.

--
$ apt-ftparchive -c repo.conf release .
--
Architectures: i386 amd64
Codename: jessie
Components: main
Date: Thu, 28 May 2015 23:14:58 UTC
Description: Local repository
Label: Local repository
Origin: localhost
Suite: stable
SHA512:
 0f0704e9fe6e5078dcb9dbc494854209b51556e695c475fd79d7254cc63ea3dc3d167319b1a8a4708cc45a1a1f2a11b5c21e8abb600b94c6fbed605bc99de010 1190 dists/stable/main/source/Sources
--

SHA512 remains. Like that config item is not taken into account at all.

I checked out the sources, and there is *no* code that looks for "APT::FTPArchive::Release::SHA512" (See https://anonscm.debian.org/cgit/apt/apt.git/tree/ftparchive/writer.cc?h=debian/jessie#n1025).

I attached a patch that will possibly fix this.

My distro: Fresh Debian GNU/Linux 8 with default repos.
--- writer.cc.original	2015-05-28 23:34:13.335067263 +0000
+++ writer.cc	2015-05-28 23:35:07.396137053 +0000
@@ -1025,6 +1025,7 @@ ReleaseWriter::ReleaseWriter(string cons
    DoMD5 = _config->FindB("APT::FTPArchive::Release::MD5",DoMD5);
    DoSHA1 = _config->FindB("APT::FTPArchive::Release::SHA1",DoSHA1);
    DoSHA256 = _config->FindB("APT::FTPArchive::Release::SHA256",DoSHA256);
+   DoSHA512 = _config->FindB("APT::FTPArchive::Release::SHA512",DoSHA512);
 }
 									/*}}}*/
 // ReleaseWriter::DoPackage - Process a single package			/*{{{*/

Reply to: