summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-04-28 14:50:11 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-04-28 14:50:11 +0200
commiteafc5435878d4013262131e5506c52d77b8a4bd4 (patch)
tree93664f1ef74d91ea810f49188774eb550563f8cd /apt-private
parent0d29b9d4368284782862c7b507c47002b79ddb27 (diff)
avoid deb specific code in private-install
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-install.cc21
1 files changed, 14 insertions, 7 deletions
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 <apt-pkg/pkgcache.h>
#include <apt-pkg/sourcelist.h>
-// FIXME: include of deb specific header
-#include <apt-pkg/debmetaindex.h>
-
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -33,6 +30,7 @@
#include <iostream>
#include <set>
#include <vector>
+#include <map>
#include <apt-private/acqprogress.h>
#include <apt-private/private-install.h>
@@ -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<metaIndex *> List;
+ std::map<std::string, std::string> Options;
+ if(Type->CreateItem(List, *I, "", "", Options))
+ {
+ pkgSourceList *sources = Cache.GetSourceList();
+ sources->Add(List[0]);
+ }
+ }
}
}