Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ghc-unix-time for openSUSE:Factory 
checked in at 2024-06-11 18:28:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-unix-time (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-unix-time.new.19518 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-unix-time"

Tue Jun 11 18:28:08 2024 rev:23 rq:1179753 version:0.4.14

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-unix-time/ghc-unix-time.changes      
2024-02-14 23:19:06.701059624 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-unix-time.new.19518/ghc-unix-time.changes   
2024-06-11 18:28:50.263871057 +0200
@@ -1,0 +2,6 @@
+Thu May 30 01:59:16 UTC 2024 - Peter Simons <psim...@suse.com>
+
+- Update unix-time to version 0.4.14.
+  Upstream does not provide a change log file.
+
+-------------------------------------------------------------------

Old:
----
  unix-time-0.4.12.tar.gz

New:
----
  unix-time-0.4.14.tar.gz

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

Other differences:
------------------
++++++ ghc-unix-time.spec ++++++
--- /var/tmp/diff_new_pack.vjALpZ/_old  2024-06-11 18:28:51.223906093 +0200
+++ /var/tmp/diff_new_pack.vjALpZ/_new  2024-06-11 18:28:51.223906093 +0200
@@ -20,7 +20,7 @@
 %global pkgver %{pkg_name}-%{version}
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        0.4.12
+Version:        0.4.14
 Release:        0
 Summary:        Unix time parser/formatter and utilities
 License:        BSD-3-Clause

++++++ unix-time-0.4.12.tar.gz -> unix-time-0.4.14.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unix-time-0.4.12/Data/UnixTime/Sys.hsc 
new/unix-time-0.4.14/Data/UnixTime/Sys.hsc
--- old/unix-time-0.4.12/Data/UnixTime/Sys.hsc  2001-09-09 03:46:40.000000000 
+0200
+++ new/unix-time-0.4.14/Data/UnixTime/Sys.hsc  2001-09-09 03:46:40.000000000 
+0200
@@ -1,3 +1,4 @@
+{-# LANGUAGE CApiFFI #-}
 {-# LANGUAGE ForeignFunctionInterface #-}
 
 module Data.UnixTime.Sys (getUnixTime) where
@@ -17,7 +18,7 @@
 type CTimeVal = ()
 type CTimeZone = ()
 
-foreign import ccall unsafe "gettimeofday"
+foreign import capi unsafe "sys/time.h gettimeofday"
     c_gettimeofday :: Ptr CTimeVal -> Ptr CTimeZone -> IO CInt
 
 -- |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unix-time-0.4.12/Data/UnixTime/Types.hsc 
new/unix-time-0.4.14/Data/UnixTime/Types.hsc
--- old/unix-time-0.4.12/Data/UnixTime/Types.hsc        2001-09-09 
03:46:40.000000000 +0200
+++ new/unix-time-0.4.14/Data/UnixTime/Types.hsc        2001-09-09 
03:46:40.000000000 +0200
@@ -64,12 +64,29 @@
             (#poke struct timeval, tv_sec)  ptr (fromIntegral sec :: Word32)
             (#poke struct timeval, tv_usec) ptr (utMicroSeconds ut)
 #else
-    peek ptr    = UnixTime
-            <$> (#peek struct timeval, tv_sec)  ptr
-            <*> (#peek struct timeval, tv_usec) ptr
+    -- On Unix, the struct `timeval` is defined as
+    --
+    --      struct timeval
+    --      {
+    --          time_t      tv_sec;
+    --          suseconds_t tv_usec;
+    --      };
+    --
+    -- The type `suseconds_t` is a signed integer type capable of storing
+    -- values at least in the range `[-1, 1000000]`. It's size is platform
+    -- specific, and it is 8 bytes long on 64-bit platforms.
+    --
+    -- Here we peek `tv_usec` using the `CSUSeconds` type and then convert it
+    -- to `Int32` (the type of `utMicroSeconds`) relying on the fact that
+    -- `tv_usec` is no bigger than `1000000`, and hence we will not overflow.
+    peek ptr    = do
+            sec <- (#peek struct timeval, tv_sec) ptr
+            CSUSeconds msec <- (#peek struct timeval, tv_usec) ptr
+            return $ UnixTime sec (fromIntegral msec)
     poke ptr ut = do
+            let msec = CSUSeconds $ fromIntegral (utMicroSeconds ut)
             (#poke struct timeval, tv_sec)  ptr (utSeconds ut)
-            (#poke struct timeval, tv_usec) ptr (utMicroSeconds ut)
+            (#poke struct timeval, tv_usec) ptr msec
 #endif
 
 #if __GLASGOW_HASKELL__ >= 704
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unix-time-0.4.12/cbits/conv.c 
new/unix-time-0.4.14/cbits/conv.c
--- old/unix-time-0.4.12/cbits/conv.c   2001-09-09 03:46:40.000000000 +0200
+++ new/unix-time-0.4.14/cbits/conv.c   2001-09-09 03:46:40.000000000 +0200
@@ -5,6 +5,7 @@
 #define THREAD_SAFE 0
 #define _XOPEN_SOURCE
 #define _DEFAULT_SOURCE
+#define _BSD_SOURCE
 #elif HAVE_STRPTIME_L
 #define THREAD_SAFE 1
 #define _GNU_SOURCE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/unix-time-0.4.12/unix-time.cabal 
new/unix-time-0.4.14/unix-time.cabal
--- old/unix-time-0.4.12/unix-time.cabal        2001-09-09 03:46:40.000000000 
+0200
+++ new/unix-time-0.4.14/unix-time.cabal        2001-09-09 03:46:40.000000000 
+0200
@@ -1,6 +1,6 @@
 cabal-version:      1.18
 name:               unix-time
-version:            0.4.12
+version:            0.4.14
 license:            BSD3
 license-file:       LICENSE
 maintainer:         Kazu Yamamoto <k...@iij.ad.jp>
@@ -43,7 +43,7 @@
     include-dirs:     cbits
     ghc-options:      -Wall
     build-depends:
-        base >=4 && <5,
+        base >=4.4 && <5,
         bytestring,
         old-time,
         binary

Reply via email to