]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/sourcelist.cc
Fixed sparc compile warning
[apt.git] / apt-pkg / sourcelist.cc
index b2f48059980a73fab0942a0dd969b8be506650df..c4f225fde770859349ac28274a1456220eb67aa0 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: sourcelist.cc,v 1.11 1999/03/02 18:35:24 jgg Exp $
+// $Id: sourcelist.cc,v 1.13 1999/04/07 05:30:17 jgg Exp $
 /* ######################################################################
 
    List of Sources
@@ -135,7 +135,7 @@ bool pkgSourceList::Item::SetType(string S)
       return true;
    }
 
-   return true;
+   return false;
 }
                                                                        /*}}}*/
 // SourceList::Item::SetURI - Set the URI                              /*{{{*/
@@ -316,6 +316,33 @@ string pkgSourceList::Item::ArchiveURI(string File) const
    return Res;
 }
                                                                        /*}}}*/
+// SourceList::Item::SourceInfo        - Returns an info line for a source     /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+string pkgSourceList::Item::SourceInfo(string Pkg,string Ver,string Comp) const
+{
+   string Res;
+   switch (Type)
+   {
+      case DebSrc:
+      case Deb:
+      Res += SiteOnly(URI) + ' ';
+      if (Dist[Dist.size() - 1] == '/')
+        Res += Dist;
+      else
+        Res += Dist + '/' + Section;
+      
+      Res += " ";
+      Res += Pkg;
+      Res += " ";
+      Res += Ver;
+      if (Comp.empty() == false)
+        Res += " (" + Comp + ")";
+      break;
+   };
+   return Res;
+}
+                                                                       /*}}}*/
 // SourceList::Item::SiteOnly - Strip off the path part of a URI       /*{{{*/
 // ---------------------------------------------------------------------
 /* */