From fdff5b03e981ace063269640001b3bc8f9a42f4c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 10 Jul 2014 10:47:08 +0200 Subject: Allow passing a full path to apt-get install /foo/bar.deb CLoses: #752327 --- apt-pkg/cacheset.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'apt-pkg/cacheset.cc') 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 #include #include +#include #include #include @@ -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 { -- cgit v1.2.3