[Pkg-haskell-commits] darcs: haskell98-report: Port tools/tex.hs and tools/index.hs to “new” Control.Exception (Closes: #713518)
Joachim Breitner
mail at joachim-breitner.de
Sat Jun 22 20:08:07 UTC 2013
Sat Jun 22 19:46:23 UTC 2013 Joachim Breitner <mail at joachim-breitner.de>
* Port tools/tex.hs and tools/index.hs to [_<U+201C>_]new[_<U+201D>_] Control.Exception (Closes: #713518)
M ./changelog +2
M ./patches/correct-build.patch -20 +123
Sat Jun 22 19:46:23 UTC 2013 Joachim Breitner <mail at joachim-breitner.de>
* Port tools/tex.hs and tools/index.hs to
new
Control.Exception (Closes: #713518)
diff -rN -u old-haskell98-report/changelog new-haskell98-report/changelog
--- old-haskell98-report/changelog 2013-06-22 20:08:07.179036317 +0000
+++ new-haskell98-report/changelog 2013-06-22 20:08:07.195036003 +0000
@@ -2,6 +2,8 @@
* Bump standards version, no change
* Enable compat level 9
+ * Port tools/tex.hs and tools/index.hs to ânewâ Control.Exception (Closes:
+ #713518)
-- Joachim Breitner <nomeata at debian.org> Sat, 13 Oct 2012 14:18:25 +0200
diff -rN -u old-haskell98-report/patches/correct-build.patch new-haskell98-report/patches/correct-build.patch
--- old-haskell98-report/patches/correct-build.patch 2013-06-22 20:08:07.167060286 +0000
+++ new-haskell98-report/patches/correct-build.patch 2013-06-22 20:08:07.187037116 +0000
@@ -1,7 +1,7 @@
Index: haskell98-report-20080907/ffi/Makefile
===================================================================
---- haskell98-report-20080907.orig/ffi/Makefile 2010-03-08 17:19:06.000000000 +0100
-+++ haskell98-report-20080907/ffi/Makefile 2012-04-20 19:52:30.000000000 +0200
+--- haskell98-report-20080907.orig/ffi/Makefile 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/ffi/Makefile 2013-06-22 21:34:52.596164892 +0200
@@ -1,9 +1,18 @@
+
+all: ffi.ps ffi.pdf
@@ -29,8 +29,8 @@
+ -rm -f *.aux *.log *.blg *.dvi *.bbl *.toc *.ps *.html *.css *.png *.4ct *.4tc *.idv *.xref tex4ht.fls *.pdf
Index: haskell98-report-20080907/hierarchical-modules/Makefile
===================================================================
---- haskell98-report-20080907.orig/hierarchical-modules/Makefile 2010-03-08 17:19:06.000000000 +0100
-+++ haskell98-report-20080907/hierarchical-modules/Makefile 2012-04-20 19:52:30.000000000 +0200
+--- haskell98-report-20080907.orig/hierarchical-modules/Makefile 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/hierarchical-modules/Makefile 2013-06-22 21:34:52.596164892 +0200
@@ -7,5 +7,6 @@
hier.pdf: hier.tex
TEXINPUTS=../styles: pdflatex $<
@@ -42,8 +42,8 @@
+ -rm -f *.aux *.log *.blg *.dvi *.bbl *.toc *.ps *.html *.css *.png *.4ct *.4tc *.idv *.xref tex4ht.fls *.pdf
Index: haskell98-report-20080907/Makefile
===================================================================
---- haskell98-report-20080907.orig/Makefile 2010-03-08 17:19:06.000000000 +0100
-+++ haskell98-report-20080907/Makefile 2012-04-20 19:52:30.000000000 +0200
+--- haskell98-report-20080907.orig/Makefile 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/Makefile 2013-06-22 21:34:52.596164892 +0200
@@ -1,14 +1,21 @@
-RELEASE_DIR = haskell98-revised
+PREFIX = haskell98-revised
@@ -74,8 +74,8 @@
-mkdir $(JFP_DIR)
Index: haskell98-report-20080907/report/classes.eps
===================================================================
---- haskell98-report-20080907.orig/report/classes.eps 2010-03-08 17:19:07.000000000 +0100
-+++ haskell98-report-20080907/report/classes.eps 2012-04-20 19:52:30.000000000 +0200
+--- haskell98-report-20080907.orig/report/classes.eps 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/report/classes.eps 2013-06-22 21:34:52.596164892 +0200
@@ -826,7 +826,8 @@
%%Trailer
%%DocumentNeededResources:
@@ -88,8 +88,8 @@
%%+ procset Pscript_FatalError 5.0 0
Index: haskell98-report-20080907/report/h98-revised.html
===================================================================
---- haskell98-report-20080907.orig/report/h98-revised.html 2010-03-08 17:19:07.000000000 +0100
-+++ haskell98-report-20080907/report/h98-revised.html 2012-04-20 19:52:30.000000000 +0200
+--- haskell98-report-20080907.orig/report/h98-revised.html 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/report/h98-revised.html 2013-06-22 21:34:52.600164891 +0200
@@ -28,13 +28,11 @@
<p><li> The Haskell 98 Report (revised)
<ul>
@@ -108,8 +108,8 @@
<a href="haskell98-bugs.html">A complete list of all changes</a> made to both reports between the Jan 1999 publication
Index: haskell98-report-20080907/report/Makefile
===================================================================
---- haskell98-report-20080907.orig/report/Makefile 2010-03-08 17:19:07.000000000 +0100
-+++ haskell98-report-20080907/report/Makefile 2012-04-20 21:23:18.000000000 +0200
+--- haskell98-report-20080907.orig/report/Makefile 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/report/Makefile 2013-06-22 21:34:52.600164891 +0200
@@ -40,7 +40,11 @@
# Files
#########################################
@@ -213,8 +213,8 @@
# Out of date stuff
Index: haskell98-report-20080907/tools/Makefile
===================================================================
---- haskell98-report-20080907.orig/tools/Makefile 2010-03-08 17:19:07.000000000 +0100
-+++ haskell98-report-20080907/tools/Makefile 2012-04-20 19:52:30.000000000 +0200
+--- haskell98-report-20080907.orig/tools/Makefile 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/tools/Makefile 2013-06-22 21:36:26.900161025 +0200
@@ -14,13 +14,16 @@
all : verbatim run_tex run_index
@@ -235,9 +235,9 @@
$(GHC) -o run_index index.hs -fglasgow-exts -H20m
Index: haskell98-report-20080907/tools/index.hs
===================================================================
---- haskell98-report-20080907.orig/tools/index.hs 2010-03-08 17:19:07.000000000 +0100
-+++ haskell98-report-20080907/tools/index.hs 2012-04-20 19:52:30.000000000 +0200
-@@ -6,8 +6,8 @@
+--- haskell98-report-20080907.orig/tools/index.hs 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/tools/index.hs 2013-06-22 21:44:53.500140256 +0200
+@@ -6,8 +6,9 @@
module Main where
@@ -245,14 +245,33 @@
-import Char
+import System.IO
+import Data.Char
++import Control.Exception(catch)
main = do refs <- readRefFile "reportrefs"
doFiles refs ["prelude-index"]
+@@ -20,7 +21,7 @@
+ ls <-readFile (f ++ ".idx")
+ let output = expandAllRefs r (lines ls)
+ writeFile ("haskell98-report-html/" ++ f ++ ".html") (unlines output))
+- (\err -> putStr ("Error: " ++ show err ++ "\n"))
++ (\err -> putStr ("Error: " ++ show (err::IOError) ++ "\n"))
+
+ -- This sets up the parts of the state that need to be reset at the start of
+ -- each file.
+@@ -129,7 +130,7 @@
+ readRefFile :: String -> IO [(String, String)]
+ readRefFile f = catch (do l <- readFile f
+ return (map parseKV (lines l)))
+- (\e -> do putStr ("Can't read ref file: " ++ f ++ "\n")
++ (\e -> do putStr ("Can't read ref file: " ++ f ++ ": " ++ show (e::IOError) ++ "\n")
+ return [])
+
+ parseKV l = let (k,l1) = span (/= '=') l
Index: haskell98-report-20080907/tools/tex.hs
===================================================================
---- haskell98-report-20080907.orig/tools/tex.hs 2010-03-08 17:19:07.000000000 +0100
-+++ haskell98-report-20080907/tools/tex.hs 2012-04-20 19:52:30.000000000 +0200
-@@ -78,11 +78,11 @@
+--- haskell98-report-20080907.orig/tools/tex.hs 2013-06-22 21:34:52.604164891 +0200
++++ haskell98-report-20080907/tools/tex.hs 2013-06-22 21:42:26.656146276 +0200
+@@ -78,11 +78,12 @@
module Main where
@@ -262,9 +281,93 @@
+import Control.Monad(foldM)
+import System.IO
+import Data.Char(isSpace, isAlpha, isDigit)
++import Control.Exception(catch)
-import IOExts(unsafePerformIO) -- debugging only
+import System.IO.Unsafe(unsafePerformIO) -- debugging only
data FontStyle = RM | IT | TT | Bold | Sym | UL
deriving (Eq,Show)
+@@ -216,7 +217,7 @@
+ "" -> return ()
+ f -> do putStr ("Writing reference file " ++ f ++ "\n")
+ catch (writeFile f (concat (map fmtKV (newRefMap s))))
+- (\e -> do putStr ("Can't write ref file: " ++ f ++ "\n" ++ show e)
++ (\e -> do putStr ("Can't write ref file: " ++ f ++ "\n" ++ show (e::IOError))
+ return ())
+ where fmtKV (k,v) = k ++ "=" ++ v ++ "\n"
+
+@@ -233,7 +234,8 @@
+ idx = htmlToString
+ (HProtect [HCmd cmd, HList "item" (HProtect hdrs)])
+ catch (writeFile f idx)
+- (\e -> do putStr ("Can't write index file: " ++ f ++ "\n")
++ (\e -> do putStr ("Can't write index file: " ++ f ++ ": " ++
++ show (e::IOError) ++ "\n")
+ return ())
+
+
+@@ -255,7 +257,7 @@
+ parseConfig f = catch
+ (do c <- readFile f
+ foldM configLine initState (lines c))
+- (\e -> error ("Can't read configuration file " ++ f))
++ (\e -> error ("Can't read configuration file " ++ f ++ ": " ++ show (e::IOError)))
+
+ configLine s l | "#" `starts` l = return s
+ | l == "" = return s
+@@ -286,20 +288,20 @@
+ -- completely read, because we are
+ -- going to write to it at the end
+ return (map parseKV (lines l)))
+- (\e -> do putStr ("Can't read ref file: " ++ f ++ "\n")
++ (\e -> do putStr ("Can't read ref file: " ++ f ++ ": " ++ show (e::IOError) ++ "\n")
+ return [])
+
+ readAuxFile :: String -> IO [(String,String)]
+ readAuxFile f = catch (do l <- readFile f
+ return (processAuxLines (lines l)))
+- (\e -> do putStr ("Can't read aux file: " ++ f ++ "\n")
++ (\e -> do putStr ("Can't read ref file: " ++ f ++ ": " ++ show (e::IOError) ++ "\n")
+ return [])
+
+ readAnchorFile :: String -> IO [String]
+ readAnchorFile f = catch (do l <- readFile f
+ return (lines l))
+ (\e -> do putStr ("Can't read anchor file: "
+- ++ f ++ "\n")
++ ++ f ++ ": " ++ show (e::IOError) ++ "\n")
+ return [])
+
+ -- Look for \newlabel{label}{value} in aux files. Ignore all else.
+@@ -405,10 +407,10 @@
+ catch (do writeFile outFile (htmlToString html)
+ return s'')
+ (\e -> do putStr ("Write to " ++ outFile ++
+- " failed.\n")
++ " failed: " ++ show (e::IOError) ++"\n")
+ return s'))
+ (\e -> do putStr ("File " ++ outFile ++
+- " error " ++ (show e) ++ "\n")
++ " error " ++ (show (e::IOError)) ++ "\n")
+ return s')
+
+ parseFileName f = let (re,rf) = span (/= '.') (reverse f) in
+@@ -1258,7 +1260,7 @@
+ then ".verb"
+ else ".tex"))
+ return (lines l1))
+- (\err -> do putStr ("Input error: " ++ show err)
++ (\err -> do putStr ("Input error: " ++ show (err::IOError))
+ return [])
+ doChar s "" (newLines ++ [l'] ++ ls')
+
+@@ -1266,7 +1268,7 @@
+ do putStr ("Reading Haskell input " ++ f ++ ".hs\n")
+ newLines <- catch (do l1 <- readFile (f ++ ".hs")
+ return (lines l1))
+- (\err -> do putStr ("Input error: " ++ show err)
++ (\err -> do putStr ("Input error: " ++ show (err::IOError))
+ return [])
+ s' <- emitCodeLines s newLines
+ doChar s' l' ls'
More information about the Pkg-haskell-commits
mailing list