diff options
| author | Julian Andres Klode <jak@debian.org> | 2024-08-22 15:10:45 +0000 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2024-08-22 15:10:45 +0000 |
| commit | 8a8fdea4c71fbddfda9f7d6a1d9ec5da68870e12 (patch) | |
| tree | 767576588cb2578048c0467771bbfe0ca9d7056d /apt-pkg/versionmatch.cc | |
| parent | f51b662525c78149892be16c111bad44b05f6c63 (diff) | |
| parent | 67070389f3752f6f23d1fb0c06bd963464aa8bca (diff) | |
Merge branch 'pin-source-version' into 'main'
Implement 'Pin: source-version <foo>'
See merge request apt-team/apt!372
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) |
