|
From: Daniel W. <dm...@lu...> - 2013-09-26 20:46:15
|
diffing dir...
Thu Sep 26 21:06:26 BST 2013 Daniel Wagner <da...@wa...>
* Cabal-1.18 compatibility, with ideas from Ben Gamari and Oliver Batchelor
Ignore-this: 9a58c0efcaa89cbc8c1ab57a4b9dd73b
hunk ./cairo/Gtk2HsSetup.hs 69
+import Distribution.Simple.Program.Find ( defaultProgramSearchPath )
+onDefaultSearchPath f a b = f a b defaultProgramSearchPath
hunk ./cairo/Gtk2HsSetup.hs 75
+onDefaultSearchPath = id
hunk ./cairo/Gtk2HsSetup.hs 447
- location <- programFindLocation prog normal
+ location <- onDefaultSearchPath programFindLocation prog normal
hunk ./cairo/SetupWrapper.hs 33
--- The former instance is for Cabal < 1.17; the latter for Cabal >= 1.17. We
--- can't use CPP to check which version of Cabal we're up against here because
--- this is the file that's generating those macros.
-class CompConf a where compConf :: a -> (Compiler, ProgramConfiguration)
-instance CompConf (Compiler, ProgramConfiguration) where compConf = id
-instance CompConf (Compiler, a, ProgramConfiguration) where compConf (c, a, p) = (c, p)
+-- moreRecentFile is implemented in Distribution.Simple.Utils, but only in
+-- Cabal >= 1.18. For backwards-compatibility, we implement a copy with a new
+-- name here. Some desirable alternate strategies don't work:
+-- * We can't use CPP to check which version of Cabal we're up against because
+-- this is the file that's generating the macros for doing that.
+-- * We can't use the name moreRecentFiles and use
+-- import D.S.U hiding (moreRecentFiles)
+-- because on old GHC's (and according to the Report) hiding a name that
+-- doesn't exist is an error.
+moreRecentFile' :: FilePath -> FilePath -> IO Bool
+moreRecentFile' a b = do
+ exists <- doesFileExist b
+ if not exists
+ then return True
+ else do tb <- getModificationTime b
+ ta <- getModificationTime a
+ return (ta > tb)
hunk ./cairo/SetupWrapper.hs 113
- setupHsNewer <- setupHsFile `moreRecentFile` setupProgFile
- cabalVersionNewer <- setupVersionFile `moreRecentFile` setupProgFile
+ setupHsNewer <- setupHsFile `moreRecentFile'` setupProgFile
+ cabalVersionNewer <- setupVersionFile `moreRecentFile'` setupProgFile
hunk ./cairo/SetupWrapper.hs 119
- (comp, conf) <- compConf `fmap` configCompiler (Just GHC) Nothing Nothing
+ (comp, conf) <- configCompiler (Just GHC) Nothing Nothing
hunk ./cairo/SetupWrapper.hs 166
-
-moreRecentFile :: FilePath -> FilePath -> IO Bool
-moreRecentFile a b = do
- exists <- doesFileExist b
- if not exists
- then return True
- else do tb <- getModificationTime b
- ta <- getModificationTime a
- return (ta > tb)
hunk ./gio/Gtk2HsSetup.hs 68
+import Distribution.Simple.Program.Find ( defaultProgramSearchPath )
+onDefaultSearchPath f a b = f a b defaultProgramSearchPath
hunk ./gio/Gtk2HsSetup.hs 74
+onDefaultSearchPath = id
hunk ./gio/Gtk2HsSetup.hs 439
- location <- programFindLocation prog normal
+ location <- onDefaultSearchPath programFindLocation prog normal
hunk ./gio/SetupWrapper.hs 33
--- The former instance is for Cabal < 1.17; the latter for Cabal >= 1.17. We
--- can't use CPP to check which version of Cabal we're up against here because
--- this is the file that's generating those macros.
-class CompConf a where compConf :: a -> (Compiler, ProgramConfiguration)
-instance CompConf (Compiler, ProgramConfiguration) where compConf = id
-instance CompConf (Compiler, a, ProgramConfiguration) where compConf (c, a, p) = (c, p)
+-- moreRecentFile is implemented in Distribution.Simple.Utils, but only in
+-- Cabal >= 1.18. For backwards-compatibility, we implement a copy with a new
+-- name here. Some desirable alternate strategies don't work:
+-- * We can't use CPP to check which version of Cabal we're up against because
+-- this is the file that's generating the macros for doing that.
+-- * We can't use the name moreRecentFiles and use
+-- import D.S.U hiding (moreRecentFiles)
+-- because on old GHC's (and according to the Report) hiding a name that
+-- doesn't exist is an error.
+moreRecentFile' :: FilePath -> FilePath -> IO Bool
+moreRecentFile' a b = do
+ exists <- doesFileExist b
+ if not exists
+ then return True
+ else do tb <- getModificationTime b
+ ta <- getModificationTime a
+ return (ta > tb)
hunk ./gio/SetupWrapper.hs 113
- setupHsNewer <- setupHsFile `moreRecentFile` setupProgFile
- cabalVersionNewer <- setupVersionFile `moreRecentFile` setupProgFile
+ setupHsNewer <- setupHsFile `moreRecentFile'` setupProgFile
+ cabalVersionNewer <- setupVersionFile `moreRecentFile'` setupProgFile
hunk ./gio/SetupWrapper.hs 119
- (comp, conf) <- compConf `fmap` configCompiler (Just GHC) Nothing Nothing
+ (comp, conf) <- configCompiler (Just GHC) Nothing Nothing
hunk ./gio/SetupWrapper.hs 166
-
-moreRecentFile :: FilePath -> FilePath -> IO Bool
-moreRecentFile a b = do
- exists <- doesFileExist b
- if not exists
- then return True
- else do tb <- getModificationTime b
- ta <- getModificationTime a
- return (ta > tb)
hunk ./glib/Gtk2HsSetup.hs 68
+import Distribution.Simple.Program.Find ( defaultProgramSearchPath )
+onDefaultSearchPath f a b = f a b defaultProgramSearchPath
hunk ./glib/Gtk2HsSetup.hs 74
+onDefaultSearchPath = id
hunk ./glib/Gtk2HsSetup.hs 439
- location <- programFindLocation prog normal
+ location <- onDefaultSearchPath programFindLocation prog normal
hunk ./glib/SetupWrapper.hs 33
--- The former instance is for Cabal < 1.17; the latter for Cabal >= 1.17. We
--- can't use CPP to check which version of Cabal we're up against here because
--- this is the file that's generating those macros.
-class CompConf a where compConf :: a -> (Compiler, ProgramConfiguration)
-instance CompConf (Compiler, ProgramConfiguration) where compConf = id
-instance CompConf (Compiler, a, ProgramConfiguration) where compConf (c, a, p) = (c, p)
+-- moreRecentFile is implemented in Distribution.Simple.Utils, but only in
+-- Cabal >= 1.18. For backwards-compatibility, we implement a copy with a new
+-- name here. Some desirable alternate strategies don't work:
+-- * We can't use CPP to check which version of Cabal we're up against because
+-- this is the file that's generating the macros for doing that.
+-- * We can't use the name moreRecentFiles and use
+-- import D.S.U hiding (moreRecentFiles)
+-- because on old GHC's (and according to the Report) hiding a name that
+-- doesn't exist is an error.
+moreRecentFile' :: FilePath -> FilePath -> IO Bool
+moreRecentFile' a b = do
+ exists <- doesFileExist b
+ if not exists
+ then return True
+ else do tb <- getModificationTime b
+ ta <- getModificationTime a
+ return (ta > tb)
hunk ./glib/SetupWrapper.hs 113
- setupHsNewer <- setupHsFile `moreRecentFile` setupProgFile
- cabalVersionNewer <- setupVersionFile `moreRecentFile` setupProgFile
+ setupHsNewer <- setupHsFile `moreRecentFile'` setupProgFile
+ cabalVersionNewer <- setupVersionFile `moreRecentFile'` setupProgFile
hunk ./glib/SetupWrapper.hs 119
- (comp, conf) <- compConf `fmap` configCompiler (Just GHC) Nothing Nothing
+ (comp, conf) <- configCompiler (Just GHC) Nothing Nothing
hunk ./glib/SetupWrapper.hs 166
-
-moreRecentFile :: FilePath -> FilePath -> IO Bool
-moreRecentFile a b = do
- exists <- doesFileExist b
- if not exists
- then return True
- else do tb <- getModificationTime b
- ta <- getModificationTime a
- return (ta > tb)
hunk ./gtk/Gtk2HsSetup.hs 68
+import Distribution.Simple.Program.Find ( defaultProgramSearchPath )
+onDefaultSearchPath f a b = f a b defaultProgramSearchPath
hunk ./gtk/Gtk2HsSetup.hs 74
+onDefaultSearchPath = id
hunk ./gtk/Gtk2HsSetup.hs 439
- location <- programFindLocation prog normal
+ location <- onDefaultSearchPath programFindLocation prog normal
hunk ./gtk/SetupWrapper.hs 33
--- The former instance is for Cabal < 1.17; the latter for Cabal >= 1.17. We
--- can't use CPP to check which version of Cabal we're up against here because
--- this is the file that's generating those macros.
-class CompConf a where compConf :: a -> (Compiler, ProgramConfiguration)
-instance CompConf (Compiler, ProgramConfiguration) where compConf = id
-instance CompConf (Compiler, a, ProgramConfiguration) where compConf (c, a, p) = (c, p)
+-- moreRecentFile is implemented in Distribution.Simple.Utils, but only in
+-- Cabal >= 1.18. For backwards-compatibility, we implement a copy with a new
+-- name here. Some desirable alternate strategies don't work:
+-- * We can't use CPP to check which version of Cabal we're up against because
+-- this is the file that's generating the macros for doing that.
+-- * We can't use the name moreRecentFiles and use
+-- import D.S.U hiding (moreRecentFiles)
+-- because on old GHC's (and according to the Report) hiding a name that
+-- doesn't exist is an error.
+moreRecentFile' :: FilePath -> FilePath -> IO Bool
+moreRecentFile' a b = do
+ exists <- doesFileExist b
+ if not exists
+ then return True
+ else do tb <- getModificationTime b
+ ta <- getModificationTime a
+ return (ta > tb)
hunk ./gtk/SetupWrapper.hs 113
- setupHsNewer <- setupHsFile `moreRecentFile` setupProgFile
- cabalVersionNewer <- setupVersionFile `moreRecentFile` setupProgFile
+ setupHsNewer <- setupHsFile `moreRecentFile'` setupProgFile
+ cabalVersionNewer <- setupVersionFile `moreRecentFile'` setupProgFile
hunk ./gtk/SetupWrapper.hs 119
- (comp, conf) <- compConf `fmap` configCompiler (Just GHC) Nothing Nothing
+ (comp, conf) <- configCompiler (Just GHC) Nothing Nothing
hunk ./gtk/SetupWrapper.hs 166
-
-moreRecentFile :: FilePath -> FilePath -> IO Bool
-moreRecentFile a b = do
- exists <- doesFileExist b
- if not exists
- then return True
- else do tb <- getModificationTime b
- ta <- getModificationTime a
- return (ta > tb)
hunk ./pango/Gtk2HsSetup.hs 68
+import Distribution.Simple.Program.Find ( defaultProgramSearchPath )
+onDefaultSearchPath f a b = f a b defaultProgramSearchPath
hunk ./pango/Gtk2HsSetup.hs 74
+onDefaultSearchPath = id
hunk ./pango/Gtk2HsSetup.hs 439
- location <- programFindLocation prog normal
+ location <- onDefaultSearchPath programFindLocation prog normal
hunk ./pango/SetupWrapper.hs 33
--- The former instance is for Cabal < 1.17; the latter for Cabal >= 1.17. We
--- can't use CPP to check which version of Cabal we're up against here because
--- this is the file that's generating those macros.
-class CompConf a where compConf :: a -> (Compiler, ProgramConfiguration)
-instance CompConf (Compiler, ProgramConfiguration) where compConf = id
-instance CompConf (Compiler, a, ProgramConfiguration) where compConf (c, a, p) = (c, p)
+-- moreRecentFile is implemented in Distribution.Simple.Utils, but only in
+-- Cabal >= 1.18. For backwards-compatibility, we implement a copy with a new
+-- name here. Some desirable alternate strategies don't work:
+-- * We can't use CPP to check which version of Cabal we're up against because
+-- this is the file that's generating the macros for doing that.
+-- * We can't use the name moreRecentFiles and use
+-- import D.S.U hiding (moreRecentFiles)
+-- because on old GHC's (and according to the Report) hiding a name that
+-- doesn't exist is an error.
+moreRecentFile' :: FilePath -> FilePath -> IO Bool
+moreRecentFile' a b = do
+ exists <- doesFileExist b
+ if not exists
+ then return True
+ else do tb <- getModificationTime b
+ ta <- getModificationTime a
+ return (ta > tb)
hunk ./pango/SetupWrapper.hs 113
- setupHsNewer <- setupHsFile `moreRecentFile` setupProgFile
- cabalVersionNewer <- setupVersionFile `moreRecentFile` setupProgFile
+ setupHsNewer <- setupHsFile `moreRecentFile'` setupProgFile
+ cabalVersionNewer <- setupVersionFile `moreRecentFile'` setupProgFile
hunk ./pango/SetupWrapper.hs 119
- (comp, conf) <- compConf `fmap` configCompiler (Just GHC) Nothing Nothing
+ (comp, conf) <- configCompiler (Just GHC) Nothing Nothing
hunk ./pango/SetupWrapper.hs 166
-
-moreRecentFile :: FilePath -> FilePath -> IO Bool
-moreRecentFile a b = do
- exists <- doesFileExist b
- if not exists
- then return True
- else do tb <- getModificationTime b
- ta <- getModificationTime a
- return (ta > tb)
|