[haskell-platform] #195: cabal output changed, breaking Build.hs under some conditions

haskell-platform haskell-platform at projects.haskell.org
Sun May 20 00:46:08 BST 2012


#195: cabal output changed, breaking Build.hs under some conditions
------------------------------+---------------------------------------------
 Reporter:  MtnViewMark       |       Owner:  MtnViewMark
     Type:  defect            |      Status:  new        
 Priority:  major             |   Milestone:  2012.4.0.0 
Component:  (none-specified)  |    Keywords:             
------------------------------+---------------------------------------------
 From Chris Dornan:

 The current tar-ball generator doesn’t work with the latest cabal-install
 (0.14.0).

 In build.hs we have

    --
    -- Too sleepy. Future: solve this via the cabal library
    --
    let cmd = "cabal install --dry-run --reinstall " ++ (
                        intercalate " " [ package
                                | (_, package) <- urls
                    ] ) ++ " > platform.packages.raw"
    --writeFile "platform.packages.cmd" cmd
    system cmd
    src <- readFile "platform.packages.raw"

    let programs = drop 2 $ lines src
    writeFile "platform.packages" (unlines programs)

 The problem is that ' cabal install --dry-run --reinstall' has become too
 loquacious for
 our convenience and is annotating the output with extra context. The first
 word
 of the output still contains what we need (the package) so I have replaced
 the
 second `let` binding above with this,

    let fw ln    = case words ln of { [] -> ""; p:_ -> p; }
        programs = map fw $ drop 2 $ lines src

 to get a sensible content for platform.packages (for a while).

 The modified Build.hs can be found here: https://github.com/cdornan
 /haskell-platform/blob/pre-release/src/generic/Build.hs

-- 
Ticket URL: <http://trac.haskell.org/haskell-platform/ticket/195>
haskell-platform <http://trac.haskell.org/haskell-platform>
The Haskell Platform: a comprehensive and robust collection of Haskell libraries


More information about the Haskell-platform mailing list