]> git.saurik.com Git - apt.git/commitdiff
Ensure that no by-hash file for "Release/InRelease is written"
authorMichael Vogt <mvo@ubuntu.com>
Mon, 7 Sep 2015 09:39:52 +0000 (11:39 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Mon, 7 Sep 2015 09:39:52 +0000 (11:39 +0200)
Git-Dch: ignore
Brown-paperbag: yes
Thanks: Donkult

ftparchive/writer.cc
test/integration/test-apt-update-simple [new file with mode: 0755]

index 82049836a2f98ea3b89845602f09a7a80695ef12..eff68f07ea12ea10f95a1dc6f9eb76b67e52f5be 100644 (file)
@@ -1085,8 +1085,10 @@ bool ReleaseWriter::DoPackage(string FileName)
       {
          if (!h->usable())
             continue;
-         std::string ByHashOutputFile = GenByHashFilename(Input, *h);
+         if (flNotDir(FileName) == "Release" || flNotDir(FileName) == "InRelease")
+            continue;
 
+         std::string ByHashOutputFile = GenByHashFilename(Input, *h);
          std::string ByHashOutputDir = flNotFile(ByHashOutputFile);
          if(!CreateDirectory(flNotFile(Input), ByHashOutputDir))
             return _error->Warning("can not create dir %s", flNotFile(ByHashOutputFile).c_str());
diff --git a/test/integration/test-apt-update-simple b/test/integration/test-apt-update-simple
new file mode 100755 (executable)
index 0000000..2ec8cef
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertpackage 'unstable' 'unrelated' 'all' '0.5~squeeze1'
+insertsource 'unstable' 'unrelated' 'all' '0.5~squeeze1'
+
+setupaptarchive --no-update
+changetowebserver
+
+testsuccess aptget update -o Debug::Acquire::Auth=1