X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/3dd64b9c53b63ed82e59971614ec1dc242621d9b..57f7fb6511fcc7c55ee7a88475d15385093c048e:/apt-pkg/sourcelist.cc

diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index 1e6b831be..afbf3e665 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -98,8 +98,8 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,	/*{{{*/
    std::map<char const * const, std::pair<char const * const, bool> > mapping;
 #define APT_PLUSMINUS(X, Y) \
    mapping.insert(std::make_pair(X, std::make_pair(Y, true))); \
-   mapping.insert(std::make_pair(X "Add", std::make_pair(Y "+", true))); \
-   mapping.insert(std::make_pair(X "Remove", std::make_pair(Y "-", true)))
+   mapping.insert(std::make_pair(X "-Add", std::make_pair(Y "+", true))); \
+   mapping.insert(std::make_pair(X "-Remove", std::make_pair(Y "-", true)))
    APT_PLUSMINUS("Architectures", "arch");
    APT_PLUSMINUS("Languages", "lang");
    APT_PLUSMINUS("Targets", "target");
@@ -418,16 +418,16 @@ bool pkgSourceList::ParseFileOldStyle(std::string const &File)
 /* Returns: the number of stanzas parsed*/
 bool pkgSourceList::ParseFileDeb822(string const &File)
 {
-   pkgUserTagSection Tags;
    unsigned int i = 1;
 
    // see if we can read the file
    FileFd Fd(File, FileFd::ReadOnly);
-   pkgTagFile Sources(&Fd);
+   pkgTagFile Sources(&Fd, pkgTagFile::SUPPORT_COMMENTS);
    if (Fd.IsOpen() == false || Fd.Failed())
       return _error->Error(_("Malformed stanza %u in source list %s (type)"),i,File.c_str());
 
    // read step by step
+   pkgTagSection Tags;
    while (Sources.Step(Tags) == true)
    {
       if(Tags.Exists("Types") == false)
@@ -544,11 +544,17 @@ void pkgSourceList::AddVolatileFile(pkgIndexFile * const File)		/*{{{*/
 									/*}}}*/
 bool pkgSourceList::AddVolatileFile(std::string const &File)		/*{{{*/
 {
+   // Note: FileExists matches directories and links, too!
    if (File.empty() || FileExists(File) == false)
       return false;
 
-   if (flExtension(File) == "deb")
+   std::string const ext = flExtension(File);
+   if (ext == "deb")
       AddVolatileFile(new debDebPkgFileIndex(File));
+   else if (ext == "dsc")
+      AddVolatileFile(new debDscFileIndex(File));
+   else if (FileExists(flCombine(File, "debian/control")))
+      AddVolatileFile(new debDscFileIndex(flCombine(File, "debian/control")));
    else
       return false;