packages feed

cabal-install 1.18.0 → 1.18.0.1

raw patch · 8 files changed

+87/−33 lines, 8 files

Files

Distribution/Client/Config.hs view
@@ -367,7 +367,7 @@       toSavedConfig liftGlobalFlag        (commandOptions globalCommand ParseArgs)-       ["version", "numeric-version", "config-file"] []+       ["version", "numeric-version", "config-file", "sandbox-config-file"] []    ++ toSavedConfig liftConfigFlag        (configureOptions ParseArgs)
Distribution/Client/Sandbox.hs view
@@ -275,14 +275,14 @@ -- | Entry point for the 'cabal sandbox-init' command. sandboxInit :: Verbosity -> SandboxFlags  -> GlobalFlags -> IO () sandboxInit verbosity sandboxFlags globalFlags = do-  -- Check that there is no 'cabal-dev' directory.+  -- Warn if there's a 'cabal-dev' sandbox.   isCabalDevSandbox <- liftM2 (&&) (doesDirectoryExist "cabal-dev")                        (doesFileExist $ "cabal-dev" </> "cabal.config")   when isCabalDevSandbox $-    die $+    warn verbosity $     "You are apparently using a legacy (cabal-dev) sandbox. "-    ++ "To use native cabal sandboxing, please delete the 'cabal-dev' directory "-    ++  "and run 'cabal sandbox init'."+    ++ "Legacy sandboxes may interact badly with native Cabal sandboxes. "+    ++ "You may want to delete the 'cabal-dev' directory to prevent issues."    -- Create the sandbox directory.   let sandboxDir' = fromFlagOrDefault defaultSandboxLocation
Distribution/Client/Sandbox/PackageEnvironment.hs view
@@ -322,12 +322,25 @@   -- Layer the package environment settings over settings from ~/.cabal/config.   cabalConfig <- loadConfig verbosity configFileFlag NoFlag   return (sandboxDir,+          updateInstallDirs $           (base `mappend` (toPkgEnv cabalConfig) `mappend`            common `mappend` inherited `mappend` user)           `overrideSandboxSettings` pkgEnv)     where       toPkgEnv config = mempty { pkgEnvSavedConfig = config } +      updateInstallDirs pkgEnv =+        let config         = pkgEnvSavedConfig pkgEnv+            configureFlags = savedConfigureFlags config+            installDirs    = savedUserInstallDirs config+        in pkgEnv {+          pkgEnvSavedConfig = config {+             savedConfigureFlags = configureFlags {+                configInstallDirs = installDirs+                }+             }+          }+ -- | Should the generated package environment file include comments? data IncludeComments = IncludeComments | NoComments @@ -340,7 +353,8 @@                                 -> IO () createPackageEnvironmentFile verbosity sandboxDir pkgEnvFile incComments   compiler platform = do-  notice verbosity $ "Writing default package environment to " ++ pkgEnvFile+  notice verbosity $ "Writing a default package environment file to "+    ++ pkgEnvFile    commentPkgEnv <- commentPackageEnvironment sandboxDir   initialPkgEnv <- initialPackageEnvironment sandboxDir compiler platform@@ -437,9 +451,9 @@                          return accum'       | otherwise   =         syntaxError line $-        "This file was probably generated by cabal-dev. "-        ++ "To use native cabal sandboxing, please delete '"-        ++ userPackageEnvironmentFile ++ "' and run 'cabal sandbox init'."+        "Named 'install-dirs' section: '" ++ name+        ++ "'. Note that named 'install-dirs' sections are not allowed in the '"+        ++ userPackageEnvironmentFile ++ "' file."       where name' = lowercase name     parseSection _accum f =       syntaxError (lineNo f)  "Unrecognized stanza."
Distribution/Client/Sandbox/Timestamp.hs view
@@ -224,8 +224,8 @@         sDistListSources = Flag file         }       setupOpts = defaultSetupScriptOptions {-        -- 'sdist --list-sources' was introduced in Cabal 1.17.-        useCabalVersion = orLaterVersion $ Version [1,17,0] []+        -- 'sdist --list-sources' was introduced in Cabal 1.18.+        useCabalVersion = orLaterVersion $ Version [1,18,0] []         }        doListSources :: IO [FilePath]
Distribution/Client/SetupWrapper.hs view
@@ -87,7 +87,7 @@ import System.Exit       ( ExitCode(..), exitWith ) import System.Process    ( runProcess, waitForProcess ) import Control.Monad     ( when, unless )-import Data.List         ( maximumBy )+import Data.List         ( foldl1' ) import Data.Maybe        ( fromMaybe, isJust ) import Data.Monoid       ( mempty ) import Data.Char         ( isSpace )@@ -270,8 +270,24 @@       pkgs -> return $ bestVersion id (map fst pkgs)    bestVersion :: (a -> Version) -> [a] -> a-  bestVersion f = maximumBy (comparing (preference . f))+  bestVersion f = firstMaximumBy (comparing (preference . f))     where+      -- Like maximumBy, but picks the first maximum element instead of the+      -- last. In general, we expect the preferred version to go first in the+      -- list. For the default case, this has the effect of choosing the version+      -- installed in the user package DB instead of the global one. See #1463.+      --+      -- Note: firstMaximumBy could be written as just+      -- `maximumBy cmp . reverse`, but the problem is that the behaviour of+      -- maximumBy is not fully specified in the case when there is not a single+      -- greatest element.+      firstMaximumBy :: (a -> a -> Ordering) -> [a] -> a+      firstMaximumBy _ []   =+        error "Distribution.Client.firstMaximumBy: empty list"+      firstMaximumBy cmp xs =  foldl1' maxBy xs+        where+          maxBy x y = case cmp x y of { GT -> x; EQ -> x; LT -> y; }+       preference version   = (sameVersion, sameMajorVersion                              ,stableVersion, latestVersion)         where
Main.hs view
@@ -88,7 +88,8 @@                                               ,configCompilerAux'                                               ,configPackageDB') import Distribution.Client.Sandbox.PackageEnvironment-                                              (setPackageDB)+                                              (setPackageDB+                                              ,userPackageEnvironmentFile) import Distribution.Client.Sandbox.Timestamp  (maybeAddCompilerTimestampRecord) import Distribution.Client.Sandbox.Types      (UseSandbox(..), whenUsingSandbox) import Distribution.Client.Init               (initCabal)@@ -111,7 +112,9 @@ import Distribution.Text          ( display ) import Distribution.Verbosity as Verbosity-       ( Verbosity, normal )+         ( Verbosity, normal )+import Distribution.Version+         ( Version(..), orLaterVersion ) import qualified Paths_cabal_install (version)  import System.Environment       (getArgs, getProgName)@@ -309,7 +312,10 @@    maybeWithSandboxDirOnSearchPath useSandbox $     let progConf     = defaultProgramConfiguration-        setupOptions = defaultSetupScriptOptions { useDistPref = distPref }+        setupOptions = defaultSetupScriptOptions+          { useCabalVersion = orLaterVersion $ Version [1,18,0] []+          , useDistPref     = distPref+          }         replFlags'   = replFlags           { replVerbosity = toFlag verbosity           , replDistPref  = toFlag distPref@@ -419,7 +425,11 @@       -- Was the sandbox created after the package was already configured? We       -- may need to skip reinstallation of add-source deps and force       -- reconfigure.-      isSandboxConfigNewer <- checkSandboxConfigNewer+      let buildConfig       = localBuildInfoFile distPref+      sandboxConfig        <- getSandboxConfigFilePath globalFlags+      isSandboxConfigNewer <-+        sandboxConfig `existsAndIsMoreRecentThan` buildConfig+       let skipAddSourceDepsCheck'             | isSandboxConfigNewer = SkipAddSourceDepsCheck             | otherwise            = skipAddSourceDepsCheck@@ -433,8 +443,17 @@                              globalFlags mempty           return (useSandbox, NoDepsReinstalled) +      -- Is the @cabal.config@ file newer than @dist/setup.config@? Then we need+      -- to force reconfigure. Note that it's possible to use @cabal.config@+      -- even without sandboxes.+      isUserPackageEnvironmentFileNewer <-+        userPackageEnvironmentFile `existsAndIsMoreRecentThan` buildConfig++      -- Determine whether we need to reconfigure and which message to show to+      -- the user if that is the case.       mMsg <- determineMessageToShow lbi configFlags depsReinstalled                                      isSandboxConfigNewer+                                     isUserPackageEnvironmentFileNewer       case mMsg of          -- No message for the user indicates that reconfiguration@@ -448,28 +467,28 @@             extraArgs globalFlags           return useSandbox -    -- Is @cabal.sandbox.config@ newer than @dist/setup-config@? Then we need to-    -- force-reconfigure without reinstalling add-source deps (the sandbox was-    -- created after the package was already configured).-    checkSandboxConfigNewer :: IO Bool-    checkSandboxConfigNewer = do-      sandboxConfig  <- getSandboxConfigFilePath globalFlags-      let buildConfig = localBuildInfoFile distPref-      sandboxConfigExists <- doesFileExist sandboxConfig-      if sandboxConfigExists-        then sandboxConfig `moreRecentFile` buildConfig-        else return False+    -- True if the first file exists and is more recent than the second file.+    existsAndIsMoreRecentThan :: FilePath -> FilePath -> IO Bool+    existsAndIsMoreRecentThan a b = do+      exists <- doesFileExist a+      if not exists+        then return False+        else a `moreRecentFile` b      -- Determine what message, if any, to display to the user if reconfiguration     -- is required.     determineMessageToShow :: LBI.LocalBuildInfo -> ConfigFlags-                            -> WereDepsReinstalled -> Bool+                            -> WereDepsReinstalled -> Bool -> Bool                             -> IO (Maybe String)-    determineMessageToShow _   _           _               True =+    determineMessageToShow _   _           _               True  _     =       -- The sandbox was created after the package was already configured.       return $! Just $! sandboxConfigNewerMessage -    determineMessageToShow lbi configFlags depsReinstalled False = do+    determineMessageToShow _   _           _               False True  =+      -- The user package environment file was modified.+      return $! Just $! userPackageEnvironmentFileModifiedMessage++    determineMessageToShow lbi configFlags depsReinstalled False False = do       let savedDistPref = fromFlagOrDefault                           (useDistPref defaultSetupScriptOptions)                           (configDistPref configFlags)@@ -507,6 +526,11 @@     configureManually       = " If this fails, please run configure manually."     sandboxConfigNewerMessage =         "The sandbox was created after the package was already configured."+        ++ reconfiguringMostRecent+        ++ configureManually+    userPackageEnvironmentFileModifiedMessage =+        "The user package environment file ('"+        ++ userPackageEnvironmentFile ++ "') was modified."         ++ reconfiguringMostRecent         ++ configureManually     distPrefMessage =
bootstrap.sh view
@@ -53,7 +53,7 @@ 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.0.0";  CABAL_VER_REGEXP="1\.1[89]\."           # >= 1.18 && < 1.20+CABAL_VER="1.18.0";    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.*
cabal-install.cabal view
@@ -1,5 +1,5 @@ Name:               cabal-install-Version:            1.18.0+Version:            1.18.0.1 Synopsis:           The command-line interface for Cabal and Hackage. Description:     The \'cabal\' command-line program simplifies the process of managing