Bug#622675: Should use new HaXml
Package: hpodder
Version: 1.1.5.0+nmu2
Severity: wishlist
Tags: patch
Hi.
The new stable version of HaXml is 1.20. This patch makes it build with the
new HaXml. We're planning to upload the new version of HaXml and it would be
good to have all packages buildable with the new HaXml after that.
Greetings.
-- System Information:
Debian Release: 6.0.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=pt_BR.utf8, LC_CTYPE=pt_BR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nudar hpodder-1.1.5/Commands/SetStatus.hs hpodder-1.1.5.new/Commands/SetStatus.hs
--- hpodder-1.1.5/Commands/SetStatus.hs 2008-07-02 15:32:27.000000000 +0000
+++ hpodder-1.1.5.new/Commands/SetStatus.hs 2011-04-13 18:38:33.000000000 +0000
@@ -57,7 +57,7 @@
Nothing -> fail "setstatus: --castid required; see hpodder setstatus --help"
newstatus <- case lookup "status" args of
Just x -> E.catch (E.evaluate (read x))
- (\_ -> fail $ "Invalid status supplied; use one of: " ++ possibleStatuses)
+ ((\_ -> fail $ "Invalid status supplied; use one of: " ++ possibleStatuses) :: E.SomeException -> IO a)
Nothing -> fail "setstatus: --status required; see hpodder setstatus --help"
podcastlist <- getPodcast (gdbh gi) podcastid
pc <- case podcastlist of
diff -Nudar hpodder-1.1.5/FeedParser.hs hpodder-1.1.5.new/FeedParser.hs
--- hpodder-1.1.5/FeedParser.hs 2008-07-02 15:32:27.000000000 +0000
+++ hpodder-1.1.5.new/FeedParser.hs 2011-04-13 18:25:57.000000000 +0000
@@ -33,6 +33,7 @@
import Types
import Text.XML.HaXml
import Text.XML.HaXml.Parse
+import Text.XML.HaXml.Posn
import Utils
import Data.Maybe.Utils
import Data.Char
@@ -76,7 +77,7 @@
let feeditems = getEnclosures doc
return $ Right $
(Feed {channeltitle = title, items = feeditems})
- where getContent (Document _ _ e _) = CElem e
+ where getContent (Document _ _ e _) = CElem e noPos
unifrob ('\xef':'\xbb':'\xbf':x) = x -- Strip off unicode BOM
unifrob x = x
@@ -121,13 +122,13 @@
-- Utilities
--------------------------------------------------
-attrofelem :: String -> Content -> Maybe AttValue
-attrofelem attrname (CElem inelem) =
+attrofelem :: String -> Content Posn -> Maybe AttValue
+attrofelem attrname (CElem inelem _) =
case unesc inelem of
Elem name al _ -> lookup attrname al
attrofelem _ _ =
error "attrofelem: called on something other than a CElem"
-stratt :: String -> Content -> Maybe [String]
+stratt :: String -> Content Posn -> Maybe [String]
stratt attrname content =
case attrofelem attrname content of
Just (AttValue x) -> Just (concat . map mapfunc $ x)
@@ -136,17 +137,18 @@
mapfunc (Right _) = []
-- Finds the literal children of the named tag, and returns it/them
-tagof :: String -> CFilter
+tagof :: String -> CFilter Posn
tagof x = keep /> tag x -- /> txt
-- Retruns the literal string that tagof would find
-strof :: String -> Content -> String
+strof :: String -> Content Posn -> String
strof x y = forceEither $ strof_either x y
-strof_either :: String -> Content -> Either String String
+strof_either :: String -> Content Posn -> Either String String
strof_either x y =
case tagof x $ y of
- [CElem elem] -> Right $ verbatim $ tag x /> txt $ CElem (unesc elem)
+ [CElem elem pos] -> Right $ verbatim $ tag x /> txt
+ $ CElem (unesc elem) pos
z -> Left $ "strof: expecting CElem in " ++ x ++ ", got "
++ verbatim z ++ " at " ++ verbatim y
diff -Nudar hpodder-1.1.5/hpodder.cabal hpodder-1.1.5.new/hpodder.cabal
--- hpodder-1.1.5/hpodder.cabal 2008-07-02 15:32:27.000000000 +0000
+++ hpodder-1.1.5.new/hpodder.cabal 2011-04-13 17:32:22.000000000 +0000
@@ -69,7 +69,7 @@
beginning. It should be exceedingly difficult to lose a podcast
episode, even in the event of a power failure.
Build-Depends: haskell98, network, unix, parsec, MissingH>=1.0.0,
- HDBC>=1.1.0, HDBC-sqlite3>=1.1.0, mtl, base, HaXml>=1.13.2, HaXml<1.19, hslogger,
+ HDBC>=1.1.0, HDBC-sqlite3>=1.1.0, mtl, base, HaXml == 1.20.*, hslogger,
ConfigFile, filepath, old-time, directory, process
Executable: hpodder
Reply to: