diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/deb/debindexfile.cc | 18 | ||||
-rw-r--r-- | apt-pkg/deb/debindexfile.h | 13 | ||||
-rw-r--r-- | apt-pkg/sourcelist.cc | 8 |
3 files changed, 36 insertions, 3 deletions
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 708b40a96..c11efd0ae 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -278,6 +278,24 @@ pkgSrcRecords::Parser *debDscFileIndex::CreateSrcParser() const return NULL; return new debDscRecordParser(File, this); } +std::string debDscFileIndex::GetComponent() const +{ + return "local-dsc"; +} +std::string debDscFileIndex::GetArchitecture() const +{ + return "source"; +} +uint8_t debDscFileIndex::GetIndexFlags() const +{ + return pkgCache::Flag::LocalSource; +} + /*}}}*/ +// ControlFile Index - a directory with a debian/control file /*{{{*/ +std::string debDebianSourceDirIndex::GetComponent() const +{ + return "local-control"; +} /*}}}*/ // Index File types for Debian /*{{{*/ diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index e96a4761e..890141dff 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -152,7 +152,13 @@ public: class debDscFileIndex : public pkgDebianIndexRealFile { void * const d; - public: + +protected: + virtual std::string GetComponent() const APT_OVERRIDE; + virtual std::string GetArchitecture() const APT_OVERRIDE; + virtual uint8_t GetIndexFlags() const APT_OVERRIDE; + +public: virtual const Type *GetType() const APT_OVERRIDE APT_CONST; virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; virtual bool HasPackages() const APT_OVERRIDE {return false;}; @@ -163,7 +169,10 @@ class debDscFileIndex : public pkgDebianIndexRealFile class debDebianSourceDirIndex : public debDscFileIndex { - public: +protected: + virtual std::string GetComponent() const APT_OVERRIDE; + +public: virtual const Type *GetType() const APT_OVERRIDE APT_CONST; }; diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 1e6b831be..6773b069f 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -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; |