From eafc5435878d4013262131e5506c52d77b8a4bd4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 28 Apr 2014 14:50:11 +0200 Subject: avoid deb specific code in private-install --- apt-private/private-install.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'apt-private') diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 40165af31..4a68bb9d1 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -21,9 +21,6 @@ #include #include -// FIXME: include of deb specific header -#include - #include #include #include @@ -33,6 +30,7 @@ #include #include #include +#include #include #include @@ -678,10 +676,19 @@ bool DoInstall(CommandLine &CmdL) { if(FileExists(*I)) { - // FIMXE: direct usage of .deb specific stuff - metaIndex *mi = new debDebFileMetaIndex(*I); - pkgSourceList *sources = Cache.GetSourceList(); - sources->Add(mi); + // FIXME: make this more elegant + std::string TypeStr = flExtension(*I) + "-file"; + pkgSourceList::Type *Type = pkgSourceList::Type::GetType(TypeStr.c_str()); + if(Type != 0) + { + std::vector List; + std::map Options; + if(Type->CreateItem(List, *I, "", "", Options)) + { + pkgSourceList *sources = Cache.GetSourceList(); + sources->Add(List[0]); + } + } } } -- cgit v1.2.3-70-g09d2