treat "not present" in preferred content as invalid

Detect when a preferred content expression contains "not present", which
would lead to repeatedly getting and then dropping files, and make it never
match. This also applies to "not balanced" and "not sizebalanced".

--explain will tell the user when this happens

Note that getMatcher calls matchMrun' and does not check for unstable
negated limits. While there is no --present anyway, if there was,
it would not make sense for --not --present to complain about
instability and fail to match.
This commit is contained in:
Joey Hess 2024-09-03 13:49:34 -04:00
parent 8b2bd42540
commit 340bdd0dac
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 121 additions and 47 deletions

View file

@ -98,7 +98,9 @@ data MatchFiles a = MatchFiles
-- ^ does the matchAction look at the location log?
, matchNeedsLiveRepoSize :: Bool
-- ^ does the matchAction need live repo size information?
, matchDesc :: Bool -> MatchDesc
, matchNegationUnstable :: Bool
-- ^ does negating the matchAction lead to unstable behavior?
, matchDesc :: Maybe Bool -> MatchDesc
-- ^ displayed to the user to describe whether it matched or not
}