From feab34c5216941ca95aae1a389238a77b662d1de Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 22 Apr 2014 17:59:09 +0200 Subject: add support for apt-get build-dep foo.dsc --- cmdline/apt-get.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index caf69da2a..92384931b 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -57,6 +57,9 @@ #include #include +// FIXME: direct include of deb specific header +#include + #include #include #include @@ -1053,12 +1056,23 @@ static bool DoBuildDep(CommandLine &CmdL) for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++) { string Src; - pkgSrcRecords::Parser *Last = FindSrc(*I,Recs,SrcRecs,Src,Cache); + pkgSrcRecords::Parser *Last = 0; + vector BuildDeps; + + // support local .dsc files + if (FileExists(*I) && flExtension(*I) == "dsc") + { + // FIXME: add a layer of abstraction + Last = new debDscRecordParser(*I); + Src = *I; + } else { + 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 BuildDeps; + // FIXME: Can't specify architecture to use for [wildcard] matching, so switch default arch temporary if (hostArch.empty() == false) { @@ -1071,7 +1085,7 @@ static bool DoBuildDep(CommandLine &CmdL) } else if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), StripMultiArch) == false) return _error->Error(_("Unable to get build-dependency information for %s"),Src.c_str()); - + // Also ensure that build-essential packages are present Configuration::Item const *Opts = _config->Tree("APT::Build-Essential"); if (Opts) -- cgit v1.2.3 From a49e7948029d8219d7cb182fbc1b0adb587691b8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 23 Apr 2014 13:51:48 +0200 Subject: create debIFTypeDscFile type --- cmdline/apt-get.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cmdline') 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 #include -// FIXME: direct include of deb specific header -#include - #include #include #include @@ -1057,22 +1054,25 @@ static bool DoBuildDep(CommandLine &CmdL) { string Src; pkgSrcRecords::Parser *Last = 0; - vector 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 BuildDeps; // FIXME: Can't specify architecture to use for [wildcard] matching, so switch default arch temporary if (hostArch.empty() == false) { -- cgit v1.2.3 From 77da39b95870498431fc21df65900acc5ce2f7ea Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 25 Apr 2014 09:47:50 +0200 Subject: add support for apt-get build-dep unpacked-source-dir --- cmdline/apt-get.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 5418c351b..6d6ba5ff9 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1055,8 +1055,17 @@ static bool DoBuildDep(CommandLine &CmdL) string Src; pkgSrcRecords::Parser *Last = 0; + // a unpacked debian source tree + if (DirectoryExists(*I)) + { + // FIXME: how can we make this more elegant? + std::string TypeName = "debian/control File Source Index"; + pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str()); + if(Type != NULL) + Last = Type->CreateSrcPkgParser(*I); + } // if its a local file (e.g. .dsc) use this - if (FileExists(*I)) + else if (FileExists(*I)) { // see if we can get a parser for this pkgIndexFile type string TypeName = flExtension(*I) + " File Source Index"; -- cgit v1.2.3