diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2024-08-22 16:10:58 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-08-22 16:11:38 +0200 |
| commit | 67070389f3752f6f23d1fb0c06bd963464aa8bca (patch) | |
| tree | 02e0e09f6d5a6e1132dab89b154418c3f5be7a7b /apt-pkg/versionmatch.cc | |
| parent | accc2f202eabfe472ceae37d9e4f4431a8cc298f (diff) | |
Implement 'Pin: source-version <foo>'
As wondered about by Paride some minutes ago.
Diffstat (limited to 'apt-pkg/versionmatch.cc')
| -rw-r--r-- | apt-pkg/versionmatch.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index f95232ac3..3af51e40c 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -42,7 +42,7 @@ pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type) : Type(Type) return; // Cut up the version representation - if (Type == Version) + if (Type == Version || Type == SourceVersion) { if (Data.end()[-1] == '*') { @@ -177,6 +177,14 @@ pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg) /* */ bool pkgVersionMatch::VersionMatches(pkgCache::VerIterator Ver) { + if (Type == SourceVersion) + { + if (MatchVer(Ver.SourceVerStr(),VerStr,VerPrefixMatch) == true) + return true; + if (ExpressionMatches(VerStr, Ver.SourceVerStr()) == true) + return true; + return false; + } if (Type == Version) { if (MatchVer(Ver.VerStr(),VerStr,VerPrefixMatch) == true) |
