// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: sourcelist.cc,v 1.6 1998/10/15 07:00:01 jgg Exp $
+// $Id: sourcelist.cc,v 1.12 1999/03/05 19:36:49 jgg Exp $
/* ######################################################################
List of Sources
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/configuration.h>
-#include <strutl.h>
+#include <apt-pkg/strutl.h>
#include <fstream.h>
#include <stdio.h>
/* */
bool pkgSourceList::ReadMainList()
{
- return Read(_config->FindDir("Dir::Etc::sourcelist"));
+ return Read(_config->FindFile("Dir::Etc::sourcelist"));
}
/*}}}*/
// SourceList::Read - Parse the sourcelist file /*{{{*/
debugging. */
ostream &operator <<(ostream &O,pkgSourceList::Item &Itm)
{
- O << Itm.Type << ' ' << Itm.URI << ' ' << Itm.Dist << ' ' << Itm.Section;
+ O << (int)Itm.Type << ' ' << Itm.URI << ' ' << Itm.Dist << ' ' << Itm.Section;
return O;
}
/*}}}*/
return true;
}
- return true;
+ if (S == "deb-src")
+ {
+ Type = DebSrc;
+ return true;
+ }
+
+ return false;
}
/*}}}*/
// SourceList::Item::SetURI - Set the URI /*{{{*/
Res += "Packages";
break;
+
+ case DebSrc:
+ if (Dist[Dist.size() - 1] == '/')
+ Res = URI + Dist;
+ else
+ Res = URI + "dists/" + Dist + '/' + Section +
+ "/source/";
+
+ Res += "Sources";
+ break;
};
return Res;
}
Res += " Packages";
break;
+
+ case DebSrc:
+ Res += SiteOnly(URI) + ' ';
+ if (Dist[Dist.size() - 1] == '/')
+ Res += Dist;
+ else
+ Res += Dist + '/' + Section;
+
+ Res += " Sources";
+ break;
};
return Res;
}
Res += "Release";
break;
+
+ case DebSrc:
+ if (Dist[Dist.size() - 1] == '/')
+ Res = URI + Dist;
+ else
+ Res = URI + "dists/" + Dist + '/' + Section +
+ "/source/";
+
+ Res += "Release";
+ break;
};
return Res;
}
switch (Type)
{
case Deb:
+ case DebSrc:
Res += SiteOnly(URI) + ' ';
if (Dist[Dist.size() - 1] == '/')
Res += Dist;
string Res;
switch (Type)
{
+ case DebSrc:
case Deb:
Res += SiteOnly(URI) + ' ';
if (Dist[Dist.size() - 1] == '/')
Res += " ";
Res += Ver.ParentPkg().Name();
+ Res += " ";
+ Res += Ver.VerStr();
+
break;
};
return Res;
switch (Type)
{
case Deb:
+ case DebSrc:
Res = URI + File;
break;
};