improve message about 1 copy
authorJoey Hess <joeyh@joeyh.name>
Mon, 4 Dec 2023 15:12:54 +0000 (11:12 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 4 Dec 2023 15:12:54 +0000 (11:12 -0400)
"Could only verify the existence of 0 out of 1 necessary copy"
does not sound right, but neither does it with "copies".

Kept the "1" rather than "only" or such since numcopies is mentioned.

Sponsored-by: Brock Spratlen on Patreon
Annex/NumCopies.hs

index 1d8722a3d4dd5599e7c6d21546ea658b4cea7a9a..69b1943d87f83e9d6ab60bb1dbd9a7678b8228a9 100644 (file)
@@ -282,9 +282,11 @@ notEnoughCopies key neednum needmin have skip bad nolocmsg lockunsupported = do
        showNote "unsafe"
        if length have < fromNumCopies neednum
                then showLongNote $ UnquotedString $
-                       "Could only verify the existence of " ++
-                       show (length have) ++ " out of " ++ show (fromNumCopies neednum) ++ 
-                       " necessary " ++ pluralCopies (fromNumCopies neednum)
+                       if fromNumCopies neednum == 1
+                               then "Could not verify the existence of the 1 necessary copy."
+                               else "Could only verify the existence of " ++
+                                       show (length have) ++ " out of " ++ show (fromNumCopies neednum) ++ 
+                                       " necessary " ++ pluralCopies (fromNumCopies neednum) ++ "."
                else do
                        showLongNote $ UnquotedString $ "Unable to lock down " ++ show (fromMinCopies needmin) ++ 
                                " " ++ pluralCopies (fromMinCopies needmin) ++