X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8d20b69d2fd7a8fec82bb559f0e39059bbaecf1b..8c782efd93342c6119e8ba2ff6989b7a164b7f3d:/apt-pkg/cacheset.cc diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index 5d7f28515..d95a32aff 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -445,6 +446,15 @@ 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); + if(pkgset.size() == 0) + return false; + 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 +463,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 {