packages feed

cabal-rpm 2.0.11 → 2.0.11.1

raw patch · 5 files changed

+24/−13 lines, 5 filesdep ~Cabal

Dependency ranges changed: Cabal

Files

ChangeLog view
@@ -1,3 +1,6 @@+# 2.0.11.1 (2022-03-28)+- support building with Cabal 3.6+ # 2.0.11 (2022-03-13) - take build-tool-depends into account - 'spec','update': detect %autorelease and preserve %autochangelog
cabal-rpm.cabal view
@@ -1,5 +1,5 @@ Name:                cabal-rpm-Version:             2.0.11+Version:             2.0.11.1 Synopsis:            RPM packaging tool for Haskell Cabal-based packages Description:     This package provides a RPM packaging tool for Haskell Cabal-based packages.@@ -45,7 +45,7 @@ Executable cabal-rpm     Main-is:            Main.hs     Build-depends: base < 5,-                   Cabal > 1.10 && < 3.5,+                   Cabal > 1.10 && < 3.7,                    directory,                    extra,                    filepath,
src/Commands/Spec.hs view
@@ -625,8 +625,7 @@ showLicense PublicDomain = "Public Domain" showLicense AllRightsReserved = "Proprietary" showLicense OtherLicense = "Unknown"--- FIXME-showLicense (UnknownLicense l) = removePrefix "LicenseRef" l+showLicense (UnknownLicense l) = removePrefix "LicenseRef" l  -- FIXME #if defined(MIN_VERSION_Cabal) && MIN_VERSION_Cabal(1,16,0) showLicense (Apache Nothing) = "ASL ?" showLicense (Apache (Just ver)) = "ASL" +-+ showVersion ver
src/FileUtils.hs view
@@ -34,7 +34,7 @@ import Control.Monad (when) import Data.List import Data.Maybe (isJust)-import SimpleCmd (cmd, error')+import SimpleCmd import System.Directory (getCurrentDirectory, listDirectory,                          setCurrentDirectory, removeDirectoryRecursive, #if (defined(MIN_VERSION_directory) && MIN_VERSION_directory(1,2,3))@@ -44,6 +44,7 @@ import System.FilePath import System.Posix.Files (fileSize, getFileStatus) +#if !MIN_VERSION_simple_cmd(0,2,4) filesWithExtension :: FilePath -> String -> IO [FilePath] filesWithExtension dir ext =   filter (ext `isExtensionOf`) <$> listDirectory dir@@ -56,6 +57,7 @@        [file] -> return $ Just $ dir </> file        [] -> return Nothing        _ -> putStrLn ("More than one " ++ ext ++ " file found!") >> return Nothing+#endif  -- looks in current dir for a unique file with given extension fileWithExtension_ :: FilePath -> String -> IO Bool
src/PackageUtils.hs view
@@ -57,18 +57,19 @@ import Stackage (defaultLTS, latestStackage) import Types -#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,8,0))-#else+#if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) #endif import Control.Monad    (filterM, unless, void, when) -import Data.Char (toLower)-import Data.List+import Data.List.Extra import Data.Maybe import Data.Time.Clock (diffUTCTime, getCurrentTime)  import Distribution.Text (display, simpleParse)+#if MIN_VERSION_Cabal(3,6,0)+import Distribution.Utils.Path (getSymbolicPath)+#endif  import System.Directory import System.Environment (getEnv)@@ -90,15 +91,16 @@ findDocsLicenses dir pkgDesc = do   contents <- listDirectory' dir   let docs = sort $ filter unlikely $ filter (likely docNames) contents-  let licenses = sort $ nub $ licenseFiles pkgDesc-        ++ filter (likely licenseNames) contents+  let licenses = sort $ nub+                 (map getSymbolicPath (licenseFiles pkgDesc)+                  ++ filter (likely licenseNames) contents)       docfiles = if null licenses then docs else filter (`notElem` licenses) docs   return (docfiles, licenses)   where docNames = ["announce", "author", "bugs", "changelog", "changes",                     "contribut", "example", "news", "readme", "todo"]         licenseNames = ["copying", "licence", "license"]-        likely names name = let lowerName = map toLower name-                      in any (`isPrefixOf` lowerName) names+        likely :: [String] -> String -> Bool+        likely names name = any (`isPrefixOf` lower name) names         unlikely name = not $ any (`isSuffixOf` name) ["~", ".cabal"]  bringTarball :: PackageIdentifier -> Bool -> Maybe FilePath -> IO ()@@ -532,3 +534,8 @@ getSpecField :: String -> FilePath -> IO String getSpecField field spec =   cmd "rpmspec" ["-q", "--qf", "%{" ++ field ++ "}", "--srpm", "--undefine", "dist", spec]++#if !MIN_VERSION_Cabal(3,6,0)+getSymbolicPath :: FilePath -> String+getSymbolicPath = id+#endif