Skip to content
Snippets Groups Projects
Unverified Commit 1d513540 authored by Joey Hess's avatar Joey Hess
Browse files

Fix build with old versions of feed library

parent 95f78cc1
Branches
Tags
No related merge requests found
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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment