From 16724b66fef02208ef050a36f732991941e39025 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 14 Feb 2014 19:40:58 +0100 Subject: [PATCH] add missing canNotFindFnmatch/showFnmatchSelection (for the next ABI break) --- apt-pkg/cacheset.cc | 25 +++++++++++++++++++++++-- apt-pkg/cacheset.h | 6 ++++++ apt-private/private-cacheset.h | 5 +++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index 29281aab9..1b1e6d595 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -204,12 +204,20 @@ PackageContainerInterface::FromFnmatch(PackageContainerInterface * const pci, } pci->insert(Pkg); +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) + helper.showFnmatchSelection(Pkg, pattern); +#else helper.showRegExSelection(Pkg, pattern); +#endif found = true; } if (found == false) { - helper.canNotFindRegEx(pci, Cache, pattern); +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) + helper.canNotFindFnmatch(pci, Cache, pattern); +#else + helper.canNotFindRegEx(pci, Cache, pattern); +#endif pci->setConstructor(UNKNOWN); return false; } @@ -588,7 +596,13 @@ void CacheSetHelper::canNotFindRegEx(PackageContainerInterface * const pci, pkgC if (ShowError == true) _error->Insert(ErrorType, _("Couldn't find any package by regex '%s'"), pattern.c_str()); } - /*}}}*/ +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) +// canNotFindFnmatch - handle the case no package is found by a fnmatch /*{{{*/ +void CacheSetHelper::canNotFindFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern) { + if (ShowError == true) + _error->Insert(ErrorType, _("Couldn't find any package by glob '%s'"), pattern.c_str()); +} +#endif /*}}}*/ // canNotFindPackage - handle the case no package is found from a string/*{{{*/ void CacheSetHelper::canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str) { } @@ -648,6 +662,13 @@ void CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern) { } /*}}}*/ +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) +// showFnmatchSelection /*{{{*/ +void CacheSetHelper::showFnmatchSelection(pkgCache::PkgIterator const &pkg, + std::string const &pattern) { +} + /*}}}*/ +#endif // showSelectedVersion /*{{{*/ void CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver, diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 29103aad9..b69d74b8e 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -48,11 +48,17 @@ public: /*{{{*/ virtual void showTaskSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern); virtual void showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern); +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) + virtual void showFnmatchSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern); +#endif virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver, std::string const &ver, bool const verIsRel); virtual void canNotFindTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern); virtual void canNotFindRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern); +#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13) + virtual void canNotFindFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern); +#endif virtual void canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str); virtual void canNotFindAllVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg); diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h index 15b531e9d..322b3be6b 100644 --- a/apt-private/private-cacheset.h +++ b/apt-private/private-cacheset.h @@ -101,6 +101,11 @@ public: Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } + virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { + ioprintf(out, _("Note, selecting '%s' for glob '%s'\n"), + Pkg.FullName(true).c_str(), pattern.c_str()); + explicitlyNamed = false; + } virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"), Pkg.FullName(true).c_str(), pattern.c_str()); -- 2.45.2