From 291847bf88b9e013d73718dc918bbfcd8e4652f7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 21 Apr 2014 00:37:14 -0400 Subject: [PATCH] allow building with old feed lib, w/o pubdate --- Command/ImportFeed.hs | 4 ++++ git-annex.cabal | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Command/ImportFeed.hs b/Command/ImportFeed.hs index 80e59b7399..29f2fb148c 100644 --- a/Command/ImportFeed.hs +++ b/Command/ImportFeed.hs @@ -224,11 +224,15 @@ feedFile tmpl i extension = Utility.Format.format tmpl $ M.fromList fieldMaybe k Nothing = (k, "none") fieldMaybe k (Just v) = field k v +#if MIN_VERSION_feed(0,3,9) pubdate itm = case getItemPublishDate itm :: Maybe (Maybe UTCTime) of Just (Just d) -> Just $ formatTime defaultTimeLocale "%F" d -- if date cannot be parsed, use the raw string _ -> replace "/" "-" <$> getItemPublishDateString itm +#else + pubdate _ = Nothing +#endif {- Called when there is a problem with a feed. - Throws an error if the feed is broken, otherwise shows a warning. -} diff --git a/git-annex.cabal b/git-annex.cabal index 58bd03fef7..f7703335f0 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -211,7 +211,7 @@ Executable git-annex CPP-Options: -DWITH_DNS if flag(Feed) - Build-Depends: feed (>= 0.3.9.2) + Build-Depends: feed CPP-Options: -DWITH_FEED if flag(Quvi)