- ioprintf(c1out, _("Note, using file '%s' to get the build dependencies\n"), *I);
-
- // see if we can get a parser for this pkgIndexFile type
- std::string TypeName = "Debian " + flExtension(*I) + " file";
- pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(TypeName.c_str());
- if(Type != NULL)
- LastOwner.reset(Last = Type->CreateSrcPkgParser(*I));
- } else {
- // normal case, search the cache for the source file
- Last = FindSrc(*I,SrcRecs,Src,Cache);
- }
-
- if (Last == 0)
- return _error->Error(_("Unable to find a source package for %s"),Src.c_str());
-
- // Process the build-dependencies
- std::vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps;
- // FIXME: Can't specify architecture to use for [wildcard] matching, so switch default arch temporary
- if (hostArch.empty() == false)
- {
- std::string nativeArch = _config->Find("APT::Architecture");
- _config->Set("APT::Architecture", hostArch);
- bool Success = Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), StripMultiArch);
- _config->Set("APT::Architecture", nativeArch);
- if (Success == false)
- return _error->Error(_("Unable to get build-dependency information for %s"),Src.c_str());
+ for (size_t i = 0; i < VolatileSources.size(); ++i)
+ {
+ char const * const Src = VolatileCmdL[i];
+ if (DirectoryExists(Src))
+ ioprintf(c1out, _("Note, using directory '%s' to get the build dependencies\n"), Src);
+ else
+ ioprintf(c1out, _("Note, using file '%s' to get the build dependencies\n"), Src);
+ std::unique_ptr<pkgSrcRecords::Parser> Last(VolatileSources[i]->CreateSrcParser());
+ if (Last == nullptr)
+ return _error->Error(_("Unable to find a source package for %s"), Src);
+
+ auto const BuildDeps = GetBuildDeps(Last.get(), Src, StripMultiArch, hostArch);
+ if (InstallBuildDepsLoop(Cache, Src, BuildDeps, StripMultiArch, hostArch) == false)
+ return false;
+ }