Commit db02a88d authored by Joachim Breitner's avatar Joachim Breitner

darcs-monitor: Add patches to compile with newer base and current HaXml

parent 65d615b5
darcs-monitor (0.4.2-2) UNRELEASED; urgency=low
* Add patches to compile with newer base and current HaXml (Closes: #629784)
-- Joachim Breitner <nomeata@debian.org> Sat, 18 May 2013 15:54:22 +0200
darcs-monitor (0.4.2-1) experimental; urgency=low
* New upstream version.
......
......@@ -8,8 +8,8 @@ Build-Depends: debhelper (>= 7)
, haskell-devscripts (>= 0.8.13)
, ghc
, libghc-mtl-dev
, libghc-haxml-dev (>= 1:1.20)
, libghc-haxml-dev (<< 1:1.21)
, libghc-haxml-dev (>= 1:1.22)
, libghc-haxml-dev (<< 1:1.24)
Standards-Version: 3.9.4
Homepage: http://wiki.darcs.net/RelatedSoftware/DarcsMonitor
Vcs-Darcs: http://darcs.debian.org/pkg-haskell/darcs-monitor
......
Description: Use Control.Exception.catch
Author: Joachim Breitner <nomeata@debian.org>
--- darcs-monitor-0.4.2.orig/darcs-monitor.hs
+++ darcs-monitor-0.4.2/darcs-monitor.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE ScopedTypeVariables #-}
{- darcs-monitor - Darcs repository monitor
Copyright © 2007 Antti-Juhani Kaijanaho
Copyright © 2007 Benja Fallenstein
@@ -36,6 +37,7 @@ import System.Exit
import System.IO
import Text.XML.HaXml hiding (when,version,x,tag,cdata)
import Text.XML.HaXml.Posn
+import Control.Exception (catch, IOException)
import Config
import Darcs
@@ -184,7 +186,7 @@ readSeenPatches :: MonadIO m => String -
readSeenPatches repo =
liftIO $ catch (do fc <- readFile (repo ++ seenPatchesFileName)
return (read fc)
- ) $ \_ -> return Map.empty
+ ) $ \(_::IOException) -> return Map.empty
processRepo :: (MonadConfig m, MonadIO m) => Bool -> Command m -> FilePath -> m ()
Description: HaXml 2.22 compatibilitiy
Author: Joachim Breitner <nomeata@debian.org>
Bug-Debian: http://bugs.debian.org/629784
--- darcs-monitor-0.4.2.orig/darcs-monitor.cabal
+++ darcs-monitor-0.4.2/darcs-monitor.cabal
@@ -28,7 +28,7 @@ flag splitBase
description: Choose the new smaller, split-up base package.
Executable darcs-monitor
- Build-Depends: mtl, HaXml == 1.20.*
+ Build-Depends: mtl, HaXml >= 1.22 && <= 1.24
if flag(splitBase)
Build-Depends: base >=3 && < 5, containers, directory, process
else
--- darcs-monitor-0.4.2.orig/darcs-monitor.hs
+++ darcs-monitor-0.4.2/darcs-monitor.hs
@@ -194,15 +196,15 @@ processRepo dryRun (tag,cmd) repo' = do
liftIO $ createDirectoryIfMissing True (repo++dir)
seenPatches <- readSeenPatches repo
xml <- invokeDarcs ["changes", "--reverse", "--repo="++repo,"--xml-output","-a"]
- let Document _ _ (Elem "changelog" _ content) _ = xmlParse repo xml
+ let Document _ _ (Elem (N "changelog") _ content) _ = xmlParse repo xml
let patches
= filter (\c -> case c of CElem _e _ -> True ; _ -> False) content
- spl <- forM patches $ \ (CElem (Elem "patch" attrs content_) _) ->
- do let author = getAttr "author" attrs
- localDate = getAttr "local_date" attrs
- hash = getAttr "hash" attrs
- name = getElem "name" content_
- comment = getElem "comment" content_
+ spl <- forM patches $ \ (CElem (Elem (N "patch") attrs content_) _) ->
+ do let author = getAttr (N "author") attrs
+ localDate = getAttr (N "local_date") attrs
+ hash = getAttr (N "hash") attrs
+ name = getElem (N "name") content_
+ comment = getElem (N "comment") content_
(authorName, authorEmail) = parseAuthor author
dt = PatchData { patchRepo = repo
, patchAuthor = authorName
@@ -251,7 +253,7 @@ getAttr name attrs = case lookup name at
massage ss
massage [] = id
-getElem :: Name -> [Content Posn] -> String
+getElem :: QName -> [Content Posn] -> String
getElem name (CElem (Elem name' _ content) _ : _rest)
| name == name' = getContent content ""
getElem name (_ : rest) = getElem name rest
Markdown is supported
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