packages feed

cabal-install 1.18.0.2 → 1.18.0.3

raw patch · 4 files changed

+67/−45 lines, 4 filesdep ~array

Dependency ranges changed: array

Files

Distribution/Client/Compat/Time.hs view
@@ -16,26 +16,34 @@  #if defined mingw32_HOST_OS -import Data.Int         (Int32)-import Data.Word        (Word32)-import Foreign          (Ptr, allocaBytes, peekByteOff)-import Foreign.C.Types  (CChar)-import Foreign.C.String (withCString)-import System.IO.Error  (mkIOError, doesNotExistErrorType)+import Data.Bits          ((.|.), bitSize, unsafeShiftL)+import Data.Int           (Int32)+import Data.Word          (Word64)+import Foreign            (allocaBytes, peekByteOff)+import System.IO.Error    (mkIOError, doesNotExistErrorType)+import System.Win32.Types (BOOL, DWORD, LPCTSTR, LPVOID, withTString) -type WIN32_FILE_ATTRIBUTE_DATA = Ptr ()-type LPCSTR = Ptr CChar -foreign import stdcall "Windows.h GetFileAttributesExA"-  c_getFileAttributesEx :: LPCSTR -> Int32-                           -> WIN32_FILE_ATTRIBUTE_DATA -> IO Bool+foreign import stdcall "windows.h GetFileAttributesExW"+  c_getFileAttributesEx :: LPCTSTR -> Int32 -> LPVOID -> IO BOOL +getFileAttributesEx :: String -> LPVOID -> IO BOOL+getFileAttributesEx path lpFileInformation =+  withTString path $ \c_path ->+      c_getFileAttributesEx c_path getFileExInfoStandard lpFileInformation++getFileExInfoStandard :: Int32+getFileExInfoStandard = 0+ size_WIN32_FILE_ATTRIBUTE_DATA :: Int size_WIN32_FILE_ATTRIBUTE_DATA = 36  index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime :: Int index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime = 20 +index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwHighDateTime :: Int+index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwHighDateTime = 24+ #else  #if MIN_VERSION_base(4,5,0)@@ -60,21 +68,32 @@ #if defined mingw32_HOST_OS  -- Directly against the Win32 API.-getModTime path = withCString path $ \file ->-  allocaBytes size_WIN32_FILE_ATTRIBUTE_DATA $ \info -> do-    res <- c_getFileAttributesEx file 0 info-    if not res-      then do-        let err = mkIOError doesNotExistErrorType-                  "Distribution.Client.Compat.Time.getModTime"-                  Nothing (Just path)-        ioError err-      else do-        dword <- peekByteOff info-                 index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime-        -- TODO: Convert Windows seconds to POSIX seconds. ATM we don't care-        -- since we only use the value for comparisons.-        return $! fromIntegral (dword :: Word32)+getModTime path = allocaBytes size_WIN32_FILE_ATTRIBUTE_DATA $ \info -> do+  res <- getFileAttributesEx path info+  if not res+    then do+      let err = mkIOError doesNotExistErrorType+                "Distribution.Client.Compat.Time.getModTime"+                Nothing (Just path)+      ioError err+    else do+      dwLow  <- peekByteOff info+                index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwLowDateTime+      dwHigh <- peekByteOff info+                index_WIN32_FILE_ATTRIBUTE_DATA_ftLastWriteTime_dwHighDateTime+      return $! windowsTimeToPOSIXSeconds dwLow dwHigh+        where+          windowsTimeToPOSIXSeconds :: DWORD -> DWORD -> EpochTime+          windowsTimeToPOSIXSeconds dwLow dwHigh =+            let wINDOWS_TICK      = 10000000+                sEC_TO_UNIX_EPOCH = 11644473600+                qwTime = (fromIntegral dwHigh `unsafeShiftL` bitSize dwHigh)+                         .|. (fromIntegral dwLow)+                res    = ((qwTime :: Word64) `div` wINDOWS_TICK)+                         - sEC_TO_UNIX_EPOCH+            -- TODO: What if the result is not representable as POSIX seconds?+            -- Probably fine to return garbage.+            in fromIntegral res #else  -- Directly against the unix library.
Distribution/Client/Haddock.hs view
@@ -57,7 +57,7 @@                     , "--gen-index"                     , "--odir=" ++ tempDir                     , "--title=Haskell modules on this system" ]-                 ++ [ "--read-interface=" ++ mkUrl html ++ "," ++ interface+                 ++ [ "--read-interface=" ++ html ++ "," ++ interface                     | (interface, html) <- paths ]         rawSystemProgram verbosity confHaddock flags         renameFile (tempDir </> "index.html") (tempDir </> destFile)@@ -69,11 +69,6 @@             | (_pname, pkgvers) <- allPackagesByName pkgs             , let pkgvers' = filter exposed pkgvers             , not (null pkgvers') ]-    -- See https://github.com/haskell/cabal/issues/1064-    mkUrl f =-      if isAbsolute f-        then "file://" ++ f-        else f  haddockPackagePaths :: [InstalledPackageInfo]                        -> IO ([(FilePath, FilePath)], Maybe String)@@ -101,6 +96,14 @@   where     interfaceAndHtmlPath pkg = do       interface <- listToMaybe (InstalledPackageInfo.haddockInterfaces pkg)-      html <- listToMaybe (InstalledPackageInfo.haddockHTMLs pkg)+      html <- fmap fixFileUrl+                   (listToMaybe (InstalledPackageInfo.haddockHTMLs pkg))       guard (not . null $ html)       return (interface, html)+    +    -- the 'haddock-html' field in the hc-pkg output is often set as a+    -- native path, but we need it as a URL.+    -- See https://github.com/haskell/cabal/issues/1064+    fixFileUrl f | isAbsolute f = "file://" ++ f+                 | otherwise    = f+
bootstrap.sh view
@@ -49,14 +49,14 @@  # Versions of the packages to install. # The version regex says what existing installed versions are ok.-PARSEC_VER="3.1.3";    PARSEC_VER_REGEXP="[23]\."              # == 2.* || == 3.*-DEEPSEQ_VER="1.3.0.1"; DEEPSEQ_VER_REGEXP="1\.[1-9]\."         # >= 1.1 && < 2-TEXT_VER="0.11.3.1";   TEXT_VER_REGEXP="0\.([2-9]|(1[0-1]))\." # >= 0.2 && < 0.12-NETWORK_VER="2.4.1.2"; NETWORK_VER_REGEXP="2\."                # == 2.*-CABAL_VER="1.18.1";    CABAL_VER_REGEXP="1\.1[89]\."           # >= 1.18 && < 1.20+PARSEC_VER="3.1.5";    PARSEC_VER_REGEXP="[23]\."              # == 2.* || == 3.*+DEEPSEQ_VER="1.3.0.2"; DEEPSEQ_VER_REGEXP="1\.[1-9]\."         # >= 1.1 && < 2+TEXT_VER="1.1.0.0";    TEXT_VER_REGEXP="((1\.[01]\.)|(0\.([2-9]|(1[0-1]))\.))" # >= 0.2 && < 1.2+NETWORK_VER="2.4.2.2"; NETWORK_VER_REGEXP="2\."                # == 2.*+CABAL_VER="1.18.1.3";  CABAL_VER_REGEXP="1\.1[89]\."           # >= 1.18 && < 1.20 TRANS_VER="0.3.0.0";   TRANS_VER_REGEXP="0\.[23]\."            # >= 0.2.* && < 0.4.* MTL_VER="2.1.2";       MTL_VER_REGEXP="[2]\."                  #  == 2.*-HTTP_VER="4000.2.8";   HTTP_VER_REGEXP="4000\.[012]\."         # == 4000.0.* || 4000.1.* || 4000.2.*+HTTP_VER="4000.2.11";  HTTP_VER_REGEXP="4000\.[012]\."         # == 4000.0.* || 4000.1.* || 4000.2.* ZLIB_VER="0.5.4.1";    ZLIB_VER_REGEXP="0\.[45]\."             # == 0.4.* || == 0.5.* TIME_VER="1.4.1"       TIME_VER_REGEXP="1\.[1234]\.?"          # >= 1.1 && < 1.5 RANDOM_VER="1.0.1.1"   RANDOM_VER_REGEXP="1\.0\."              # >= 1 && < 1.1@@ -190,27 +190,27 @@  # Actually do something! +info_pkg "deepseq"      ${DEEPSEQ_VER} ${DEEPSEQ_VER_REGEXP}+info_pkg "time"         ${TIME_VER}    ${TIME_VER_REGEXP} info_pkg "Cabal"        ${CABAL_VER}   ${CABAL_VER_REGEXP} info_pkg "transformers" ${TRANS_VER}   ${TRANS_VER_REGEXP} info_pkg "mtl"          ${MTL_VER}     ${MTL_VER_REGEXP}-info_pkg "deepseq"      ${DEEPSEQ_VER} ${DEEPSEQ_VER_REGEXP} info_pkg "text"         ${TEXT_VER}    ${TEXT_VER_REGEXP} info_pkg "parsec"       ${PARSEC_VER}  ${PARSEC_VER_REGEXP} info_pkg "network"      ${NETWORK_VER} ${NETWORK_VER_REGEXP}-info_pkg "time"         ${TIME_VER}    ${TIME_VER_REGEXP} info_pkg "HTTP"         ${HTTP_VER}    ${HTTP_VER_REGEXP} info_pkg "zlib"         ${ZLIB_VER}    ${ZLIB_VER_REGEXP} info_pkg "random"       ${RANDOM_VER}  ${RANDOM_VER_REGEXP} info_pkg "stm"          ${STM_VER}     ${STM_VER_REGEXP} +do_pkg   "deepseq"      ${DEEPSEQ_VER} ${DEEPSEQ_VER_REGEXP}+do_pkg   "time"         ${TIME_VER}    ${TIME_VER_REGEXP} do_pkg   "Cabal"        ${CABAL_VER}   ${CABAL_VER_REGEXP} do_pkg   "transformers" ${TRANS_VER}   ${TRANS_VER_REGEXP} do_pkg   "mtl"          ${MTL_VER}     ${MTL_VER_REGEXP}-do_pkg   "deepseq"      ${DEEPSEQ_VER} ${DEEPSEQ_VER_REGEXP} do_pkg   "text"         ${TEXT_VER}    ${TEXT_VER_REGEXP} do_pkg   "parsec"       ${PARSEC_VER}  ${PARSEC_VER_REGEXP} do_pkg   "network"      ${NETWORK_VER} ${NETWORK_VER_REGEXP}-do_pkg   "time"         ${TIME_VER}    ${TIME_VER_REGEXP} do_pkg   "HTTP"         ${HTTP_VER}    ${HTTP_VER_REGEXP} do_pkg   "zlib"         ${ZLIB_VER}    ${ZLIB_VER_REGEXP} do_pkg   "random"       ${RANDOM_VER}  ${RANDOM_VER_REGEXP}
cabal-install.cabal view
@@ -1,5 +1,5 @@ Name:               cabal-install-Version:            1.18.0.2+Version:            1.18.0.3 Synopsis:           The command-line interface for Cabal and Hackage. Description:     The \'cabal\' command-line program simplifies the process of managing@@ -114,7 +114,7 @@     -- NOTE: when updating build-depends, don't forget to update version regexps     -- in bootstrap.sh.     build-depends:-        array      >= 0.1      && < 0.5,+        array      >= 0.1      && < 0.6,         base       >= 4        && < 5,         bytestring >= 0.9      && < 1,         Cabal      >= 1.18.0   && < 1.19,