[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 15:01:03 UTC 2010


The following commit has been merged in the master branch:
commit 8f2890e3065f4d9d974d3a48ad4cf688b3ddedaf
Author: John Goerzen <jgoerzen at complete.org>
Date:   Fri Jul 22 22:09:36 2005 +0100

    New PlafCompat, PosixConsts modules.

diff --git a/MissingH/IO/HVFS.hs b/MissingH/IO/HVFS.hs
index 9e9c1c7..e9d3e99 100644
--- a/MissingH/IO/HVFS.hs
+++ b/MissingH/IO/HVFS.hs
@@ -67,11 +67,7 @@ import MissingH.IO.HVIO
 import MissingH.Time
 import System.IO
 import System.IO.Error
-#ifndef mingw32_HOST_OS
-import System.Posix.Files
-#else
-import MissingH.IO.WindowsCompat
-#endif
+import MissingH.IO.PlafCompat
 import System.Posix.Types
 import System.Time
 import System.Directory
diff --git a/MissingH/Maybe.hs b/MissingH/IO/PlafCompat.hs
similarity index 59%
copy from MissingH/Maybe.hs
copy to MissingH/IO/PlafCompat.hs
index 7e228b5..d465941 100644
--- a/MissingH/Maybe.hs
+++ b/MissingH/IO/PlafCompat.hs
@@ -1,5 +1,6 @@
-{- arch-tag: Maybe utilities
-Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
+{-# LANGUAGE CPP #-}
+{- Platform Compatibility Layer
+Copyright (C) 2005 John Goerzen <jgoerzen at complete.org>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -}
 
 {- |
-   Module     : MissingH.Maybe
+   Module     : MissingH.IO.PlafCompat
    Copyright  : Copyright (C) 2005 John Goerzen
    License    : GNU GPL, version 2 or above
 
@@ -26,17 +27,25 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    Stability  : provisional
    Portability: portable
 
-Utilities for working with the Either data type
+Exports appropriate System.Posix.* or "MissingH.IO.WindowsCompat" information,
+plus some additional generic platform data.
 
-Copyright (c) 2004 John Goerzen, jgoerzen\@complete.org
 -}
-module MissingH.Maybe
-    (
-     forceMaybe
-) where
-
-{- | Pulls a Just value out of a Maybe value.  If the Maybe value is
-Nothing, raises an exception with error. -}
-forceMaybe :: Maybe a -> a
-forceMaybe Nothing = error "forceMaybe: Got Nothing"
-forceMaybe (Just x) = x
+
+module MissingH.IO.PlafCompat
+    (nullFileName,
+#ifdef mingw32_HOST_OS
+     module MissingH.IO.WindowsCompat,
+#else
+     module System.Posix.Files,
+#endif
+     module System.Posix.Types)
+where
+
+import System.Posix.Types
+#ifdef mingw32_HOST_OS
+import MissingH.IO.WindowsCompat
+#else
+import System.Posix.Files
+#endif
+import MissingH.IO.PosixConsts
diff --git a/MissingH/Maybe.hs b/MissingH/IO/PosixConsts.hs
similarity index 53%
copy from MissingH/Maybe.hs
copy to MissingH/IO/PosixConsts.hs
index 7e228b5..1e2a1ee 100644
--- a/MissingH/Maybe.hs
+++ b/MissingH/IO/PosixConsts.hs
@@ -1,5 +1,6 @@
-{- arch-tag: Maybe utilities
-Copyright (C) 2004 John Goerzen <jgoerzen at complete.org>
+{-# LANGUAGE CPP #-}
+{- Posix consts not included with Haskell
+Copyright (C) 2005 John Goerzen <jgoerzen at complete.org>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 -}
 
 {- |
-   Module     : MissingH.Maybe
+   Module     : MissingH.IO.PosixConsts
    Copyright  : Copyright (C) 2005 John Goerzen
    License    : GNU GPL, version 2 or above
 
@@ -26,17 +27,35 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    Stability  : provisional
    Portability: portable
 
-Utilities for working with the Either data type
+Exports some POSIX constants and functions that are not exported in fptools
+by default.
 
-Copyright (c) 2004 John Goerzen, jgoerzen\@complete.org
 -}
-module MissingH.Maybe
-    (
-     forceMaybe
-) where
-
-{- | Pulls a Just value out of a Maybe value.  If the Maybe value is
-Nothing, raises an exception with error. -}
-forceMaybe :: Maybe a -> a
-forceMaybe Nothing = error "forceMaybe: Got Nothing"
-forceMaybe (Just x) = x
+
+blockSpecialMode :: FileMode
+blockSpecialMode = 0o0060000
+
+characterSpecialMode :: FileMode
+characterSpecialMode = 0o0020000
+
+namedPipeMode :: FileMode
+namedPipeMode = 0o0010000
+
+regularFileMode :: FileMode
+regularFileMode = 0o0100000
+
+directoryMode :: FileMode
+directoryMode = 0o0040000
+
+fileTypeModes :: FileMode
+fileTypeModes = 0o00170000
+
+socketMode :: FileMode
+socketMode = 0o0140000
+
+symbolicLinkMode :: FileMode
+symbolicLinkMode = 0o0120000
+
+intersectFileModes :: FileMode -> FileMode -> FileMode
+intersectFileModes m1 m2 = m1 .&. m2
+
diff --git a/MissingH/IO/StatCompat.hs b/MissingH/IO/StatCompat.hs
index 35ad38a..5e7a110 100644
--- a/MissingH/IO/StatCompat.hs
+++ b/MissingH/IO/StatCompat.hs
@@ -33,9 +33,10 @@ useful with HVFS and on Windows.  See also "MissingH.IO.WindowsCompat".
 Copyright (c) 2005 John Goerzen, jgoerzen\@complete.org
 -}
 
-module MissingH.IO.StatCompat
+module MissingH.IO.StatCompat 
 where
 import System.Posix.Types
+import MissingH.IO.PosixConsts
 import Data.Bits
 
 #ifdef mingw32_HOST_OS
@@ -45,29 +46,6 @@ type GroupID = Int
 
 #endif
 
-blockSpecialMode :: FileMode
-blockSpecialMode = 0o0060000
-
-characterSpecialMode :: FileMode
-characterSpecialMode = 0o0020000
-
-namedPipeMode :: FileMode
-namedPipeMode = 0o0010000
-
-regularFileMode :: FileMode
-regularFileMode = 0o0100000
-
-directoryMode :: FileMode
-directoryMode = 0o0040000
-
-fileTypeModes :: FileMode
-fileTypeModes = 0o00170000
-
-socketMode :: FileMode
-socketMode = 0o0140000
-
-symbolicLinkMode :: FileMode
-symbolicLinkMode = 0o0120000
 
 data FileStatusCompat = 
     FileStatusCompat {deviceID :: DeviceID,
@@ -83,9 +61,6 @@ data FileStatusCompat =
                       statusChangeTime :: EpochTime
                      }
     
-intersectFileModes :: FileMode -> FileMode -> FileMode
-intersectFileModes m1 m2 = m1 .&. m2
-
 sc_helper comp stat = 
     (fileMode stat `intersectFileModes` fileTypeModes) == comp
                                       
diff --git a/MissingH/IO/WindowsCompat.hs b/MissingH/IO/WindowsCompat.hs
index 967b97e..e1a57e1 100644
--- a/MissingH/IO/WindowsCompat.hs
+++ b/MissingH/IO/WindowsCompat.hs
@@ -63,6 +63,7 @@ where
 import System.Posix.Types
 import Data.Bits
 import MissingH.IO.StatCompat
+import MissingH.IO.PosixConsts
 import MissingH.Time
 import System.Directory
 
diff --git a/debian/changelog b/debian/changelog
index d989c47..2509050 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,8 @@
 missingh (0.11.3) unstable; urgency=low
 
   * Now added support for use on Windows.
-  * New modules: StatCompat, WindowsCompat, FilePath.
+  * New modules: StatCompat, WindowsCompat, FilePath, PlafCompat,
+    PosixConts.
 
  -- John Goerzen <jgoerzen at complete.org>  Fri, 22 Jul 2005 05:27:03 -0500
 

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list