debian-build 0.7.2.2 → 0.8.0.0
raw patch · 5 files changed
+23/−63 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Debian.Package.Build.Cabal: hackageLongName :: PackageDescription -> String
- Debian.Package.Build.Cabal: hackageName :: PackageDescription -> String
- Debian.Package.Build.Cabal: hackageVersion :: PackageDescription -> String
- Debian.Package.Build.Cabal: parsePackageDescription :: FilePath -> IO PackageDescription
- Debian.Package.Build.Command: rawSystem' :: [String] -> Trace ()
+ Debian.Package.Build.Command: rawSystem' :: String -> [String] -> Trace ()
- Debian.Package.Build.Command: readProcess' :: [String] -> Trace String
+ Debian.Package.Build.Command: readProcess' :: String -> [String] -> String -> Trace String
Files
- debian-build.cabal +1/−1
- src/Debian/Package/Build.hs +1/−1
- src/Debian/Package/Build/Cabal.hs +0/−29
- src/Debian/Package/Build/Command.hs +17/−28
- src/Debian/Package/Build/Sequence.hs +4/−4
debian-build.cabal view
@@ -1,5 +1,5 @@ name: debian-build-version: 0.7.2.2+version: 0.8.0.0 synopsis: Debian package build sequence tools description: This package provides build sequence functions for debian package, and includes on-the-fly
src/Debian/Package/Build.hs view
@@ -17,5 +17,5 @@ import Debian.Package.Build.Monad import Debian.Package.Build.Command-import Debian.Package.Build.Cabal hiding (hackageLongName, hackageName, hackageVersion, build)+import Debian.Package.Build.Cabal hiding (build) import Debian.Package.Build.Sequence
src/Debian/Package/Build/Cabal.hs view
@@ -10,8 +10,6 @@ -- This module wraps cabal library interfaces to keep sparse dependency to it. module Debian.Package.Build.Cabal ( findDescriptionFile- , parsePackageDescription- , hackageLongName, hackageName, hackageVersion , setupCmd, clean, sdist , configure, build, install, register@@ -26,13 +24,6 @@ import System.Directory (getDirectoryContents, doesFileExist) import System.Environment (withArgs) -import Distribution.Text (disp)-import Distribution.Verbosity (silent)-import Distribution.Package (pkgName, pkgVersion)-import Distribution.PackageDescription- (packageDescription, PackageDescription, package)-import Distribution.PackageDescription.Parse (readPackageDescription)- import Distribution.Simple (defaultMain) import Debian.Package.Build.Monad (Trace, traceCommand)@@ -48,26 +39,6 @@ | otherwise = return False where suf = ".cabal" fmap (dir </>) . listToMaybe <$> filterM find fs---- | Parse .cabal file-parsePackageDescription :: FilePath -> IO PackageDescription-parsePackageDescription = (packageDescription `fmap`) . readPackageDescription silent---- | Hackage name and version string from 'PackageDescription'-hackageLongName :: PackageDescription -> String-hackageLongName = show . disp . package---- | Hackage name string from 'PackageDescription'-hackageName :: PackageDescription -> String-hackageName = show . disp . pkgName . package---- | Hackage version string from 'PackageDescription'-hackageVersion :: PackageDescription -> String-hackageVersion = show . disp . pkgVersion . package--_testDotCabal :: IO PackageDescription-_testDotCabal = do Just path <- findDescriptionFile "."- parsePackageDescription path setup :: [String] -> Trace () setup args = do
src/Debian/Package/Build/Command.hs view
@@ -34,7 +34,6 @@ ) where import Data.Maybe (fromMaybe)-import Control.Arrow ((&&&)) import Control.Applicative ((<$>)) import Control.Monad (when, unless) import Control.Monad.Trans.Class (lift)@@ -51,29 +50,22 @@ import Debian.Package.Build.Monad (Trace, traceCommand, traceOut, putLog, bracketTrace_) -splitCommand :: [a] -> (a, [a])-splitCommand = head &&& tail- handleExit :: String -> ExitCode -> IO () handleExit cmd = d where d (ExitFailure rv) = fail $ unwords ["Failed with", show rv ++ ":", cmd] d ExitSuccess = return () -- | Run command without shell and get standard output string.-readProcess' :: [String] -> Trace String-readProcess' cmd0 = do- traceCommand $ unwords cmd0- lift $ do- let (cmd, args) = splitCommand cmd0- Process.readProcess cmd args ""+readProcess' :: String -> [String] -> String -> Trace String+readProcess' cmd args in' = do+ traceCommand . unwords $ cmd : args+ lift $ Process.readProcess cmd args in' -- | Run command without shell-rawSystem' :: [String] -> Trace ()-rawSystem' cmd0 = do- traceCommand $ unwords cmd0- lift $ do- let (cmd, args) = splitCommand cmd0- Process.rawSystem cmd args >>= handleExit cmd+rawSystem' :: String -> [String] -> Trace ()+rawSystem' cmd args = do+ traceCommand . unwords $ cmd : args+ lift (Process.rawSystem cmd args >>= handleExit cmd) -- | Run command with shell system' :: String -> Trace ()@@ -115,14 +107,14 @@ -- | Confirm filepath using /ls/ command confirmPath :: String -> Trace () confirmPath path =- readProcess' ["ls", "-ld", path] >>= traceOut+ readProcess' "ls" ["-ld", path] "" >>= traceOut -- | Unpack .tar.gz under directory. unpackInDir :: FilePath -> FilePath -> Trace () apath `unpackInDir` dir = do putLog $ unwords ["Unpacking", apath, "in", dir, "."]- rawSystem' ["tar", "-C", dir, "-zxf", apath]+ rawSystem' "tar" ["-C", dir, "-zxf", apath] -- | Unpack .tar.gz under archive place. unpack :: FilePath -> Trace ()@@ -132,7 +124,7 @@ packInDir' :: FilePath -> FilePath -> FilePath -> Trace () packInDir' pdir apath wdir = do putLog $ unwords ["Packing", pdir, "in", wdir, "into", apath, "."]- rawSystem' ["tar", "-C", wdir, "-zcf", apath, pdir]+ rawSystem' "tar" ["-C", wdir, "-zcf", apath, pdir] -- | Pack directory into same location .tar.gz under working directory packInDir :: FilePath -> FilePath -> Trace ()@@ -164,7 +156,7 @@ | otherwise -> return oldArgs _ -> return oldArgs - rawSystem' $ "cabal-debian" : args+ rawSystem' "cabal-debian" args -- | Call /cabal-debian/ command under specified directory cabalDebian :: FilePath -> Maybe String -> Trace ()@@ -173,14 +165,14 @@ -- | Query debian package version packageVersion :: String -> Trace DebianVersion packageVersion pkg = do- vstr <- readProcess' ["dpkg-query", "--show", "--showformat=${Version}", pkg]+ vstr <- readProcess' "dpkg-query" ["--show", "--showformat=${Version}", pkg] "" maybe (fail $ "readDebianVersion: failed: " ++ vstr) return $ readDebianVersion vstr -- | Read debian changelog file and try to parse into 'Source' dpkgParseChangeLog :: FilePath -> Trace Source dpkgParseChangeLog cpath = do- str <- readProcess' ["dpkg-parsechangelog", "-l" ++ cpath]+ str <- readProcess' "dpkg-parsechangelog" ["-l" ++ cpath] "" maybe (fail $ "parseChangeLog: failed: " ++ str) return $ parseChangeLog str @@ -193,11 +185,8 @@ $ parseControl str -run :: String -> [String] -> Trace ()-run cmd = rawSystem' . (cmd :)- debuild' :: [String] -> Trace ()-debuild' = run "debuild"+debuild' = rawSystem' "debuild" -- | Call /debuild/ under specified directory, with command line options debuild :: FilePath -> [String] -> Trace ()@@ -205,7 +194,7 @@ -- | Just run debi with root user debi' :: [String] -> Trace ()-debi' = rawSystem' . (["sudo", "debi"] ++)+debi' = rawSystem' "sudo" . ("debi" :) -- | Install packages under specified source package directory debi :: FilePath -> [String] -> Trace ()@@ -214,7 +203,7 @@ -- | Install build-depends aptGetBuildDepends :: FilePath -> Trace () aptGetBuildDepends dir =- withCurrentDir' dir $ rawSystem' ["sudo", "apt-get-build-depends"]+ withCurrentDir' dir $ rawSystem' "sudo" ["apt-get-build-depends"] -- | Build mode, all or binary only data BuildMode = All | Bin | Src | Dep | Indep
src/Debian/Package/Build/Sequence.hs view
@@ -78,7 +78,7 @@ bldDir <- getBuildDir liftTrace $ do found <- liftIO $ doesDirectoryExist bldDir- when found $ rawSystem' ["rm", "-r", bldDir]+ when found $ rawSystem' "rm" ["-r", bldDir] -- | Take debian-directory name from 'Build' action context. debianDirName' :: Build FilePath@@ -104,7 +104,7 @@ copyDebianDir srcDir = do debDN <- debianDirName' baseDir <- askBaseDir- liftTrace $ rawSystem' ["cp", "-a", baseDir </> debDN, srcDir </> "."]+ liftTrace $ rawSystem' "cp" ["-a", baseDir </> debDN, srcDir </> "."] -- Setup source directory under build-directory using rsync.@@ -121,8 +121,8 @@ ++ [debDN] ++ confEXs liftTrace $ do createDirectoryIfMissing srcDir- rawSystem'- $ ["rsync", "-auv"]+ rawSystem' "rsync"+ $ ["-auv"] ++ ["--exclude=" ++ e | e <- excludes] ++ [baseDir </> ".", srcDir </> "." ] return srcDir