Hello community,

here is the log from the commit of package hscolour for openSUSE:Factory 
checked in at 2015-05-13 07:12:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hscolour (Old)
 and      /work/SRC/openSUSE:Factory/.hscolour.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hscolour"

Changes:
--------
--- /work/SRC/openSUSE:Factory/hscolour/hscolour.changes        2014-11-26 
20:54:30.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.hscolour.new/hscolour.changes   2015-05-13 
07:12:39.000000000 +0200
@@ -1,0 +2,12 @@
+Fri Apr 10 14:30:54 UTC 2015 - [email protected]
+
+- update to 1.22 
++ bugfix for mIRC backend
++ ensure that line-number anchors do not reset in literate code fragments
+
+-------------------------------------------------------------------
+Sun Mar 15 14:39:09 UTC 2015 - [email protected]
+
+- update to 1.21 from upstream
+
+-------------------------------------------------------------------

Old:
----
  hscolour-1.20.3.tar.gz

New:
----
  hscolour-1.22.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hscolour.spec ++++++
--- /var/tmp/diff_new_pack.z8G895/_old  2015-05-13 07:12:40.000000000 +0200
+++ /var/tmp/diff_new_pack.z8G895/_new  2015-05-13 07:12:40.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package hscolour
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -22,7 +22,7 @@
 %global ghc_without_dynamic 1
 
 Name:           hscolour
-Version:        1.20.3
+Version:        1.22
 Release:        0
 Summary:        Colorise Haskell code
 License:        GPL-2.0

++++++ hscolour-1.20.3.tar.gz -> hscolour-1.22.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hscolour-1.20.3/Language/Haskell/HsColour/ACSS.hs 
new/hscolour-1.22/Language/Haskell/HsColour/ACSS.hs
--- old/hscolour-1.20.3/Language/Haskell/HsColour/ACSS.hs       2012-09-08 
16:51:23.000000000 +0200
+++ new/hscolour-1.22/Language/Haskell/HsColour/ACSS.hs 2015-03-17 
12:51:59.000000000 +0100
@@ -26,19 +26,21 @@
 
 -- | Formats Haskell source code using HTML and mouse-over annotations 
 hscolour :: Bool     -- ^ Whether to include anchors.
+         -> Int      -- ^ Starting line number (for line anchors).
          -> String   -- ^ Haskell source code, Annotations as comments at end
          -> String   -- ^ Coloured Haskell source code.
 
-hscolour anchor = hsannot anchor . splitSrcAndAnns
+hscolour anchor n = hsannot anchor n . splitSrcAndAnns
 
 -- | Formats Haskell source code using HTML and mouse-over annotations 
 hsannot  :: Bool             -- ^ Whether to include anchors.
+         -> Int              -- ^ Starting line number (for line anchors).
          -> (String, AnnMap) -- ^ Haskell Source, Annotations
          -> String           -- ^ Coloured Haskell source code.
 
-hsannot anchor = 
+hsannot anchor n = 
     CSS.pre
