Hello community, here is the log from the commit of package ghc-iproute for openSUSE:Factory checked in at 2016-11-05 21:27:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-iproute (Old) and /work/SRC/openSUSE:Factory/.ghc-iproute.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-iproute" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-iproute/ghc-iproute.changes 2016-07-21 08:11:04.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-iproute.new/ghc-iproute.changes 2016-11-05 21:27:34.000000000 +0100 @@ -1,0 +2,5 @@ +Mon Oct 17 15:37:35 UTC 2016 - [email protected] + +- Update to version 1.7.1 with cabal2obs. + +------------------------------------------------------------------- Old: ---- iproute-1.7.0.tar.gz New: ---- iproute-1.7.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-iproute.spec ++++++ --- /var/tmp/diff_new_pack.KdoVDq/_old 2016-11-05 21:27:35.000000000 +0100 +++ /var/tmp/diff_new_pack.KdoVDq/_new 2016-11-05 21:27:35.000000000 +0100 @@ -19,15 +19,14 @@ %global pkg_name iproute %bcond_with tests Name: ghc-%{pkg_name} -Version: 1.7.0 +Version: 1.7.1 Release: 0 Summary: IP Routing Table License: BSD-3-Clause -Group: System/Libraries +Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz BuildRequires: ghc-Cabal-devel -# Begin cabal-rpm deps: BuildRequires: ghc-appar-devel BuildRequires: ghc-byteorder-devel BuildRequires: ghc-containers-devel @@ -40,7 +39,6 @@ BuildRequires: ghc-hspec-devel BuildRequires: ghc-safe-devel %endif -# End cabal-rpm deps %description IP Routing Table is a tree of IP ranges to search one of them on the longest @@ -61,20 +59,14 @@ %prep %setup -q -n %{pkg_name}-%{version} - %build %ghc_lib_build - %install %ghc_lib_install - %check -%if %{with tests} -%{cabal} test -%endif - +%cabal_test %post devel %ghc_pkg_recache ++++++ iproute-1.7.0.tar.gz -> iproute-1.7.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute-1.7.0/Data/IP/Addr.hs new/iproute-1.7.1/Data/IP/Addr.hs --- old/iproute-1.7.0/Data/IP/Addr.hs 2015-09-14 09:15:28.000000000 +0200 +++ new/iproute-1.7.1/Data/IP/Addr.hs 2016-10-14 05:31:38.000000000 +0200 @@ -125,10 +125,11 @@ c' = fromEnum c `shift` 32 d' = fromEnum d in a' .|. b' .|. c' .|. d' - toEnum i = let a = toEnum (i `shiftR` 96 .&. 0xffffffff) - b = toEnum (i `shiftR` 64 .&. 0xffffffff) - c = toEnum (i `shiftR` 32 .&. 0xffffffff) - d = toEnum (i .&. 0xffffffff) + toEnum i = let i' = fromIntegral i :: Integer + a = fromIntegral (i' `shiftR` 96 .&. 0xffffffff) + b = fromIntegral (i' `shiftR` 64 .&. 0xffffffff) + c = fromIntegral (i' `shiftR` 32 .&. 0xffffffff) + d = fromIntegral (i' .&. 0xffffffff) in IP6 (a,b,c,d) succ (IP6 (0xffffffff,0xffffffff,0xffffffff,0xffffffff)) = succError "IPv6" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute-1.7.0/Data/IP/Mask.hs new/iproute-1.7.1/Data/IP/Mask.hs --- old/iproute-1.7.0/Data/IP/Mask.hs 2015-09-14 09:15:28.000000000 +0200 +++ new/iproute-1.7.1/Data/IP/Mask.hs 2016-10-14 05:31:38.000000000 +0200 @@ -3,31 +3,43 @@ import Data.Bits import Data.IP.Addr import Data.Word -import Data.IntMap hiding (map) - ----------------------------------------------------------------- maskIPv4 :: Int -> IPv4 -maskIPv4 len = IP4 (masksIPv4 ! len) +maskIPv4 len = + IP4 $ complement $ 0xffffffff `shift` (-len) maskIPv6 :: Int -> IPv6 -maskIPv6 len = IP6 (masksIPv6 ! len) - -masksWord32 :: [Word32] -masksWord32 = take 33 $ iterate (`shift` 1) 0xffffffff - -masksIPv4 :: IntMap IPv4Addr -masksIPv4 = fromList $ zip [32,31..0] masksWord32 - -masksIPv6 :: IntMap IPv6Addr -masksIPv6 = fromList $ zip [128,127..0] ms - where - ms = m0 ++ m1 ++ m2 ++ m3 ++ m4 - m0 = [(all1,all1,all1,all1)] - m1 = map (\vmsk -> (all1,all1,all1,vmsk)) masks - m2 = map (\vmsk -> (all1,all1,vmsk,all0)) masks - m3 = map (\vmsk -> (all1,vmsk,all0,all0)) masks - m4 = map (\vmsk -> (vmsk,all0,all0,all0)) masks - masks = tail masksWord32 - all1 = 0xffffffff - all0 = 0x00000000 +maskIPv6 len = + IP6 $ toIP6Addr $ bimapTup complement $ + (0xffffffffffffffff, 0xffffffffffffffff) `shift128` (-len) + where + bimapTup f (x,y) = (f x, f y) + +shift128 :: (Word64, Word64) -> Int -> (Word64, Word64) +shift128 x i + | i < 0 = x `shiftR128` (-i) + | i > 0 = x `shiftL128` i + | otherwise = x + +shiftL128 :: (Word64, Word64) -> Int -> (Word64, Word64) +shiftL128 (h, l) i = + ( (h `shiftL` i) .|. (l `shift` (i - 64) ), (l `shiftL` i)) + +shiftR128 :: (Word64, Word64) -> Int -> (Word64, Word64) +shiftR128 (h, l) i = + (h `shiftR` i, (l `shiftR` i) .|. h `shift` (64 - i) ) + +fromIP6Addr :: IPv6Addr -> (Word64, Word64) +fromIP6Addr (w3, w2, w1, w0) = + ( (fromIntegral w3 `shiftL` 32) .|. fromIntegral w2 + , (fromIntegral w1 `shiftL` 32) .|. fromIntegral w0 + ) + +toIP6Addr :: (Word64, Word64) -> IPv6Addr +toIP6Addr (h, l) = + ( fromIntegral $ (h `shiftR` 32) .&. m + , fromIntegral $ h .&. m + , fromIntegral $ (l `shiftR` 32) .&. m + , fromIntegral $ l .&. m + ) + where m = 0xffffffff diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute-1.7.0/Data/IP/Op.hs new/iproute-1.7.1/Data/IP/Op.hs --- old/iproute-1.7.0/Data/IP/Op.hs 2015-09-14 09:15:28.000000000 +0200 +++ new/iproute-1.7.1/Data/IP/Op.hs 2016-10-14 05:31:38.000000000 +0200 @@ -19,8 +19,23 @@ -} masked :: a -> a -> a {-| - The 'intToMask' function takes 'Int' and returns a contiguous - mask. + + The 'intToMask' function takes an 'Int' representing the number of bits to + be set in the returned contiguous mask. When this integer is positive the + bits will be starting from the MSB and from the LSB otherwise. + + >>> intToMask 16 :: IPv4 + 255.255.0.0 + + >>> intToMask (-16) :: IPv4 + 0.0.255.255 + + >>> intToMask 16 :: IPv6 + ffff:: + + >>> intToMask (-16) :: IPv6 + ::ffff + -} intToMask :: Int -> a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute-1.7.0/iproute.cabal new/iproute-1.7.1/iproute.cabal --- old/iproute-1.7.0/iproute.cabal 2015-09-14 09:15:28.000000000 +0200 +++ new/iproute-1.7.1/iproute.cabal 2016-10-14 05:31:38.000000000 +0200 @@ -1,5 +1,5 @@ Name: iproute -Version: 1.7.0 +Version: 1.7.1 Author: Kazu Yamamoto <[email protected]> Maintainer: Kazu Yamamoto <[email protected]> License: BSD3
