Просмотр исходного кода

Flag to fetch the source index
Author: jgg
Date: 1999-03-02 18:35:24 GMT
Flag to fetch the source index

Arch Librarian лет назад: 22
Родитель
Сommit
be8922fdc7
4 измененных файлов с 52 добавлено и 7 удалено
  1. 5 1
      apt-pkg/pkgcachegen.cc
  2. 40 1
      apt-pkg/sourcelist.cc
  3. 2 2
      apt-pkg/sourcelist.h
  4. 5 3
      doc/sources.list.5.yo

+ 5 - 1
apt-pkg/pkgcachegen.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: pkgcachegen.cc,v 1.30 1999/02/23 06:50:36 jgg Exp $
+// $Id: pkgcachegen.cc,v 1.31 1999/03/02 18:35:24 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Package Cache Generator - Generator for the cache structure.
    Package Cache Generator - Generator for the cache structure.
@@ -422,6 +422,10 @@ bool pkgSrcCacheCheck(pkgSourceList &List)
    int Missing = 0;
    int Missing = 0;
    for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); I++)
    for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); I++)
    {
    {
+      // Only cache deb source types.
+      if (I->Type != pkgSourceList::Item::Deb)
+	 continue;
+      
       string File = ListDir + URItoFileName(I->PackagesURI());
       string File = ListDir + URItoFileName(I->PackagesURI());
       struct stat Buf;
       struct stat Buf;
       if (stat(File.c_str(),&Buf) != 0)
       if (stat(File.c_str(),&Buf) != 0)

+ 40 - 1
apt-pkg/sourcelist.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: sourcelist.cc,v 1.10 1999/01/27 02:48:52 jgg Exp $
+// $Id: sourcelist.cc,v 1.11 1999/03/02 18:35:24 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    List of Sources
    List of Sources
@@ -129,6 +129,12 @@ bool pkgSourceList::Item::SetType(string S)
       return true;
       return true;
    }
    }
 
 
+   if (S == "deb-src")
+   {
+      Type = DebSrc;
+      return true;
+   }
+
    return true;
    return true;
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -170,6 +176,16 @@ string pkgSourceList::Item::PackagesURI() const
       
       
       Res += "Packages";
       Res += "Packages";
       break;
       break;
+      
+      case DebSrc:
+      if (Dist[Dist.size() - 1] == '/')
+	 Res = URI + Dist;
+      else
+	 Res = URI + "dists/" + Dist + '/' + Section +
+	 "/source/";
+      
+      Res += "Sources";
+      break;
    };
    };
    return Res;
    return Res;
 }
 }
@@ -191,6 +207,16 @@ string pkgSourceList::Item::PackagesInfo() const
       
       
       Res += " Packages";
       Res += " Packages";
       break;
       break;
+     
+      case DebSrc:
+      Res += SiteOnly(URI) + ' ';
+      if (Dist[Dist.size() - 1] == '/')
+	 Res += Dist;
+      else
+	 Res += Dist + '/' + Section;
+      
+      Res += " Sources";
+      break;
    };
    };
    return Res;
    return Res;
 }
 }
@@ -212,6 +238,16 @@ string pkgSourceList::Item::ReleaseURI() const
       
       
       Res += "Release";
       Res += "Release";
       break;
       break;
+      
+      case DebSrc:
+      if (Dist[Dist.size() - 1] == '/')
+	 Res = URI + Dist;
+      else
+	 Res = URI + "dists/" + Dist + '/' + Section +
+	 "/source/";
+      
+      Res += "Release";
+      break;
    };
    };
    return Res;
    return Res;
 }
 }
@@ -225,6 +261,7 @@ string pkgSourceList::Item::ReleaseInfo() const
    switch (Type)
    switch (Type)
    {
    {
       case Deb:
       case Deb:
+      case DebSrc:
       Res += SiteOnly(URI) + ' ';
       Res += SiteOnly(URI) + ' ';
       if (Dist[Dist.size() - 1] == '/')
       if (Dist[Dist.size() - 1] == '/')
 	 Res += Dist;
 	 Res += Dist;
@@ -245,6 +282,7 @@ string pkgSourceList::Item::ArchiveInfo(pkgCache::VerIterator Ver) const
    string Res;
    string Res;
    switch (Type)
    switch (Type)
    {
    {
+      case DebSrc:
       case Deb:
       case Deb:
       Res += SiteOnly(URI) + ' ';
       Res += SiteOnly(URI) + ' ';
       if (Dist[Dist.size() - 1] == '/')
       if (Dist[Dist.size() - 1] == '/')
@@ -271,6 +309,7 @@ string pkgSourceList::Item::ArchiveURI(string File) const
    switch (Type)
    switch (Type)
    {
    {
       case Deb:
       case Deb:
+      case DebSrc:
       Res = URI + File;
       Res = URI + File;
       break;
       break;
    };
    };

+ 2 - 2
apt-pkg/sourcelist.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: sourcelist.h,v 1.6 1998/10/15 07:00:02 jgg Exp $
+// $Id: sourcelist.h,v 1.7 1999/03/02 18:35:24 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    SourceList - Manage a list of sources
    SourceList - Manage a list of sources
@@ -37,7 +37,7 @@ class pkgSourceList
       item */
       item */
    struct Item
    struct Item
    {
    {
-      enum {Deb} Type;
+      enum {Deb, DebSrc} Type;
 
 
       string URI;
       string URI;
       string Dist;
       string Dist;

+ 5 - 3
doc/sources.list.5.yo

@@ -19,9 +19,11 @@ manpagesection(The deb type)
 The bf(deb) type describes a typical two-level Debian archive,
 The bf(deb) type describes a typical two-level Debian archive,
 em(distribution/component). Typically, em(distribution) is one of
 em(distribution/component). Typically, em(distribution) is one of
 em(stable), em(unstable), or em(frozen), while component is one of
 em(stable), em(unstable), or em(frozen), while component is one of
-em(main), em(contrib), em(non-free), or em(non-us).
-The format for a bf(sources.list) entry using the em(deb)
-type is:
+em(main), em(contrib), em(non-free), or em(non-us). The bf(deb-src) type
+describes a debian distribution's source code in the same form as the bf(deb)
+type. A bf(deb-src) line is required to fetch source indexes.
+The format for a bf(sources.list) entry using the em(deb) and em(deb-src)
+types are:
 verb(deb uri distribution [component1] [componenent2] [...])
 verb(deb uri distribution [component1] [componenent2] [...])
 The URI for the em(deb) type must specify the base of the Debian distribution, 
 The URI for the em(deb) type must specify the base of the Debian distribution, 
 from which bf(APT) will find the information it needs. em(distribution)
 from which bf(APT) will find the information it needs. em(distribution)