debian-build 0.9.2.0 → 0.10.0.0
raw patch · 2 files changed
+23/−19 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- debian-build.cabal +6/−1
- mains/odebuild.hs +17/−18
debian-build.cabal view
@@ -1,5 +1,5 @@ name: debian-build-version: 0.9.2.0+version: 0.10.0.0 synopsis: Debian package build sequence tools description: This package provides build sequence functions for debian package, and includes on-the-fly@@ -13,6 +13,11 @@ category: Debian build-type: Simple cabal-version: >=1.10+tested-with: GHC == 8.0.1+ , GHC == 7.10.1, GHC == 7.10.2, GHC == 7.10.3+ , GHC == 7.8.1, GHC == 7.8.2, GHC == 7.8.3, GHC == 7.8.4+ , GHC == 7.6.1, GHC == 7.6.2, GHC == 7.6.3+ , GHC == 7.4.1, GHC == 7.4.2 library exposed-modules:
mains/odebuild.hs view
@@ -31,6 +31,7 @@ { revision :: Maybe String , installDeps :: Bool , buildModes :: [BuildMode] -> [BuildMode]+ , reuseSource :: Bool } defaultOptions :: ODebuildOptions@@ -39,6 +40,7 @@ { revision = Nothing , installDeps = False , buildModes = id+ , reuseSource = False } descs :: [OptDescr (ODebuildOptions -> Either String ODebuildOptions)]@@ -55,6 +57,9 @@ return $ opts { buildModes = buildModes opts . (m : ) } ) "BUILD_MODE") "add build-mode to build-mode list to specify"+ , Option ['R'] ["reuse-source"]+ (NoArg $ \opts -> return $ opts { reuseSource = True })+ "not clean generated source directory, and build will reuse it" ] parseOption :: [String]@@ -82,14 +87,21 @@ clean :: Build () clean = removeBuildDir -prepare :: ODebuildOptions -> [String] -> Build ((FilePath, FilePath), Source, Maybe Hackage)-prepare opts cdArgs = do- clean- maybe (fail "Illegal state: genSources") return =<< genSources (revision opts) cdArgs+prepare :: ODebuildOptions -> [String] -> Build (FilePath, Source, Maybe Hackage)+prepare opts cdArgs+ | reuseSource opts = do+ (dir, src, hkg) <- maybe (fail "generated source not found") return+ =<< runMaybeT findGeneratedSource+ return (dir, src, Just hkg)+ | otherwise = do+ clean+ ((_, dir), src, mayH) <- maybe (fail "Illegal state: genSources") return+ =<< genSources (revision opts) cdArgs+ return (dir, src, mayH) build' :: [BuildMode] -> ODebuildOptions -> [String] -> [String] -> Build (Source, Maybe Hackage) build' modes opts cdArgs debArgs = do- ((_, dir), src, mayH) <- prepare opts cdArgs+ (dir, src, mayH) <- prepare opts cdArgs liftTrace $ Command.build dir modes (installDeps opts) debArgs return (src, mayH) @@ -110,17 +122,6 @@ maybe (return ()) remove' mayH install' -compile :: ODebuildOptions -> [String] -> [String] -> Build (Source, Hackage)-compile opts _ debArgs = do- (dir, src, hkg) <- maybe (fail "generated source not found") return =<< runMaybeT findGeneratedSource- liftTrace $ Command.build dir (buildModes opts []) (installDeps opts) debArgs- return (src, hkg)--compileInstall :: ODebuildOptions -> [String] -> [String] -> Build ()-compileInstall opts x debArgs = do- void $ compile opts x debArgs- install'- run :: Build a -> IO a run b = do cur <- pwd@@ -159,8 +160,6 @@ "build" -> void $ runArgs build as1 "install" -> runArgs install as1 "reinstall" -> runArgs reinstall as1- "compile" -> void $ runArgs compile as1- "compile-i" -> runArgs compileInstall as1 _ -> void $ runArgs build as2 [] -> run . void $ build defaultOptions [] []