jailbreak-cabal 1.1 → 1.2
raw patch · 2 files changed
+38/−12 lines, 2 filesdep ~Cabal
Dependency ranges changed: Cabal
Files
- Main.hs +34/−6
- jailbreak-cabal.cabal +4/−6
Main.hs view
@@ -12,11 +12,39 @@ main = getArgs >>= mapM_ (\cabalFile -> readPackageDescription silent cabalFile >>= writeGenericPackageDescription cabalFile . stripVersionRestrictions) stripVersionRestrictions :: GenericPackageDescription -> GenericPackageDescription-stripVersionRestrictions pkg = pkg { condLibrary = fmap f2 (condLibrary pkg)- , condExecutables = map f1 (condExecutables pkg)- , condTestSuites = map f1 (condTestSuites pkg)+stripVersionRestrictions pkg = pkg { condLibrary = fmap relaxLibraryTree (condLibrary pkg)+ , condExecutables = map relaxTree (condExecutables pkg)+ , condTestSuites = map relaxTree (condTestSuites pkg) } where- f1 (string,condTree) = (string, f2 condTree)- f2 ct = ct { condTreeConstraints = map f3 (condTreeConstraints ct) }- f3 (Dependency d _) = Dependency d anyVersion+ relaxTree :: (t, CondTree v [Dependency] a) -> (t, CondTree v [Dependency] a)+ relaxTree (string,condTree) = (string, relaxTreeConstraints condTree)++ relaxTreeConstraints :: CondTree v [Dependency] a -> CondTree v [Dependency] a+ relaxTreeConstraints ct = ct { condTreeConstraints = map relax (condTreeConstraints ct) }++ relaxLibraryTree :: CondTree v [Dependency] Library -> CondTree v [Dependency] Library+ relaxLibraryTree ct = relaxTreeConstraints $ ct { condTreeData = relaxLibrary (condTreeData ct) }++ relaxExeTree :: CondTree v [Dependency] Executable -> CondTree v [Dependency] Executable+ relaxExeTree ct = relaxTreeConstraints $ ct { condTreeData = relaxExe (condTreeData ct) }++ relaxTestTree :: CondTree v [Dependency] TestSuite -> CondTree v [Dependency] TestSuite+ relaxTestTree ct = relaxTreeConstraints $ ct { condTreeData = relaxTest (condTreeData ct) }++ relaxLibrary :: Library -> Library+ relaxLibrary l = l { libBuildInfo = relaxBuildInfo (libBuildInfo l) }++ relaxExe :: Executable -> Executable+ relaxExe e = e { buildInfo = relaxBuildInfo (buildInfo e) }++ relaxTest :: TestSuite -> TestSuite+ relaxTest t = t { testBuildInfo = relaxBuildInfo (testBuildInfo t) }++ relaxBuildInfo :: BuildInfo -> BuildInfo+ relaxBuildInfo bi = bi { buildTools = map relax (buildTools bi)+ , targetBuildDepends = map relax (targetBuildDepends bi)+ }++ relax :: Dependency -> Dependency+ relax (Dependency d _) = Dependency d anyVersion
jailbreak-cabal.cabal view
@@ -1,5 +1,5 @@ Name: jailbreak-cabal-Version: 1.1+Version: 1.2 Synopsis: Strip version restrictions from build dependencies in Cabal files. License: BSD3 License-file: LICENSE@@ -9,9 +9,8 @@ Category: Distribution Build-type: Simple Cabal-version: >= 1.6-Tested-with: GHC >= 6.10.4 && <= 7.6.1-Description:- Strip version restrictions from build dependencies in Cabal files.+Tested-with: GHC >= 6.10.4 && <= 7.10.1+Description: Strip version restrictions from build dependencies in Cabal files. Source-Repository head Type: git@@ -19,5 +18,4 @@ Executable jailbreak-cabal Main-is: Main.hs- Build-depends: base >= 3 && < 5, Cabal >= 1.12.0- Ghc-Options: -Wall+ Build-depends: base >= 3 && < 5, Cabal > 1.18