importfeed: Error out when passed a non-url.
This commit is contained in:
parent
aa31af5594
commit
3695094454
3 changed files with 19 additions and 9 deletions
|
@ -146,15 +146,17 @@ findDownloads u = go =<< downloadFeed u
|
||||||
|
|
||||||
{- Feeds change, so a feed download cannot be resumed. -}
|
{- Feeds change, so a feed download cannot be resumed. -}
|
||||||
downloadFeed :: URLString -> Annex (Maybe Feed)
|
downloadFeed :: URLString -> Annex (Maybe Feed)
|
||||||
downloadFeed url = do
|
downloadFeed url
|
||||||
showOutput
|
| Url.parseURIRelaxed url == Nothing = error "invalid feed url"
|
||||||
uo <- Url.getUrlOptions
|
| otherwise = do
|
||||||
liftIO $ withTmpFile "feed" $ \f h -> do
|
showOutput
|
||||||
hClose h
|
uo <- Url.getUrlOptions
|
||||||
ifM (Url.download url f uo)
|
liftIO $ withTmpFile "feed" $ \f h -> do
|
||||||
( parseFeedString <$> readFileStrictAnyEncoding f
|
hClose h
|
||||||
, return Nothing
|
ifM (Url.download url f uo)
|
||||||
)
|
( parseFeedString <$> readFileStrictAnyEncoding f
|
||||||
|
, return Nothing
|
||||||
|
)
|
||||||
|
|
||||||
performDownload :: Opts -> Cache -> ToDownload -> Annex Bool
|
performDownload :: Opts -> Cache -> ToDownload -> Annex Bool
|
||||||
performDownload opts cache todownload = case location todownload of
|
performDownload opts cache todownload = case location todownload of
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -13,6 +13,7 @@ git-annex (5.20150406.2) UNRELEASED; urgency=medium
|
||||||
* info: Display repository mode: bare when in a bare (non-direct mode)
|
* info: Display repository mode: bare when in a bare (non-direct mode)
|
||||||
repo.
|
repo.
|
||||||
* importfeed: Fix feed download when curl is used.
|
* importfeed: Fix feed download when curl is used.
|
||||||
|
* importfeed: Error out when passed a non-url.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Mon, 06 Apr 2015 20:14:20 -0400
|
-- Joey Hess <id@joeyh.name> Mon, 06 Apr 2015 20:14:20 -0400
|
||||||
|
|
||||||
|
|
|
@ -26,3 +26,10 @@ Is it possible to use local files in rss format with items which reference local
|
||||||
|
|
||||||
Cheers,
|
Cheers,
|
||||||
Marco
|
Marco
|
||||||
|
|
||||||
|
> I've fixed it with file:// urls.
|
||||||
|
>
|
||||||
|
> Also made it error out on non-url feed inputs, which are not intended to be
|
||||||
|
> supported.
|
||||||
|
>
|
||||||
|
> [[done]] --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue