cabal-rpm 0.9.10 → 0.9.11
raw patch · 6 files changed
+21/−15 lines, 6 filesdep ~Cabal
Dependency ranges changed: Cabal
Files
- ChangeLog +3/−0
- cabal-rpm.cabal +2/−2
- src/Commands/Spec.hs +5/−5
- src/Dependencies.hs +2/−2
- src/PackageUtils.hs +1/−1
- src/SysCmd.hs +8/−5
ChangeLog view
@@ -1,3 +1,6 @@+* 0.9.11 (2016-05-06)+- build with Cabal-1.24+ * 0.9.10 (2016-03-24) - bugfixes - update no longer tries to grep non-existent .git
cabal-rpm.cabal view
@@ -1,5 +1,5 @@ Name: cabal-rpm-Version: 0.9.10+Version: 0.9.11 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.24,+ Cabal > 1.10 && < 1.25, directory, filepath, process,
src/Commands/Spec.hs view
@@ -66,7 +66,7 @@ then do now <- getCurrentTime return $ formatTime defaultTimeLocale "0.%Y%m%d" now- else return $ if (distro == SUSE) then "0" else "1"+ else return $ if distro == SUSE then "0" else "1" rstrip :: (Char -> Bool) -> String -> String rstrip p = reverse . dropWhile p . reverse@@ -100,7 +100,7 @@ if specAlreadyExists then notice verbose $ specFile +-+ "exists:" +-+ if rpmForce flags then "forcing overwrite" else "creating" +-+ specFile' else do- let realdir dir = ("cblrpm." `isPrefixOf` takeBaseName dir)+ let realdir dir = "cblrpm." `isPrefixOf` takeBaseName dir when (maybe True realdir mdest) $ putStrLn pkgname @@ -274,7 +274,7 @@ let execs = sort $ map exeName $ filter isBuildable $ executables pkgDesc when selfdep $ do putNewline- put $ "%ghc_fix_dynamic_rpath" +-+ intercalate " " (map (\ p -> if p == name then "%{pkg_name}" else p) execs)+ put $ "%ghc_fix_dynamic_rpath" +-+ unwords (map (\ p -> if p == name then "%{pkg_name}" else p) execs) let licensefiles = #if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,20,0)@@ -312,7 +312,7 @@ docs <- findDocs cabalPath licensefiles - let license_macro = if (distro == Fedora) then "%license" else "%doc"+ let license_macro = if distro == Fedora then "%license" else "%doc" when hasExecPkg $ do put "%files"@@ -345,7 +345,7 @@ when (distro /= Fedora) $ put "%defattr(-,root,root,-)" unless (null docs) $ put $ "%doc" +-+ unwords docs- when (not binlib) $+ unless binlib $ mapM_ (\ p -> put $ "%{_bindir}/" ++ (if p == name then "%{pkg_name}" else p)) execs putNewline putNewline
src/Dependencies.hs view
@@ -26,7 +26,7 @@ import SysCmd (cmd, cmdBool, repoquery, (+-+)) import Control.Applicative ((<$>))-import Control.Monad (filterM, liftM)+import Control.Monad (filterM) import Data.List (delete, nub) import Data.Maybe (catMaybes)@@ -133,7 +133,7 @@ notInstalled :: String -> IO Bool notInstalled dep =- liftM not $ cmdBool $ "rpm -q --whatprovides" +-+ shellQuote dep+ fmap not $ cmdBool $ "rpm -q --whatprovides" +-+ shellQuote dep where shellQuote :: String -> String shellQuote (c:cs) = (if c `elem` "()" then (['\\', c] ++) else (c:)) (shellQuote cs)
src/PackageUtils.hs view
@@ -220,7 +220,7 @@ latestPkg :: String -> IO String latestPkg pkg = do contains_pkg <- lines <$> cmd "cabal" ["list", "-v0", "--simple-output", pkg]- let pkgs = filter ((== pkg) . takeWhile (not . (== ' '))) contains_pkg+ let pkgs = filter ((== pkg) . takeWhile (/= ' ')) contains_pkg if null pkgs then error $ pkg ++ " hackage not found" else return $ map (\c -> if c == ' ' then '-' else c) $ last pkgs
src/SysCmd.hs view
@@ -33,10 +33,10 @@ 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)+import Distribution.Simple.Utils (die) #else import Distribution.Simple.Utils (die, findProgramLocation) #endif@@ -46,12 +46,15 @@ import System.Process (readProcess, readProcessWithExitCode, system, rawSystem) import System.Exit (ExitCode(..)) -findProgram :: String -> IO (Maybe FilePath)-findProgram =+findProgram :: FilePath -> IO (Maybe FilePath)+findProgram prog = #if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,18,0)- findProgramOnSearchPath normal defaultProgramSearchPath+ findProgramOnSearchPath normal defaultProgramSearchPath prog+#if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,23,0)+ >>= return . fmap fst+#endif #else- findProgramLocation normal+ findProgramLocation normal prog #endif requireProgram :: String -> IO ()