From 67070389f3752f6f23d1fb0c06bd963464aa8bca Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 22 Aug 2024 16:10:58 +0200 Subject: Implement 'Pin: source-version ' As wondered about by Paride some minutes ago. --- apt-pkg/versionmatch.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'apt-pkg/versionmatch.cc') 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) -- cgit v1.2.3-70-g09d2