allow building with old feed lib, w/o pubdate
(cherry picked from commit 291847bf88
)
This commit is contained in:
parent
3b4f8c1784
commit
997c7a5d6e
2 changed files with 5 additions and 1 deletions
|
@ -224,11 +224,15 @@ feedFile tmpl i extension = Utility.Format.format tmpl $ M.fromList
|
||||||
fieldMaybe k Nothing = (k, "none")
|
fieldMaybe k Nothing = (k, "none")
|
||||||
fieldMaybe k (Just v) = field k v
|
fieldMaybe k (Just v) = field k v
|
||||||
|
|
||||||
|
#if MIN_VERSION_feed(0,3,9)
|
||||||
pubdate itm = case getItemPublishDate itm :: Maybe (Maybe UTCTime) of
|
pubdate itm = case getItemPublishDate itm :: Maybe (Maybe UTCTime) of
|
||||||
Just (Just d) -> Just $
|
Just (Just d) -> Just $
|
||||||
formatTime defaultTimeLocale "%F" d
|
formatTime defaultTimeLocale "%F" d
|
||||||
-- if date cannot be parsed, use the raw string
|
-- if date cannot be parsed, use the raw string
|
||||||
_ -> replace "/" "-" <$> getItemPublishDateString itm
|
_ -> replace "/" "-" <$> getItemPublishDateString itm
|
||||||
|
#else
|
||||||
|
pubdate _ = Nothing
|
||||||
|
#endif
|
||||||
|
|
||||||
{- Called when there is a problem with a feed.
|
{- Called when there is a problem with a feed.
|
||||||
- Throws an error if the feed is broken, otherwise shows a warning. -}
|
- Throws an error if the feed is broken, otherwise shows a warning. -}
|
||||||
|
|
|
@ -211,7 +211,7 @@ Executable git-annex
|
||||||
CPP-Options: -DWITH_DNS
|
CPP-Options: -DWITH_DNS
|
||||||
|
|
||||||
if flag(Feed)
|
if flag(Feed)
|
||||||
Build-Depends: feed (>= 0.3.9.2)
|
Build-Depends: feed
|
||||||
CPP-Options: -DWITH_FEED
|
CPP-Options: -DWITH_FEED
|
||||||
|
|
||||||
if flag(Quvi)
|
if flag(Quvi)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue