cabal-rpm 2.0.9 → 2.0.10
raw patch · 9 files changed
+48/−29 lines, 9 files
Files
- ChangeLog +7/−0
- TODO +10/−0
- cabal-rpm.cabal +1/−1
- src/Commands/Spec.hs +1/−5
- src/Commands/Update.hs +2/−2
- src/FileUtils.hs +15/−10
- src/Main.hs +2/−0
- src/PackageUtils.hs +8/−9
- src/Stackage.hs +2/−2
ChangeLog view
@@ -1,3 +1,10 @@+# 2.0.10 (2021-08-14)+* pkgSpecPkgData: try allowing versioned dir+* update: only output old version if upgrading+* stack: use final lts17+* Stackage: bump to LTS 18+* Spec: drop %ghc_fix_rpath for subpkgs+ # 2.0.9 (2021-06-08) - spec: doc requires ghc-filesystem - spec: make %cabal_test conditional explicit
TODO view
@@ -1,4 +1,14 @@+- 'install' in empty package dir fails (have to local or spec first)+- 'install' in a source dir: "package not found for directory"+ - maybe just run "cabal install" for executable?++- cblrpm local: Running repoquery for haskell-gi-overloading+Unavailable dependencies: haskell-gi-overloading++- generate deps for subpkgs tests or disable them? (eg optparse-simple)+ - spec: hardcode list of dummy packages (mtl-compat, etc)+- spec: generate manpage from help - update prints package name twice (due to spec generation?) - in container/clean install: cblrpm local HsOpenSSL fails:
cabal-rpm.cabal view
@@ -1,5 +1,5 @@ Name: cabal-rpm-Version: 2.0.9+Version: 2.0.10 Synopsis: RPM packaging tool for Haskell Cabal-based packages Description: This package provides a RPM packaging tool for Haskell Cabal-based packages.
src/Commands/Spec.hs view
@@ -40,8 +40,7 @@ import Control.Monad.Extra -#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,8,0))-#else+#if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) #endif @@ -488,9 +487,6 @@ when hasSubpkgs $ put "%ghc_libs_install %{subpkgs}" put $ "%ghc_" ++ pkgType ++ "_install"-- when hasSubpkgs $- put $ "%ghc_fix_rpath" +-+ pkgver unless (null dupdocs) $ do putNewline
src/Commands/Update.hs view
@@ -62,7 +62,6 @@ oldPkgId = package pkgDesc name = pkgName oldPkgId wasrevised = isJust $ lookup "x-revision" (customFieldsPD pkgDesc)- putStrLn $ display oldPkgId +-+ "->" (newPkgId, mstream) <- case mpvs of Nothing -> do@@ -99,8 +98,9 @@ else do newrev <- getRevisedCabal newPkgId when (newver == oldver) $- putStrLn "Package is already latest version."+ putStrLn "already latest version" when (newrev || updated) $ do+ putStrLn $ display oldPkgId +-+ "current" subpkg <- grep_ "%{subpkgs}" spec curspec <- createSpecVersion oldPkgId spec wasrevised (if subpkg then Just Nothing else Nothing) newspec <- createSpecVersion newPkgId spec True (if subpkg then Just mstream else Nothing)
src/FileUtils.hs view
@@ -21,7 +21,7 @@ filesWithExtension, fileWithExtension, fileWithExtension_,- getDirectoryContents_,+ listDirectory', mktempdir, withCurrentDirectory, withTempDirectory) where@@ -32,21 +32,21 @@ #endif import Control.Exception (bracket) import Control.Monad (when)-import Data.List (isPrefixOf)+import Data.List import Data.Maybe (isJust) import SimpleCmd (cmd, error')-import System.Directory (getCurrentDirectory, getDirectoryContents,+import System.Directory (getCurrentDirectory, listDirectory, setCurrentDirectory, removeDirectoryRecursive, #if (defined(MIN_VERSION_directory) && MIN_VERSION_directory(1,2,3)) withCurrentDirectory #endif )-import System.FilePath (takeExtension, (</>))+import System.FilePath import System.Posix.Files (fileSize, getFileStatus) filesWithExtension :: FilePath -> String -> IO [FilePath] filesWithExtension dir ext =- filter (\ f -> takeExtension f == ext) <$> getDirectoryContents dir+ filter (ext `isExtensionOf`) <$> listDirectory dir -- looks in dir for a unique file with given extension fileWithExtension :: FilePath -> String -> IO (Maybe FilePath)@@ -76,11 +76,10 @@ setCurrentDirectory cwd return res) --- getDirectoryContents without hidden files--- (note: listDirectory only filters "." and "..")-getDirectoryContents_ :: FilePath -> IO [FilePath]-getDirectoryContents_ dir =- filter (not . isPrefixOf ".") <$> getDirectoryContents dir+-- listDirectory without hidden files+listDirectory' :: FilePath -> IO [FilePath]+listDirectory' dir =+ filter (not . isPrefixOf ".") <$> listDirectory dir #if (defined(MIN_VERSION_directory) && MIN_VERSION_directory(1,2,3)) #else@@ -96,3 +95,9 @@ size <- fileSize <$> getFileStatus file when (size == 0) $ error' $ file ++ " is empty!"++#if !MIN_VERSION_filepath(1,4,2)+isExtensionOf :: String -> FilePath -> Bool+isExtensionOf ext@('.':_) = isSuffixOf ext . takeExtensions+isExtensionOf ext = isSuffixOf ('.':ext) . takeExtensions+#endif
src/Main.hs view
@@ -29,7 +29,9 @@ #endif import Distribution.Text (simpleParse) import Distribution.Verbosity (normal, silent)+#if !MIN_VERSION_simple_cmd_args(0,1,7) import Options.Applicative (maybeReader)+#endif import System.IO (BufferMode(LineBuffering), hSetBuffering, stdout) import Commands.BuildDep (builddep)
src/PackageUtils.hs view
@@ -36,7 +36,7 @@ ) where import FileUtils (assertFileNonEmpty, filesWithExtension, fileWithExtension,- getDirectoryContents_, mktempdir, withCurrentDirectory,+ listDirectory', mktempdir, withCurrentDirectory, withTempDirectory) import SimpleCabal (finalPackageDescription, licenseFiles, mkPackageName, PackageDescription, PackageIdentifier(..), PackageName,@@ -72,7 +72,7 @@ import System.Directory (copyFile, createDirectoryIfMissing, doesDirectoryExist, doesFileExist, getCurrentDirectory,- getDirectoryContents, getModificationTime,+ getModificationTime, removeDirectoryRecursive, renameFile, setCurrentDirectory) import System.Environment (getEnv)@@ -90,7 +90,7 @@ findDocsLicenses :: FilePath -> PackageDescription -> IO ([FilePath], [FilePath]) findDocsLicenses dir pkgDesc = do- contents <- getDirectoryContents dir+ contents <- listDirectory' dir let docs = sort $ filter unlikely $ filter (likely docNames) contents let licenses = sort $ nub $ licenseFiles pkgDesc ++ filter (likely licenseNames) contents@@ -147,7 +147,7 @@ let cacheparent = home </> ".cabal" </> "packages" havecache <- doesDirectoryExist cacheparent unless havecache cabalUpdate- remotes <- getDirectoryContents_ cacheparent+ remotes <- listDirectory' cacheparent let pkgid' = fromMaybe (error' $ "Parse failed for:" +-+ dropExtensions file) $@@ -376,11 +376,10 @@ Just pkg -> prepStreamPkg flags Nothing defaultLTS pkg revise keep Nothing -> do cwd <- getCurrentDirectory- let trydir = simpleParse (takeFileName cwd)- case trydir of- Just pdir | pkgVersion pdir == nullVersion ->- prepare flags (streamPkgToPVS Nothing trydir) revise keep- _ -> error' "package not found for directory"+ case simpleParse (takeFileName cwd) of+ Just pdir ->+ prepare flags (streamPkgToPVS Nothing (Just pdir)) revise keep+ Nothing -> error' "package not found for directory" where specPackageData :: FilePath -> IO PackageData specPackageData spec = do
src/Stackage.hs view
@@ -41,10 +41,10 @@ import Types defaultLTS :: Stream-defaultLTS = LTS 17+defaultLTS = LTS 18 latestLTS :: Stream-latestLTS = LTS 17+latestLTS = LTS 18 stackageList :: Stream -> PackageName -> IO (Maybe PackageIdentifier) stackageList stream pkg = do