Add day to metadata when annex.genmetadata is enabled.

Thanks, Sean T Parsons
This commit is contained in:
Joey Hess 2017-10-25 15:11:12 -04:00
parent 64f1c09526
commit e8eacf96d5
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 11 additions and 2 deletions

View file

@ -60,10 +60,11 @@ dateMetaData :: UTCTime -> MetaData -> MetaData
dateMetaData mtime old = MetaData $ M.fromList $ filter isnew
[ (yearMetaField, S.singleton $ toMetaValue $ show y)
, (monthMetaField, S.singleton $ toMetaValue $ show m)
, (dayMetaField, S.singleton $ toMetaValue $ show d)
]
where
isnew (f, _) = S.null (currentMetaDataValues f old)
(y, m, _d) = toGregorian $ utctDay mtime
(y, m, d) = toGregorian $ utctDay mtime
{- Parses field=value, field+=value, field-=value, field?=value -}
parseModMeta :: String -> Either String ModMeta