diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2013-04-01 13:19:43 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2013-04-01 13:19:43 +0200 |
commit | 40befb065d110c7b3a7b3d37759b6888522817b2 (patch) | |
tree | 91c211c54cfd0e2242ed5ac1ec3c65b7a0d87876 | |
parent | 9c44383f2ea09afbf6ebab217cdc450e5170c172 (diff) | |
download | apt-40befb065d110c7b3a7b3d37759b6888522817b2.tar.gz |
* apt-pkg/deb/debversion.cc:
- add a string-equal shortcut for equal version comparisions
-rw-r--r-- | apt-pkg/deb/debversion.cc | 15 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index a02699a44..94d357846 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -215,10 +215,19 @@ bool debVersioningSystem::CheckDep(const char *PkgVer, return true; if (PkgVer == 0 || PkgVer[0] == 0) return false; - + Op &= 0x0F; + + size_t const lenPkgVer = strlen(PkgVer); + size_t const lenDepVer = strlen(DepVer); + + // take a shortcut for equals which are string-equal as well + if (Op == pkgCache::Dep::Equals && lenPkgVer == lenDepVer && + memcmp(PkgVer, DepVer, lenPkgVer) == 0) + return true; + // Perform the actual comparision. - int Res = CmpVersion(PkgVer,DepVer); - switch (Op & 0x0F) + int const Res = DoCmpVersion(PkgVer, PkgVer + lenPkgVer, DepVer, DepVer + lenDepVer); + switch (Op) { case pkgCache::Dep::LessEq: if (Res <= 0) diff --git a/debian/changelog b/debian/changelog index 7796f5920..b0e669129 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ apt (0.9.7.8~exp2+nmu1) UNRELEASED; urgency=low - handle language tags for descriptions are unique strings to be shared - factor version string creation out of NewDepends, so we can easily reuse version strings e.g. for implicit multi-arch dependencies + * apt-pkg/deb/debversion.cc: + - add a string-equal shortcut for equal version comparisions -- David Kalnischkies <kalnischkies@gmail.com> Sun, 10 Mar 2013 12:23:24 +0100 |