Kaynağa Gözat

Ensure that no by-hash file for "Release/InRelease is written"

Git-Dch: ignore
Brown-paperbag: yes
Thanks: Donkult
Michael Vogt 11 yıl önce
ebeveyn
işleme
2861bd9a26
2 değiştirilmiş dosya ile 18 ekleme ve 1 silme
  1. 3 1
      ftparchive/writer.cc
  2. 15 0
      test/integration/test-apt-update-simple

+ 3 - 1
ftparchive/writer.cc

@@ -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());

+ 15 - 0
test/integration/test-apt-update-simple

@@ -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