summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheset.cc
diff options
context:
space:
mode:
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 {