summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheset.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-07-10 10:47:08 +0200
committerMichael Vogt <mvo@debian.org>2014-07-10 10:47:08 +0200
commitfdff5b03e981ace063269640001b3bc8f9a42f4c (patch)
tree493ae02d504095033e42a0a9a5bd25b38b63e21a /apt-pkg/cacheset.cc
parenta5bb5e1e747ceb7b5a9defb6b1a8d9282a6e0957 (diff)
Allow passing a full path to apt-get install /foo/bar.deb
CLoses: #752327
Diffstat (limited to 'apt-pkg/cacheset.cc')
-rw-r--r--apt-pkg/cacheset.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc
index 5d7f28515..346bad3aa 100644
--- a/apt-pkg/cacheset.cc
+++ b/apt-pkg/cacheset.cc
@@ -24,6 +24,7 @@
#include <apt-pkg/depcache.h>
#include <apt-pkg/macros.h>
#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/fileutl.h>
#include <stddef.h>
#include <stdio.h>
@@ -445,6 +446,13 @@ bool VersionContainerInterface::FromString(VersionContainerInterface * const vci
pkgCacheFile &Cache, std::string pkg,
Version const &fallback, CacheSetHelper &helper,
bool const onlyFromName) {
+ PackageSet pkgset;
+ if(FileExists(pkg))
+ {
+ PackageContainerInterface::FromString(&pkgset, Cache, pkg, helper);
+ return VersionContainerInterface::FromPackage(vci, Cache, pkgset.begin(), fallback, helper);
+ }
+
std::string ver;
bool verIsRel = false;
size_t const vertag = pkg.find_last_of("/=");
@@ -453,7 +461,6 @@ bool VersionContainerInterface::FromString(VersionContainerInterface * const vci
verIsRel = (pkg[vertag] == '/');
pkg.erase(vertag);
}
- PackageSet pkgset;
if (onlyFromName == false)
PackageContainerInterface::FromString(&pkgset, Cache, pkg, helper);
else {