Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-unix-compat for openSUSE:Factory
checked in at 2021-02-16 22:37:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-unix-compat (Old)
and /work/SRC/openSUSE:Factory/.ghc-unix-compat.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-unix-compat"
Tue Feb 16 22:37:40 2021 rev:20 rq:870465 version:0.5.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-unix-compat/ghc-unix-compat.changes
2020-12-22 11:48:20.245953429 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-unix-compat.new.28504/ghc-unix-compat.changes
2021-02-16 22:45:47.326369562 +0100
@@ -1,0 +2,6 @@
+Sun Jan 24 16:08:26 UTC 2021 - [email protected]
+
+- Update unix-compat to version 0.5.3.
+ Upstream does not provide a change log file.
+
+-------------------------------------------------------------------
Old:
----
unix-compat-0.5.2.tar.gz
unix-compat.cabal
New:
----
unix-compat-0.5.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-unix-compat.spec ++++++
--- /var/tmp/diff_new_pack.bAaDGy/_old 2021-02-16 22:45:48.094370572 +0100
+++ /var/tmp/diff_new_pack.bAaDGy/_new 2021-02-16 22:45:48.098370577 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-unix-compat
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,13 +18,12 @@
%global pkg_name unix-compat
Name: ghc-%{pkg_name}
-Version: 0.5.2
+Version: 0.5.3
Release: 0
Summary: Portable POSIX-compatibility layer
License: BSD-3-Clause
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-unix-devel
@@ -47,7 +46,6 @@
%prep
%autosetup -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ unix-compat-0.5.2.tar.gz -> unix-compat-0.5.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/unix-compat-0.5.2/src/System/PosixCompat/Files.hsc
new/unix-compat-0.5.3/src/System/PosixCompat/Files.hsc
--- old/unix-compat-0.5.2/src/System/PosixCompat/Files.hsc 2001-09-09
03:46:40.000000000 +0200
+++ new/unix-compat-0.5.3/src/System/PosixCompat/Files.hsc 2001-09-09
03:46:40.000000000 +0200
@@ -59,6 +59,9 @@
, accessTime
, modificationTime
, statusChangeTime
+ , accessTimeHiRes
+ , modificationTimeHiRes
+ , statusChangeTimeHiRes
, isBlockDevice
, isCharacterDevice
, isNamedPipe
@@ -120,6 +123,7 @@
import Control.Monad (liftM, liftM2)
import Data.Bits ((.|.), (.&.))
import Data.Int (Int64)
+import Data.Time.Clock.POSIX (POSIXTime)
import Foreign.C.Types (CTime(..))
import Prelude hiding (read)
import System.Directory (Permissions, emptyPermissions)
@@ -129,8 +133,7 @@
import System.Directory (executable, setOwnerExecutable)
import System.Directory (searchable, setOwnerSearchable)
import System.Directory (doesFileExist, doesDirectoryExist)
-import System.Directory (getModificationTime, renameFile)
-import System.IO (IOMode(..), openFile, hFileSize, hSetFileSize, hClose)
+import System.IO (IOMode(..), openFile, hSetFileSize, hClose)
import System.IO.Error
import System.PosixCompat.Types
import System.Win32.File hiding (getFileType)
@@ -139,7 +142,6 @@
import System.PosixCompat.Internal.Time (
getClockTime, clockTimeToEpochTime
- , modificationTimeToEpochTime
)
#ifdef __GLASGOW_HASKELL__
@@ -267,17 +269,20 @@
-- stat() support
data FileStatus = FileStatus
- { deviceID :: DeviceID
- , fileID :: FileID
- , fileMode :: FileMode
- , linkCount :: LinkCount
- , fileOwner :: UserID
- , fileGroup :: GroupID
- , specialDeviceID :: DeviceID
- , fileSize :: FileOffset
- , accessTime :: EpochTime
- , modificationTime :: EpochTime
- , statusChangeTime :: EpochTime
+ { deviceID :: DeviceID
+ , fileID :: FileID
+ , fileMode :: FileMode
+ , linkCount :: LinkCount
+ , fileOwner :: UserID
+ , fileGroup :: GroupID
+ , specialDeviceID :: DeviceID
+ , fileSize :: FileOffset
+ , accessTime :: EpochTime
+ , modificationTime :: EpochTime
+ , statusChangeTime :: EpochTime
+ , accessTimeHiRes :: POSIXTime
+ , modificationTimeHiRes :: POSIXTime
+ , statusChangeTimeHiRes :: POSIXTime
}
isBlockDevice :: FileStatus -> Bool
@@ -312,9 +317,10 @@
getFileStatus path = do
perm <- liftM permsToMode (getPermissions path)
typ <- getFileType path
- size <- if typ == regularFileMode then getFileSize path else return 0
- mtime <- liftM modificationTimeToEpochTime (getModificationTime path)
info <- bracket openPath closeHandle getFileInformationByHandle
+ let atime = windowsToPosixTime (bhfiLastAccessTime info)
+ mtime = windowsToPosixTime (bhfiLastWriteTime info)
+ ctime = windowsToPosixTime (bhfiCreationTime info)
return $ FileStatus
{ deviceID = fromIntegral (bhfiVolumeSerialNumber info)
, fileID = fromIntegral (bhfiFileIndex info)
@@ -323,10 +329,14 @@
, fileOwner = 0
, fileGroup = 0
, specialDeviceID = 0
- , fileSize = size
- , accessTime = mtime
- , modificationTime = mtime
- , statusChangeTime = mtime }
+ , fileSize = fromIntegral (bhfiSize info)
+ , accessTime = posixTimeToEpochTime atime
+ , modificationTime = posixTimeToEpochTime mtime
+ , statusChangeTime = posixTimeToEpochTime mtime
+ , accessTimeHiRes = atime
+ , modificationTimeHiRes = mtime
+ , statusChangeTimeHiRes = ctime
+ }
where
openPath = createFile path
gENERIC_READ
@@ -336,6 +346,32 @@
(sECURITY_ANONYMOUS .|. fILE_FLAG_BACKUP_SEMANTICS)
Nothing
+-- | Convert a 'POSIXTime' (synomym for 'Data.Time.Clock.NominalDiffTime')
+-- into an 'EpochTime' (integral number of seconds since epoch). This merely
+-- throws away the fractional part.
+posixTimeToEpochTime :: POSIXTime -> EpochTime
+posixTimeToEpochTime = fromInteger . floor
+
+-- three function stolen from System.Directory.Internals.Windows:
+
+-- | Difference between the Windows and POSIX epochs in units of 100ns.
+windowsPosixEpochDifference :: Num a => a
+windowsPosixEpochDifference = 116444736000000000
+
+-- | Convert from Windows time to POSIX time.
+windowsToPosixTime :: FILETIME -> POSIXTime
+windowsToPosixTime (FILETIME t) =
+ (fromIntegral t - windowsPosixEpochDifference) / 10000000
+
+{- will be needed to /set/ high res timestamps, not yet supported
+
+-- | Convert from POSIX time to Windows time. This is lossy as Windows time
+-- has a resolution of only 100ns.
+posixToWindowsTime :: POSIXTime -> FILETIME
+posixToWindowsTime t = FILETIME $
+ truncate (t * 10000000 + windowsPosixEpochDifference)
+-}
+
permsToMode :: Permissions -> FileMode
permsToMode perms = r .|. w .|. x
where
@@ -354,10 +390,6 @@
if d then return directoryMode
else unsupported "Unknown file type."
-getFileSize :: FilePath -> IO FileOffset
-getFileSize path =
- bracket (openFile path ReadMode) hClose (liftM fromIntegral . hFileSize)
-
getFdStatus :: Fd -> IO FileStatus
getFdStatus _ = unsupported "getFdStatus"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/unix-compat-0.5.2/src/System/PosixCompat/Internal/Time.hs
new/unix-compat-0.5.3/src/System/PosixCompat/Internal/Time.hs
--- old/unix-compat-0.5.2/src/System/PosixCompat/Internal/Time.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/unix-compat-0.5.3/src/System/PosixCompat/Internal/Time.hs
2001-09-09 03:46:40.000000000 +0200
@@ -7,8 +7,6 @@
ClockTime
, getClockTime
, clockTimeToEpochTime
- , ModificationTime
- , modificationTimeToEpochTime
) where
import System.Posix.Types (EpochTime)
@@ -20,15 +18,9 @@
clockTimeToEpochTime :: ClockTime -> EpochTime
clockTimeToEpochTime (TOD s _) = fromInteger s
-type ModificationTime = ClockTime
-
-modificationTimeToEpochTime :: ModificationTime -> EpochTime
-modificationTimeToEpochTime = clockTimeToEpochTime
-
#else
-import Data.Time.Clock (UTCTime)
-import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime, utcTimeToPOSIXSeconds)
+import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime)
type ClockTime = POSIXTime
@@ -38,9 +30,4 @@
clockTimeToEpochTime :: ClockTime -> EpochTime
clockTimeToEpochTime = fromInteger . floor
-type ModificationTime = UTCTime
-
-modificationTimeToEpochTime :: UTCTime -> EpochTime
-modificationTimeToEpochTime = clockTimeToEpochTime . utcTimeToPOSIXSeconds
-
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/unix-compat-0.5.2/src/System/PosixCompat/Types.hs
new/unix-compat-0.5.3/src/System/PosixCompat/Types.hs
--- old/unix-compat-0.5.2/src/System/PosixCompat/Types.hs 2001-09-09
03:46:40.000000000 +0200
+++ new/unix-compat-0.5.3/src/System/PosixCompat/Types.hs 2001-09-09
03:46:40.000000000 +0200
@@ -8,14 +8,11 @@
redefined by this module.
-}
module System.PosixCompat.Types (
+ module System.Posix.Types
#ifdef mingw32_HOST_OS
- module AllPosixTypesButFileID
- , FileID
, UserID
, GroupID
, LinkCount
-#else
- module System.Posix.Types
#endif
) where
@@ -23,15 +20,9 @@
-- Since CIno (FileID's underlying type) reflects <sys/type.h> ino_t,
-- which mingw defines as short int (int16), it must be overriden to
-- match the size of windows fileIndex (word64).
-import System.Posix.Types as AllPosixTypesButFileID hiding (FileID)
+import System.Posix.Types
-import Data.Word (Word32, Word64)
-
-newtype FileID = FileID Word64
- deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)
-instance Show FileID where show (FileID x) = show x
-instance Read FileID where readsPrec i s = [ (FileID x, s')
- | (x,s') <- readsPrec i s]
+import Data.Word (Word32)
newtype UserID = UserID Word32
deriving (Eq, Ord, Enum, Bounded, Integral, Num, Real)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/unix-compat-0.5.2/unix-compat.cabal
new/unix-compat-0.5.3/unix-compat.cabal
--- old/unix-compat-0.5.2/unix-compat.cabal 2001-09-09 03:46:40.000000000
+0200
+++ new/unix-compat-0.5.3/unix-compat.cabal 2001-09-09 03:46:40.000000000
+0200
@@ -1,5 +1,5 @@
name: unix-compat
-version: 0.5.2
+version: 0.5.3
synopsis: Portable POSIX-compatibility layer.
description: This package provides portable implementations of parts
of the unix package. This package re-exports the unix
@@ -13,7 +13,7 @@
maintainer: Jacob Stanley <[email protected]>
category: System
build-type: Simple
-cabal-version: >= 1.6
+cabal-version: >= 1.10
source-repository head
type: git
@@ -24,6 +24,7 @@
default: False
Library
+ default-language: Haskell2010
hs-source-dirs: src
ghc-options: -Wall
build-depends: base == 4.*
@@ -56,7 +57,7 @@
else
build-depends: directory == 1.1.*
else
- build-depends: time >= 1.0 && < 1.9
+ build-depends: time >= 1.0 && < 1.10
build-depends: directory >= 1.2 && < 1.4
other-modules: