[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 14:50:01 UTC 2010


The following commit has been merged in the master branch:
commit 0ad816a1f5a8f5073f37860d5072f38295d7af4d
Author: John Goerzen <jgoerzen at complete.org>
Date:   Sat Dec 4 11:33:56 2004 +0100

    Checkpointing
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.7--patch-39)

diff --git a/ChangeLog b/ChangeLog
index 0661449..78f9252 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,19 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.7
 #
 
+2004-12-04 04:33:56 GMT	John Goerzen <jgoerzen at complete.org>	patch-39
+
+    Summary:
+      Checkpointing
+    Revision:
+      missingh--head--0.7--patch-39
+
+
+    modified files:
+     ChangeLog libsrc/MissingH/FileArchive/GZip.hs
+     testsrc/GZiptest.hs
+
+
 2004-12-04 04:20:48 GMT	John Goerzen <jgoerzen at complete.org>	patch-38
 
     Summary:
diff --git a/libsrc/MissingH/FileArchive/GZip.hs b/libsrc/MissingH/FileArchive/GZip.hs
index 3023de5..a3aaaff 100644
--- a/libsrc/MissingH/FileArchive/GZip.hs
+++ b/libsrc/MissingH/FileArchive/GZip.hs
@@ -72,7 +72,7 @@ split1 s = (head s, tail s)
 {- | Read a GZip file.
 -}
 
-decompress :: String -> Either GZipError String
+decompress :: String -> Either GZipError (String, Bool)
 {-
 decompress s = 
     do x <- read_header s
@@ -80,9 +80,20 @@ decompress s =
        return $ inflate_string rem
 -}
 
+decompress s = 
+    let procs :: [Section] -> (String, Bool)
+        procs [] = ([], True)
+        procs ((_, content, foot):xs) = 
+            let (nexth, nextb) = procs xs in
+                (content ++ nexth, (crc32valid foot) && nextb)
+        in
+        do x <- read_sections s
+           return $ procs x
+
+{-
 decompress s = do x <- read_sections s
                   return $ concatMap (\(_, x, _) -> x) x
-
+-}
 
 -- | Read all sections.  
 read_sections :: String -> Either GZipError [Section]
diff --git a/testsrc/GZiptest.hs b/testsrc/GZiptest.hs
index cd89fb4..e1e0adb 100644
--- a/testsrc/GZiptest.hs
+++ b/testsrc/GZiptest.hs
@@ -74,7 +74,7 @@ test_gunzip =
     let f fn exp = mf fn (Right exp) decompress
         in
         [
-         f "t1.gz" "Test 1"
+         f "t1.gz" ("Test 1", True)
         ]
 
 tests = TestList [TestLabel "inflate" (TestList test_inflate),

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list