-    . (if anchor then -- renderNewLinesAnchors .
+    . (if anchor then -- renderNewLinesAnchors n .
                       concatMap (renderAnchors renderAnnotToken)
                       . insertAnnotAnchors
                  else concatMap renderAnnotToken)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hscolour-1.20.3/Language/Haskell/HsColour/CSS.hs 
new/hscolour-1.22/Language/Haskell/HsColour/CSS.hs
--- old/hscolour-1.20.3/Language/Haskell/HsColour/CSS.hs        2012-09-08 
16:51:23.000000000 +0200
+++ new/hscolour-1.22/Language/Haskell/HsColour/CSS.hs  2015-03-17 
12:51:59.000000000 +0100
@@ -13,13 +13,14 @@
 
 -- | Formats Haskell source code as a complete HTML document with CSS.
 hscolour :: Bool   -- ^ Whether to include anchors.
+         -> Int    -- ^ Starting line number (for line anchors).
          -> String -- ^ Haskell source code.
          -> String -- ^ An HTML document containing the coloured 
                    --   Haskell source code.
-hscolour anchor =
+hscolour anchor n =
   pre
   . (if anchor 
-        then renderNewLinesAnchors
+        then renderNewLinesAnchors n
              . concatMap (renderAnchors renderToken)
              . insertAnchors
         else concatMap renderToken)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hscolour-1.20.3/Language/Haskell/HsColour/HTML.hs 
new/hscolour-1.22/Language/Haskell/HsColour/HTML.hs
--- old/hscolour-1.20.3/Language/Haskell/HsColour/HTML.hs       2012-09-08 
16:51:23.000000000 +0200
+++ new/hscolour-1.22/Language/Haskell/HsColour/HTML.hs 2015-03-17 
12:51:59.000000000 +0100
@@ -17,11 +17,12 @@
 -- | Formats Haskell source code using HTML with font tags.
 hscolour :: ColourPrefs -- ^ Colour preferences.
          -> Bool        -- ^ Whether to include anchors.
+         -> Int         -- ^ Starting line number (for line anchors).
          -> String      -- ^ Haskell source code.
          -> String      -- ^ Coloured Haskell source code.
-hscolour pref anchor = 
+hscolour pref anchor n = 
     pre
-    . (if anchor then renderNewLinesAnchors
+    . (if anchor then renderNewLinesAnchors n
                       . concatMap (renderAnchors (renderToken pref))
                       . insertAnchors
                  else concatMap (renderToken pref))
@@ -55,8 +56,8 @@
 renderComment (x:xs) = escape [x] ++ renderComment xs
 renderComment [] = []
 
-renderNewLinesAnchors :: String -> String
-renderNewLinesAnchors = unlines . map render . zip [1..] . lines
+renderNewLinesAnchors :: Int -> String -> String
+renderNewLinesAnchors n = unlines . map render . zip [n..] . lines
     where render (line, s) = "<a name=\"line-" ++ show line ++ "\"></a>" ++ s
 
 -- Html stuff
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/hscolour-1.20.3/Language/Haskell/HsColour/InlineCSS.hs 
new/hscolour-1.22/Language/Haskell/HsColour/InlineCSS.hs
--- old/hscolour-1.20.3/Language/Haskell/HsColour/InlineCSS.hs  2012-09-08 
16:51:23.000000000 +0200
+++ new/hscolour-1.22/Language/Haskell/HsColour/InlineCSS.hs    2015-03-17 
12:51:59.000000000 +0100
@@ -11,13 +11,14 @@
 -- | Formats Haskell source code as a complete HTML document with inline 
styling
 hscolour :: ColourPrefs        -- ^ Preferences for styling.
          -> Bool   -- ^ Whether to include anchors.
+         -> Int    -- ^ Starting line number (for line anchors).
          -> String -- ^ Haskell source code.
          -> String -- ^ An HTML document containing the coloured 
                    --   Haskell source code.
-hscolour prefs anchor =
+hscolour prefs anchor n =
   pre
   . (if anchor 
-        then renderNewLinesAnchors
+        then renderNewLinesAnchors n
              . concatMap (renderAnchors (renderToken prefs))
              . insertAnchors
         else concatMap (renderToken prefs))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hscolour-1.20.3/Language/Haskell/HsColour/MIRC.hs 
new/hscolour-1.22/Language/Haskell/HsColour/MIRC.hs
--- old/hscolour-1.20.3/Language/Haskell/HsColour/MIRC.hs       2012-09-08 
16:51:23.000000000 +0200
+++ new/hscolour-1.22/Language/Haskell/HsColour/MIRC.hs 2015-03-17 
12:51:59.000000000 +0100
@@ -50,18 +50,18 @@
                                                    : code bg blink++s++"\^O"
 
 code :: Colour -> Bool -> String
-code Black   False = "1"
-code Red     False = "5"
-code Green   False = "3"
-code Yellow  False = "7"
-code Blue    False = "2"
-code Magenta False = "6"
+code Black   False = "01"
+code Red     False = "05"
+code Green   False = "03"
+code Yellow  False = "07"
+code Blue    False = "02"
+code Magenta False = "06"
 code Cyan    False = "10"
-code White   False = "0"
+code White   False = "00"
 code Black   True  = "14"
-code Red     True  = "4"
-code Green   True  = "9"
-code Yellow  True  = "8"
+code Red     True  = "04"
+code Green   True  = "09"
+code Yellow  True  = "08"
 code Blue    True  = "12"
 code Magenta True  = "13"
 code Cyan    True  = "11"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hscolour-1.20.3/Language/Haskell/HsColour.hs 
new/hscolour-1.22/Language/Haskell/HsColour.hs
--- old/hscolour-1.20.3/Language/Haskell/HsColour.hs    2012-09-08 
16:51:23.000000000 +0200
+++ new/hscolour-1.22/Language/Haskell/HsColour.hs      2015-03-17 
12:51:59.000000000 +0100
@@ -40,28 +40,31 @@
          -> String      -- ^ Coloured Haskell source code.
 hscolour output pref anchor partial title False =
         (if partial then id else top'n'tail output title) .
-        hscolour' output pref anchor
+        hscolour' output pref anchor 1
 hscolour output pref anchor partial title True  =
         (if partial then id else top'n'tail output title) .
-        concatMap chunk . joinL . classify . inlines
+        concat . chunk 1 . joinL . classify . inlines
   where
-    chunk (Code c) = hscolour' output pref anchor c
-    chunk (Lit c)  = c
+    chunk _        []     = []
+    chunk n (Code c: cs)  = hscolour' output pref anchor n c
+                              : chunk (n + length (lines c)) cs
+    chunk n (Lit c:  cs)  = c : chunk n cs
 
 -- | The actual colourising worker, despatched on the chosen output format.
 hscolour' :: Output      -- ^ Output format.
           -> ColourPrefs -- ^ Colour preferences (for formats that support 
them)
           -> Bool        -- ^ Whether to include anchors.
+          -> Int         -- ^ Starting line number (for line anchors)
           -> String      -- ^ Haskell source code.
           -> String      -- ^ Coloured Haskell source code.
-hscolour' TTY       pref _      = TTY.hscolour     pref
-hscolour' (TTYg tt) pref _      = TTY.hscolourG tt pref
-hscolour' MIRC      pref _      = MIRC.hscolour    pref
-hscolour' LaTeX     pref _      = LaTeX.hscolour   pref
-hscolour' HTML      pref anchor = HTML.hscolour    pref anchor
-hscolour' CSS       _    anchor = CSS.hscolour          anchor
-hscolour' ICSS      pref anchor = ICSS.hscolour    pref anchor
-hscolour' ACSS      _    anchor = ACSS.hscolour         anchor
+hscolour' TTY       pref _      _ = TTY.hscolour     pref
+hscolour' (TTYg tt) pref _      _ = TTY.hscolourG tt pref
+hscolour' MIRC      pref _      _ = MIRC.hscolour    pref
+hscolour' LaTeX     pref _      _ = LaTeX.hscolour   pref
+hscolour' HTML      pref anchor n = HTML.hscolour    pref anchor n
+hscolour' CSS       _    anchor n = CSS.hscolour          anchor n
+hscolour' ICSS      pref anchor n = ICSS.hscolour    pref anchor n
+hscolour' ACSS      _    anchor n = ACSS.hscolour         anchor n
 
 -- | Choose the right headers\/footers, depending on the output format.
 top'n'tail :: Output           -- ^ Output format
@@ -96,15 +99,22 @@
 classify ::  [String] -> [Lit]
 classify []             = []
 classify (x:xs) | "\\begin{code}"`isPrefixOf`x
-                        = Lit x: allProg xs
-   where allProg []     = []  -- Should give an error message,
-                              -- but I have no good position information.
-         allProg (x:xs) | "\\end{code}"`isPrefixOf`x
-                        = Lit x: classify xs
-         allProg (x:xs) = Code x: allProg xs
+                        = Lit x: allProg "code" xs
+classify (x:xs) | "\\begin{spec}"`isPrefixOf`x
+                        = Lit x: allProg "spec" xs
 classify (('>':x):xs)   = Code ('>':x) : classify xs
 classify (x:xs)         = Lit x: classify xs
 
+
+allProg name  = go 
+  where
+    end       = "\\end{" ++ name ++ "}"
+    go []     = []  -- Should give an error message,
+                    -- but I have no good position information.
+    go (x:xs) | end `isPrefixOf `x
+              = Lit x: classify xs
+    go (x:xs) = Code x: go xs
+
 -- | Join up chunks of code\/comment that are next to each other.
 joinL :: [Lit] -> [Lit]
 joinL []                  = []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hscolour-1.20.3/hscolour.cabal 
new/hscolour-1.22/hscolour.cabal
--- old/hscolour-1.20.3/hscolour.cabal  2012-09-08 16:51:23.000000000 +0200
+++ new/hscolour-1.22/hscolour.cabal    2015-03-17 12:52:00.000000000 +0100
@@ -1,6 +1,6 @@
 Name: hscolour
-Version: 1.20.3
-Copyright: 2003-2012 Malcolm Wallace; 2006 Bjorn Bringert
+Version: 1.22
+Copyright: 2003-2015 Malcolm Wallace; 2006 Bjorn Bringert
 Maintainer: Malcolm Wallace
 Author: Malcolm Wallace
 Homepage: http://code.haskell.org/~malcolm/hscolour/
@@ -51,7 +51,7 @@
   Main-is: HsColour.hs
   --ghc-options: -O -W
   Extensions: CPP
-  cpp-options: -DMAJOR=1 -DMINOR=20
+  cpp-options: -DMAJOR=1 -DMINOR=22
 
 
 


Reply via email to