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

Re: [RFH] The need for signed packages and signed Releases (long, long)



On Fri, 2002-11-15 at 13:38, Anthony Towns wrote:
> On Fri, Nov 15, 2002 at 11:13:15AM -0500, Colin Walters wrote:
> > Just a note, Isaac Jones <ijones@syntaxpolice.org> and I have been
> > working on this a bit.  Right now we have made apt download the toplevel
> > Release file, and we're currently battling libgpgme.
> 
> If you've done this, Jason's been lusting after something that'll make
> apt's progress bar work correct for downloading Packages files for years
> now. Making this bit work at least should be an easy fix, and might get
> CVS at least half way there...

Hm, I don't understand how the progress bar is related to this.  That
seems like a frontend-type issue. Could you explain?

Anyways, I wanted to wait a bit longer to discuss this until Isaac and I
were farther along, but to make this discussion more concrete, I've
attached our changes to make apt download the Release file.  Please
ignore the debugging silliness in it :)  

Of course, the next big thing is to verify it, and we found the place in
the code to do this, but we couldn't get libgpgme to do anything useful
with verification.  We might end up just fork/execing gpgv.  Jason, do
you have an opinion on this?

cvs [server aborted]: no such directory `apt-pkg/deb'
Index: apt-pkg/deb/debindexfile.cc
===================================================================
RCS file: /cvs/deity/apt/apt-pkg/deb/debindexfile.cc,v
retrieving revision 1.5
diff -u -d -r1.5 debindexfile.cc
--- apt-pkg/deb/debindexfile.cc	29 Apr 2001 05:13:51 -0000	1.5
+++ apt-pkg/deb/debindexfile.cc	15 Nov 2002 19:40:12 -0000
@@ -27,6 +27,55 @@
 #include <sys/stat.h>
 									/*}}}*/
 
+
+class debGeneralIndex
+{
+  string Dist;
+  string URI;
+
+public:
+  debGeneralIndex (const string &Dist, const string& URI)
+  {
+    this->Dist = Dist;
+    this->URI = URI;
+  }
+  //------------------------------------------------------------
+  //   virtual string ReleaseURI(const string &Dist, const string& URI) const;
+  void GetGeneralIndexes(pkgAcquire *Owner) const
+  {
+    string Res;
+    cout<<"GetGeneralIndexes called\n";
+    if (Dist[Dist.size() - 1] == '/')
+      {
+	if (Dist != "/")
+	  Res = URI + Dist;
+	else 
+	  Res = URI;
+      }
+    else
+      Res = URI + "dists/" + Dist + '/';
+    Res += "Release";
+    new pkgAcqIndexRel(Owner,Res,Info("Release"),"THEREAL!Release");
+    new pkgAcqIndexRel(Owner,Res + ".gpg",Info("Release.gpg"),"THEREAL!Release.gpg");
+  }
+  //------------------------------------------------------------
+  string Info(const char *Type) const
+  {
+    string Info = ::URI::SiteOnly(URI) + ' ';
+    if (Dist[Dist.size() - 1] == '/')
+      {
+	if (Dist != "/")
+	  Info += Dist;
+      }
+    else
+      Info += Dist + '/';
+    Info += " ";
+    Info += Type;
+    return Info;
+  }
+
+};
+
 // SourcesIndex::debSourcesIndex - Constructor				/*{{{*/
 // ---------------------------------------------------------------------
 /* */
@@ -136,6 +185,8 @@
 {
    new pkgAcqIndex(Owner,IndexURI("Sources"),Info("Sources"),"Sources");
    new pkgAcqIndexRel(Owner,IndexURI("Release"),Info("Release"),"Release");
+   (new debGeneralIndex (Dist, URI))->GetGeneralIndexes(Owner);
+   cout<<"Sanity check \n";
    return true;
 }
 									/*}}}*/
@@ -253,6 +304,8 @@
 {
    new pkgAcqIndex(Owner,IndexURI("Packages"),Info("Packages"),"Packages");
    new pkgAcqIndexRel(Owner,IndexURI("Release"),Info("Release"),"Release");
+   (new debGeneralIndex (Dist, URI))->GetGeneralIndexes(Owner);
+   cout<<"Sanity check \n";
    return true;
 }
 									/*}}}*/

Reply to: