]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debmetaindex.cc
testcases runable as root
[apt.git] / apt-pkg / deb / debmetaindex.cc
index 98f99e888a0c1ecc8de82b95efca872fc65180b9..c103da8f79936e48e43780d21e34922e264313af 100644 (file)
@@ -253,6 +253,12 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const
 {
    bool const tryInRelease = _config->FindB("Acquire::TryInRelease", true);
 
+   indexRecords * const iR = new indexRecords(Dist);
+   if (Trusted == ALWAYS_TRUSTED)
+      iR->SetTrusted(true);
+   else if (Trusted == NEVER_TRUSTED)
+      iR->SetTrusted(false);
+
    // special case for --print-uris
    if (GetAll) {
       vector <IndexTarget *> *targets = ComputeIndexTargets();
@@ -265,26 +271,26 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const
       // this is normally created in pkgAcqMetaSig, but if we run
       // in --print-uris mode, we add it here
       if (tryInRelease == false)
-        new pkgAcqMetaIndex(Owner, MetaIndexURI("Release"),
-              MetaIndexInfo("Release"), "Release",
-               MetaIndexURI("Release.gpg"), MetaIndexInfo("Release.gpg"), "Release.gpg",
-              ComputeIndexTargets(),
-              new indexRecords (Dist));
+        new pkgAcqMetaIndex(Owner, NULL,
+                             MetaIndexURI("Release"),
+                             MetaIndexInfo("Release"), "Release",
+                             MetaIndexURI("Release.gpg"), MetaIndexInfo("Release.gpg"), "Release.gpg",
+                             ComputeIndexTargets(),
+                             iR);
    }
-
    if (tryInRelease == true)
       new pkgAcqMetaClearSig(Owner, 
             MetaIndexURI("InRelease"), MetaIndexInfo("InRelease"), "InRelease",
            MetaIndexURI("Release"), MetaIndexInfo("Release"), "Release",
            MetaIndexURI("Release.gpg"), MetaIndexInfo("Release.gpg"), "Release.gpg",
            ComputeIndexTargets(),
-           new indexRecords (Dist));
+           iR);
    else
-      new pkgAcqMetaIndex(Owner, 
+      new pkgAcqMetaIndex(Owner, NULL,
           MetaIndexURI("Release"), MetaIndexInfo("Release"), "Release",
           MetaIndexURI("Release.gpg"), MetaIndexInfo("Release.gpg"), "Release.gpg",
           ComputeIndexTargets(),
-          new indexRecords (Dist));
+          iR);
 
    return true;
 }