summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-04-23 13:51:48 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-04-24 07:33:59 +0200
commita49e7948029d8219d7cb182fbc1b0adb587691b8 (patch)
tree14dc3c33c2e6578213d2716e0b318089d2271b19 /cmdline
parentfeab34c5216941ca95aae1a389238a77b662d1de (diff)
create debIFTypeDscFile type
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 92384931b..5418c351b 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -57,9 +57,6 @@
#include <apt-pkg/cacheiterators.h>
#include <apt-pkg/upgrade.h>
-// FIXME: direct include of deb specific header
-#include <apt-pkg/debsrcrecords.h>
-
#include <apt-private/acqprogress.h>
#include <apt-private/private-cacheset.h>
#include <apt-private/private-cachefile.h>
@@ -1057,22 +1054,25 @@ static bool DoBuildDep(CommandLine &CmdL)
{
string Src;
pkgSrcRecords::Parser *Last = 0;
- vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps;
- // support local .dsc files
- if (FileExists(*I) && flExtension(*I) == "dsc")
+ // if its a local file (e.g. .dsc) use this
+ if (FileExists(*I))
{
- // FIXME: add a layer of abstraction
- Last = new debDscRecordParser(*I);
- Src = *I;
+ // see if we can get a parser for this pkgIndexFile type
+ string TypeName = flExtension(*I) + " File Source Index";
+ pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str());
+ if(Type != NULL)
+ Last = Type->CreateSrcPkgParser(*I);
} else {
+ // normal case, search the cache for the source file
Last = FindSrc(*I,Recs,SrcRecs,Src,Cache);
}
+
if (Last == 0)
return _error->Error(_("Unable to find a source package for %s"),Src.c_str());
// Process the build-dependencies
-
+ vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps;
// FIXME: Can't specify architecture to use for [wildcard] matching, so switch default arch temporary
if (hostArch.empty() == false)
{