cabal-rpm 0.9.9 → 0.9.10
raw patch · 6 files changed
+41/−14 lines, 6 filesdep ~Cabaldep ~time
Dependency ranges changed: Cabal, time
Files
- ChangeLog +7/−0
- cabal-rpm.cabal +3/−3
- src/Commands/Spec.hs +1/−1
- src/Commands/Update.hs +13/−7
- src/Dependencies.hs +1/−1
- src/SysCmd.hs +16/−2
ChangeLog view
@@ -1,3 +1,10 @@+* 0.9.10 (2016-03-24)+- bugfixes+ - update no longer tries to grep non-existent .git+ - fix duplicate clibs+- fix build with ghc-8.0 (Cabal-1.23 and time-1.6)+- SuSE improvements: no disttag or rpmdev-bumpspec+ * 0.9.9 (2016-01-25) - couple of minor improvements for SUSE packaging
cabal-rpm.cabal view
@@ -1,5 +1,5 @@ Name: cabal-rpm-Version: 0.9.9+Version: 0.9.10 Synopsis: RPM packaging tool for Haskell Cabal-based packages Description: This package provides a RPM packaging tool for Haskell Cabal-based packages.@@ -34,7 +34,7 @@ Executable cblrpm Main-is: Main.hs Build-depends: base < 5,- Cabal > 1.10 && < 1.23,+ Cabal > 1.10 && < 1.24, directory, filepath, process,@@ -43,7 +43,7 @@ Build-Depends: old-locale >= 1 && < 1.1, time >= 1.2 && < 1.5 else- Build-Depends: time >= 1.5 && < 1.6+ Build-Depends: time >= 1.5 && < 1.7 Other-modules: Commands.Depends, Commands.Diff,
src/Commands/Spec.hs view
@@ -17,7 +17,7 @@ -- (at your option) any later version. module Commands.Spec (- createSpecFile, createSpecFile_+ createSpecFile, createSpecFile_, detectDistro, Distro(..) ) where import Dependencies (notInstalled, packageDependencies, showDep,
src/Commands/Update.hs view
@@ -1,6 +1,6 @@ -- | -- Module : Commands.Update--- Copyright : (C) 2014-2015 Jens Petersen+-- Copyright : (C) 2014-2016 Jens Petersen -- -- Maintainer : Jens Petersen <petersen@fedoraproject.org> -- Stability : alpha@@ -16,9 +16,9 @@ update ) where -import Commands.Spec (createSpecFile)+import Commands.Spec (createSpecFile, detectDistro, Distro(..)) import FileUtils (withTempDirectory)-import PackageUtils (PackageData (..), bringTarball, latestPkg,+import PackageUtils (PackageData (..), bringTarball, isGitDir, latestPkg, packageName, packageVersion, prepare, removePrefix) import Setup (RpmFlags (..)) import SysCmd (cmd_, cmdBool, shell, (+-+))@@ -27,7 +27,8 @@ import Distribution.PackageDescription (PackageDescription (..)) import Distribution.Simple.Utils (die) -import System.Directory (createDirectory, setCurrentDirectory)+import System.Directory (createDirectory, getCurrentDirectory,+ setCurrentDirectory) update :: PackageData -> RpmFlags -> IO () update pkgdata flags =@@ -43,7 +44,8 @@ then error $ current +-+ "is latest version." else do bringTarball latest- rwGit <- cmdBool "grep -q 'url = ssh://' .git/config"+ gitDir <- getCurrentDirectory >>= isGitDir+ rwGit <- if gitDir then cmdBool "grep -q 'url = ssh://' .git/config" else return False when rwGit $ cmd_ "fedpkg" ["new-sources", latest ++ ".tar.gz"] withTempDirectory $ \cwd -> do@@ -51,9 +53,13 @@ newspec <- createSpecVersion latest spec shell $ "diff -u1 -I \"- spec file generated by cabal-rpm\" -I \"Fedora Haskell SIG <haskell@lists.fedoraproject.org>\"" +-+ curspec +-+ newspec +-+ "| patch -d" +-+ cwd +-+ "-p1" +-+ "|| :" setCurrentDirectory cwd- cmd_ "sed" ["-i", "-e s/^\\(Release: \\).*/\\10%{?dist}/", spec]+ distro <- detectDistro+ let suffix = if distro == SUSE then "" else "%{?dist}"+ cmd_ "sed" ["-i", "-e s/^\\(Release: \\).*/\\10" ++ suffix ++ "/", spec] let newver = removePrefix (name ++ "-") latest- cmd_ "rpmdev-bumpspec" ["-c", "update to" +-+ newver, spec]+ if distro == SUSE+ then cmd_ "sed" ["-i", "-e s/^\\(Version: \\).*/\\1" ++ newver ++ "/", spec]+ else cmd_ "rpmdev-bumpspec" ["-c", "update to" +-+ newver, spec] when rwGit $ cmd_ "git" ["commit", "-a", "-m", "update to" +-+ newver] where
src/Dependencies.hs view
@@ -117,7 +117,7 @@ tools = filter excludedTools $ nub $ map mapTools tools' ++ chrpath clibs <- catMaybes <$> mapM resolveLib clibs' let showPkgCfg p = "pkgconfig(" ++ p ++ ")"- return (map showDep deps, tools, clibs, map showPkgCfg pkgcfgs, selfdep)+ return (map showDep deps, tools, nub clibs, map showPkgCfg pkgcfgs, selfdep) testsuiteDependencies :: PackageDescription -- ^pkg description -> String -- ^self
src/SysCmd.hs view
@@ -33,21 +33,35 @@ import Data.List ((\\)) import Data.Maybe (fromMaybe, isJust, isNothing) +import Distribution.Simple.Utils (die)+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,18,0)+import Distribution.Simple.Program.Find (defaultProgramSearchPath,+ findProgramOnSearchPath)+#else import Distribution.Simple.Utils (die, findProgramLocation)+#endif import Distribution.Verbosity (normal) import System.Posix.User (getEffectiveUserID) import System.Process (readProcess, readProcessWithExitCode, system, rawSystem) import System.Exit (ExitCode(..)) +findProgram :: String -> IO (Maybe FilePath)+findProgram =+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,18,0)+ findProgramOnSearchPath normal defaultProgramSearchPath+#else+ findProgramLocation normal+#endif+ requireProgram :: String -> IO () requireProgram c = do- mavail <- findProgramLocation normal c+ mavail <- findProgram c when (isNothing mavail) $ die (c ++ ": command not found") optionalProgram :: String -> IO Bool optionalProgram c = do- mavail <- findProgramLocation normal c+ mavail <- findProgram c return $ isJust mavail cmd_ :: String -> [String] -> IO ()