Fix build with old versions of feed library
This commit is contained in:
parent
95f78cc1ce
commit
1d513540e9
2 changed files with 15 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
git-annex (8.20211124) UNRELEASED; urgency=medium
|
||||
|
||||
* Fix build with old versions of feed library.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Tue, 23 Nov 2021 15:58:27 -0400
|
||||
|
||||
git-annex (8.20211123) upstream; urgency=medium
|
||||
|
||||
* Bugfix: When -J was enabled, getting files could leak an
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE BangPatterns #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Command.ImportFeed where
|
||||
|
||||
|
@ -88,7 +89,7 @@ getFeed addunlockedmatcher opts cache url = do
|
|||
where
|
||||
-- Use parseFeedFromFile rather than reading the file
|
||||
-- ourselves because it goes out of its way to handle encodings.
|
||||
go tmpf = liftIO (parseFeedFromFile tmpf) >>= \case
|
||||
go tmpf = liftIO (parseFeedFromFile' tmpf) >>= \case
|
||||
Nothing -> debugfeedcontent tmpf "parsing the feed failed"
|
||||
Just f -> case findDownloads url f of
|
||||
[] -> debugfeedcontent tmpf "bad feed content; no enclosures to download"
|
||||
|
@ -109,6 +110,13 @@ getFeed addunlockedmatcher opts cache url = do
|
|||
showEndResult =<< feedProblem url
|
||||
(msg ++ " (use --debug --debugfilter=ImportFeed to see the feed content that was downloaded)")
|
||||
|
||||
parseFeedFromFile' :: FilePath -> IO (Maybe Feed)
|
||||
#if MIN_VERSION_feed(1,1,0)
|
||||
parseFeedFromFile' = parseFeedFromFile
|
||||
#else
|
||||
parseFeedFromFile' f = catchMaybeIO (parseFeedFromFile f)
|
||||
#endif
|
||||
|
||||
data ToDownload = ToDownload
|
||||
{ feed :: Feed
|
||||
, feedurl :: URLString
|
||||
|
|
Loading…
Add table
Reference in a new issue