This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 21 Mar, 2008 2 commits
    • Duncan Coutts's avatar
      Add Text instances for Version and VersionRange · 66bb76be
      Duncan Coutts authored
      The instance for Version is in the Text module itself because the
      Version type is defined in base. This avoids an orphan instance.
      66bb76be
    • Duncan Coutts's avatar
      Add Text class for displaying and parsing values · 86ac8140
      Duncan Coutts authored
      This is intended to replace all these showFoo read/parseFoo functions
      we have all over the place. It's like the Read/Show classes but uses
      a half decent parser and pretty printer:
      class Text a where
        disp  :: a -> Doc
        parse :: ReadP a
      This patch just adds the class and an instance for Bool, replacing
      the parseBool function used in a few places. More to follow...
      86ac8140
  2. 19 Mar, 2008 5 commits
  3. 18 Mar, 2008 1 commit
  4. 17 Mar, 2008 1 commit
    • mnislaih's avatar
      #223 part 1: Extend Distribution.Command.Simple.Option · 7bbbe596
      mnislaih authored
           so that it really represents an option and not just a flag.
           It's been renamed to OptionField as it models a field in a flags-like data structure. 
           
              data OptionField a = OptionField {
                optionName        :: Name,
                optionDescr       :: [OptDescr a] }
            
              data OptDescr a  = ReqArg Description OptFlags ArgDescr (ReadE (a->a))         (a -> [String])
                               | OptArg Description OptFlags ArgDescr (ReadE (a->a)) (a->a)  (a -> [Maybe String])
                               | ChoiceOpt [(Description, OptFlags, a->a, a -> Bool)]
      			 | BoolOpt Description OptFlags{-True-} OptFlags{-False-} (Bool -> a -> a) (a -> Bool)
            
            An option field can expand to several command line options, which are all defined together.
            For example, the compiler flag is defined as follows.
            
                  option [] ["compiler"] "compiler"
                     configHcFlavor (\v flags -> flags { configHcFlavor = v })
                     (choiceOpt [ (Flag GHC, ("g", ["ghc"]), "compile with GHC")
                                , (Flag NHC, ([] , ["nhc98"]), "compile with NHC")
                                , (Flag JHC, ([] , ["jhc"]), "compile with JHC")
                                , (Flag Hugs,([] , ["hugs"]), "compile with Hugs")])
            
            We can need to use several kinds of OptDescr for the same option, as in the 
            optimization Option (really a extreme case):
            
                  ,multiOption "optimization"
                     configOptimization (\v flags -> flags { configOptimization = v })
                     [optArg' "n" (Flag . flagToOptimisationLevel)
                      ....
                      ....
                              "Build with optimization (n is 0--2, default is 1)",
                      noArg (Flag NoOptimisation) []
      7bbbe596
  5. 18 Mar, 2008 2 commits
    • Duncan Coutts's avatar
      Refactor sdist code a bit · d7117f67
      Duncan Coutts authored
      Separate the phases of sdist better so that they can be reused in
      cabal-install. This part is similar to Andrea Vezzosi's patch.
      Separate the snapshot code rather than mixing it all in with prepareTree.
      Use a proper withTempDirectory which fixes one FIXME.
      Better separate UI code from actions, move the notices to sdist.
      d7117f67
    • Saizan's avatar
      fix 'clean' bug on windows caused by leaked Handle. · c2e3fece
      Saizan authored
      Using readFile to read dist/setup-config keeps the Handle open when we try to delete the file, causing an error. 
      So we instead read the file strictly and close the Handle early.
      c2e3fece
  6. 17 Mar, 2008 1 commit
    • Duncan Coutts's avatar
      Change mkLibName and friends to take a package id and not take the dir · 5c86f87a
      Duncan Coutts authored
      So now it really gives just the lib name and not its location as well.
      It turned out that we more often want just the name since we're copying
      the same named file from one directory to another.
      Taking a PackageIdentifier means we do the conversion to string in one
      place rather than all over the place.
      It also means we're chaning the lib names for nhc98 to include the lib
      version number. This should not make any real difference to nhc98.
      5c86f87a
  7. 18 Mar, 2008 1 commit
  8. 17 Mar, 2008 3 commits
  9. 12 Mar, 2008 3 commits
    • Duncan Coutts's avatar
      Add a CompilerId type and use it in appropriate places · d15eb1cb
      Duncan Coutts authored
      Especially instead of abusing a PackageIdentifier for the purpose.
      d15eb1cb
    • Duncan Coutts's avatar
      Move Dependency and it's show and parser into Package module · 31185708
      Duncan Coutts authored
      Rather than having it in Version and its parser elsewhere.
      The Package module already imports the Version module which exports the
      VersionRange type.
      31185708
    • Duncan Coutts's avatar
      Fix search dirs used for pre-processing executables · d28e1b90
      Duncan Coutts authored
      It was combining the executable's hs-source-dirs with the library's
      hs-source-dirs when pre-processing executables. This was inconsistent
      with the search path used for finding ordinary .hs files and with
      sdist and lead to confusing behaviour. See ticket #161.
      If an executable needs source files from the library then it must specify
      the right hs-source-dirs, including '.' if appropriate.
      The behaviour is that if hs-source-dirs is not specified then the default
      is '.' however if hs-source-dirs is specified then '.' is not implicitly
      added. If it's needed then it must be added explicitly. This was always
      the case for ordinary .hs files, this patch just brings things into line
      for files that need pre-processing.
      d28e1b90
  10. 06 Mar, 2008 1 commit
  11. 11 Mar, 2008 1 commit
  12. 08 Mar, 2008 1 commit
    • Duncan Coutts's avatar
      Fix rejection of non-ambigious options · e223e4c8
      Duncan Coutts authored
      This GetOpt patch was sent the the libraries list by Eelis van der Weegen
      with the explanation:
      There is a bug in System.Console.GetOpt causing it to mistakenly reject
      options as ambiguous. Example:
        optsDesc = [Option "" ["color", "colour"] (ReqArg id "color") ""]
      Output:
        option `--col' is ambiguous; could be one of:
            --color=color, --colour=color  Foreground color
            --color=color, --colour=color  Foreground color
      This error is silly, because the two alternatives listed are the same option.
      e223e4c8
  13. 07 Mar, 2008 2 commits
  14. 06 Mar, 2008 1 commit
  15. 10 Mar, 2008 5 commits
  16. 07 Mar, 2008 3 commits
  17. 06 Mar, 2008 1 commit
  18. 05 Mar, 2008 2 commits
  19. 04 Mar, 2008 2 commits
  20. 05 Mar, 2008 2 commits