Ticket #516: _516_-maintains-a-per_user-index-of-haddock-docs.dpatch

File _516_-maintains-a-per_user-index-of-haddock-docs.dpatch, 35.9 KB (added by Saizan, 3 years ago)

patch for cabal-install

Line 
1Sun Jun  7 19:05:12 CEST 2009  Andrea Vezzosi <sanzhiyan@gmail.com>
2  * #516, maintains a per-user index of haddock docs
3  If the haddock-index flag is set it keeps an index
4  of the haddock documentation of the packages in
5  the global and user databases
6
7New patches:
8
9[#516, maintains a per-user index of haddock docs
10Andrea Vezzosi <sanzhiyan@gmail.com>**20090607170512
11 Ignore-this: 1114f6b944043781c4bf99620573b1cc
12 If the haddock-index flag is set it keeps an index
13 of the haddock documentation of the packages in
14 the global and user databases
15] {
16addfile ./Distribution/Client/Haddock.hs
17hunk ./Distribution/Client/Haddock.hs 1
18+-----------------------------------------------------------------------------
19+-- |
20+-- Module      :  Distribution.Client.Haddock
21+-- Copyright   :  (c) Andrea Vezzosi 2009
22+-- License     :  BSD-like
23+--
24+-- Maintainer  :  cabal-devel@haskell.org
25+-- Portability :  portable
26+--
27+-- Interfacing with Haddock
28+--
29+-----------------------------------------------------------------------------
30+module Distribution.Client.Haddock
31+    (
32+     regenerateHaddockIndex
33+    )
34+    where
35+
36+import Data.Maybe (Maybe(..), listToMaybe)
37+import Data.List (maximumBy)
38+import Control.Monad (Monad(return), sequence, guard)
39+import System.Directory (createDirectoryIfMissing, doesFileExist,
40+                         renameFile)
41+import System.FilePath (FilePath, (</>), splitFileName)
42+import Distribution.Package (Package(..))
43+import Distribution.Simple.Program (haddockProgram, ProgramConfiguration
44+                                   , rawSystemProgram, requireProgramVersion)
45+import Distribution.Version (Version(Version), orLaterVersion)
46+import Distribution.Verbosity (Verbosity)
47+import Distribution.Text (display)
48+import Distribution.Simple.PackageIndex(PackageIndex, allPackages,
49+                                        allPackagesByName, fromList)
50+import Distribution.Simple.Utils (comparing, installDirectoryContents
51+                                 , intercalate, warn, withTempDirectory)
52+import Distribution.InstalledPackageInfo as InstalledPackageInfo
53+    (InstalledPackageInfo,InstalledPackageInfo_(haddockHTMLs, haddockInterfaces, exposed, package))
54+
55+regenerateHaddockIndex :: Verbosity -> PackageIndex InstalledPackageInfo -> ProgramConfiguration -> FilePath -> IO ()
56+regenerateHaddockIndex verbosity pkgs conf index = do
57+      (paths,warns) <- haddockPackagePaths pkgs'
58+      case warns of
59+        Nothing -> return ()
60+        Just m  -> warn verbosity m
61+     
62+      (confHaddock, _, _) <-
63+          requireProgramVersion verbosity haddockProgram
64+                                    (orLaterVersion (Version [0,6] [])) conf
65+
66+      createDirectoryIfMissing True destDir
67+
68+      withTempDirectory verbosity destDir "htemp" $ \tempDir -> do
69+
70+        let flags = ["--gen-contents", "--gen-index", "--odir="++tempDir]
71+                    ++ map (\(i,h) -> "--read-interface=" ++ h ++ "," ++ i) paths
72+        rawSystemProgram verbosity confHaddock flags
73+        renameFile (tempDir </> "index.html") (tempDir </> destFile)
74+        installDirectoryContents verbosity tempDir destDir
75+     
76+  where
77+    (destDir,destFile) = splitFileName index
78+    pkgs' = map (maximumBy $ comparing packageId)
79+            . allPackagesByName
80+            . fromList
81+            . filter exposed
82+            . allPackages
83+            $ pkgs
84+
85+haddockPackagePaths :: [InstalledPackageInfo_ m]
86+                       -> IO ([(FilePath, FilePath)], Maybe [Char])
87+haddockPackagePaths pkgs = do
88+  interfaces <- sequence
89+    [ case interfaceAndHtmlPath pkg of
90+        Just (interface, html) -> do
91+          exists <- doesFileExist interface
92+          if exists
93+            then return (pkgid, Just (interface, html))
94+            else return (pkgid, Nothing)
95+        Nothing -> return (pkgid, Nothing)
96+    | pkg <- pkgs, let pkgid = InstalledPackageInfo.package pkg ]
97+
98+  let missing = [ pkgid | (pkgid, Nothing) <- interfaces ]
99+
100+      warning = "The documentation for the following packages are not "
101+             ++ "installed. No links will be generated to these packages: "
102+             ++ intercalate ", " (map display missing)
103+
104+      flags = [ x | (_, Just x) <- interfaces ]
105+
106+  return (flags, if null missing then Nothing else Just warning)
107+
108+  where
109+    interfaceAndHtmlPath pkg = do
110+      interface <- listToMaybe (InstalledPackageInfo.haddockInterfaces pkg)
111+      html <- listToMaybe (InstalledPackageInfo.haddockHTMLs pkg)
112+      guard (not . null $ html)
113+      return (interface, html)
114hunk ./Distribution/Client/Install.hs 44
115          , upgradableDependencies
116          , Progress(..), foldProgress, )
117 import Distribution.Client.Fetch (fetchPackage)
118+import qualified Distribution.Client.Haddock as Haddock (regenerateHaddockIndex)
119 -- import qualified Distribution.Client.Info as Info
120 import Distribution.Client.IndexUtils as IndexUtils
121          ( getAvailablePackages, disambiguateDependencies )
122hunk ./Distribution/Client/Install.hs 92
123          ( defaultPackageDesc, rawSystemExit, comparing )
124 import Distribution.Simple.InstallDirs
125          ( PathTemplate, fromPathTemplate, toPathTemplate
126-         , initialPathTemplateEnv, substPathTemplate )
127+         , initialPathTemplateEnv, substPathTemplate, systemPathTemplateEnv )
128 import Distribution.Package
129          ( PackageName, PackageIdentifier, packageName, packageVersion
130          , Package(..), PackageFixedDeps(..)
131hunk ./Distribution/Client/Install.hs 224
132         when (reportingLevel == DetailedReports) $
133           storeDetailedBuildReports verbosity logsDir buildReports
134 
135+        regenerateHaddockIndex installPlan'
136+
137         symlinkBinaries verbosity configFlags installFlags installPlan'
138         printBuildFailures installPlan'
139 
140hunk ./Distribution/Client/Install.hs 230
141   where
142+    regenerateHaddockIndex installPlan' = do
143+      let regenIndex = and [not . null . filter installedDocs . InstallPlan.toList $ installPlan'
144+                             ,UserPackageDB `elem` packageDBs
145+                             ,null [() | SpecificPackageDB _ <- packageDBs]
146+                           ]
147+      when (regenIndex && isJust (flagToMaybe haddockIndex)) $ do
148+            installed <- getInstalledPackages verbosity comp packageDBs conf
149+            case installed of
150+              Nothing -> return () -- warning ?
151+              Just index -> do
152+                defaultDirs <- InstallDirs.defaultInstallDirs
153+                               ((\(CompilerId x _) -> x) $ compilerId comp)
154+                               (fromFlag (configUserInstall configFlags))
155+                               True
156+                Haddock.regenerateHaddockIndex verbosity index conf
157+                            (substHaddockIndexFileName defaultDirs . fromFlag $ haddockIndex)
158+       where
159+         installedDocs (InstallPlan.Installed _ (BuildOk DocsOk _)) = True
160+         installedDocs _                                            = False
161+         haddockIndex = installHaddockIndex installFlags
162+         substHaddockIndexFileName defaultDirs template = fromPathTemplate
163+                                                        . substPathTemplate env
164+                                                        $ template
165+   
166+           where env = systemPathTemplateEnv (compilerId comp) absoluteDirs
167+                 templateDirs   = InstallDirs.combineInstallDirs fromFlagOrDefault
168+                                  defaultDirs (configInstallDirs configFlags)
169+                 absoluteDirs   = InstallDirs.absoluteInstallDirs'
170+                                  (InstallDirs.compilerToTemplateEnv (compilerId comp)
171+                                   ++ InstallDirs.platformToTemplateEnv (buildPlatform))
172+                                  templateDirs
173+
174     setupScriptOptions index = SetupScriptOptions {
175       useCabalVersion  = maybe anyVersion thisVersion (libVersion miscOptions),
176       useCompiler      = Just comp,
177hunk ./Distribution/Client/Setup.hs 451
178 --
179 data InstallFlags = InstallFlags {
180     installDocumentation:: Flag Bool,
181+    installHaddockIndex :: Flag PathTemplate,
182     installDryRun       :: Flag Bool,
183     installReinstall    :: Flag Bool,
184     installOnly         :: Flag Bool,
185hunk ./Distribution/Client/Setup.hs 465
186 defaultInstallFlags :: InstallFlags
187 defaultInstallFlags = InstallFlags {
188     installDocumentation= Flag False,
189+    installHaddockIndex = Flag . toPathTemplate $ "$datadir" </> "doc" </> "index.html",
190     installDryRun       = Flag False,
191     installReinstall    = Flag False,
192     installOnly         = Flag False,
193hunk ./Distribution/Client/Setup.hs 513
194           installDocumentation (\v flags -> flags { installDocumentation = v })
195           (boolOpt [] [])
196 
197+      , option [] ["haddock-index"]
198+          "Haddock html index file (name template shouldn't use $pkgid)"
199+          installHaddockIndex (\v flags -> flags { installHaddockIndex = v })
200+          (reqArg' "TEMPLATE" (toFlag.toPathTemplate)
201+                              (flagToList . fmap fromPathTemplate))
202       , option [] ["dry-run"]
203           "Do not install anything, only print what would be installed."
204           installDryRun (\v flags -> flags { installDryRun = v })
205hunk ./Distribution/Client/Setup.hs 569
206 instance Monoid InstallFlags where
207   mempty = InstallFlags {
208     installDocumentation= mempty,
209+    installHaddockIndex = mempty,
210     installDryRun       = mempty,
211     installReinstall    = mempty,
212     installOnly         = mempty,
213hunk ./Distribution/Client/Setup.hs 581
214   }
215   mappend a b = InstallFlags {
216     installDocumentation= combine installDocumentation,
217+    installHaddockIndex = combine installHaddockIndex,
218     installDryRun       = combine installDryRun,
219     installReinstall    = combine installReinstall,
220     installOnly         = combine installOnly,
221hunk ./cabal-install.cabal 57
222         Distribution.Client.Dependency.TopDown.Types
223         Distribution.Client.Dependency.Types
224         Distribution.Client.Fetch
225+        Distribution.Client.Haddock
226         Distribution.Client.HttpUtils
227         Distribution.Client.IndexUtils
228         Distribution.Client.Install
229}
230
231Context:
232
233[Fix use of deprecated version constructors
234Duncan Coutts <duncan@haskell.org>**20090604180500]
235[Only report preferred new versions of cabal-install are available
236Duncan Coutts <duncan@haskell.org>**20090604175726
237 That is, use the "preferred-versions" mechanism when deciding
238 whether there is a new version available. This would allow us to
239 upload a new version without everyone immediately being told to
240 get it and try it out.
241]
242[Make cabal upload/check print out the error messages reported by the server
243Duncan Coutts <duncan@haskell.org>**20090604124836
244 The code to do it was already there but we were checking for the
245 mime type text/plain using just (==) when in fact the server reports 
246   text/plain; charset="ISO-8859-1"
247 so we have to parse the field a bit better (still a bit of a hack).
248]
249[Require latest Cabal lib version
250Duncan Coutts <duncan@haskell.org>**20090603102312]
251[Improve formatting of cabal check output
252Duncan Coutts <duncan@haskell.org>**20090603102254]
253[Only apply preferences to base if its version is unbounded above
254Duncan Coutts <duncan@haskell.org>**20090603101623
255 Fixes ticket #485. This means that for constraints like:
256     build-depends: base >= 3 && < 5
257 we will pick version 4. However we will continue to apply the
258 version 3 preference for things like:
259     build-depends: base >= 3
260 Where there is no upper bound on the version. Note that we now
261 also ignore preferences for base given on the command line.
262 We should implement #483 to split prefs from shims.
263]
264[Improve the parse error message for package name/deps
265Duncan Coutts <duncan@haskell.org>**20090321154623
266 Make it clear that it's the specification of the package name that
267 is at fault rather than the package to which the name refers.
268]
269[Debian in their wisdom decided to build network against parsec 3.
270Duncan Coutts <duncan@haskell.org>**20090308142925
271 So checking for parsec 2 fails. We don't strictly need parsec, it's
272 just a dependency of network, so remove the check.
273]
274[Simplify version ranges before printing in error messages
275Duncan Coutts <duncan@haskell.org>**20090531191346
276 Part of ticket #369
277]
278[Use new top handler, should get better error messages
279Duncan Coutts <duncan@haskell.org>**20090531190318]
280[Fix uses of deprecated stuff
281Duncan Coutts <duncan@haskell.org>**20090531190239]
282[New development branch, version 0.7
283Duncan Coutts <duncan@haskell.org>**20090531184336
284 Update to development version of Cabal
285]
286[Solaris 9 /bin/sh doesn't like the ! syntax in bootstrap.sh
287Duncan Coutts <duncan@haskell.org>**20090318091730]
288[Clarify the instructions in the README and bootstrap.sh
289Duncan Coutts <duncan@haskell.org>**20090315125407
290 Addresses the complaint in ticket #523.
291]
292[Select Configuration file via env var CABAL_CONFIG.
293Paolo Losi <paolo.losi@gmail.com>**20090223005251
294 Ignore-this: 26e5ded85cb69cb3a19cd57680a8a362
295]
296[Update tar code based on new tar package
297Duncan Coutts <duncan@haskell.org>**20090301174949]
298[Actually does compile with unix-1.0 that comes with ghc-6.6
299Duncan Coutts <duncan@haskell.org>**20090221154605
300 ghc-6.6.1 came with unix-2.1
301]
302[TAG 0.6.2
303Duncan Coutts <duncan@haskell.org>**20090219130720]
304[Extend the invariant on the Constraints ADT
305Duncan Coutts <duncan@haskell.org>**20081219192309
306 It now carries around the original version of the database
307 purely so that it can do a much more extensive consistency
308 check. Packages are never gained or lost, just transfered
309 between pots in various slightly tricky ways.
310]
311[Add extra assertion into the top down dep planner
312Duncan Coutts <duncan@haskell.org>**20090218234650]
313[Update the README
314Duncan Coutts <duncan@haskell.org>**20090219130705]
315[Add missing other-modules
316Duncan Coutts <duncan@haskell.org>**20090218235206]
317[Bump version to 0.6.2
318Duncan Coutts <duncan@haskell.org>**20090218231016]
319[Update changelog for 0.6.2 release
320Duncan Coutts <duncan@haskell.org>**20090218230918]
321[Tweaks to the bootstrap script
322Duncan Coutts <duncan@haskell.org>**20090218223943
323 Update Cabal lib version to 1.6.0.2
324 Implement a couple shell script coding style recommendations.
325]
326[Disable the upgrade command for now.
327Duncan Coutts <duncan@haskell.org>**20090218221752]
328[Add warnings in the case that no remote servers have been specified
329Duncan Coutts <duncan@haskell.org>**20090216181424
330 It's not strictly an error but it can be rather confusing.
331]
332[Put an explanation of the config file format at the top in comments.
333Duncan Coutts <duncan@haskell.org>**20090215190817]
334[Change the field order in the initial config file.
335Duncan Coutts <duncan@haskell.org>**20090215190727
336 Also update the name of one excluded field.
337]
338[Put the default logging and reporting setting in the initial config file.
339Duncan Coutts <duncan@haskell.org>**20090215190524]
340[Complete the implementation of --build-summary=TEMPLATE
341Duncan Coutts <duncan@haskell.org>**20090215190254
342 Actually respect the new flag. It's actually a list of template files
343 and all specified files get written to. This allows us to specify
344 a default build log file and also have the user write to extra ones.
345 The summary file template can contain $pkgid $compiler etc.
346]
347[Rearrange user interface for build logging
348Duncan Coutts <duncan@haskell.org>**20090215185800
349 The new options (as described in ticket #501) are:
350   --build-summary=TEMPLATE
351   --build-log=TEMPLATE
352   --remote-build-reporting=LEVEL
353   where LELVEL `elem` [none,anonymous,detailed]
354]
355[always check environment variables for HTTP proxy first
356Ganesh Sittampalam <ganesh.sittampalam@credit-suisse.com>**20090210230736]
357[Improve the cabal update notice
358Duncan Coutts <duncan@haskell.org>**20090209211844]
359[Don't report that packages are cached at the default verbosity level
360Duncan Coutts <duncan@haskell.org>**20090209201228
361 It's just not that useful. Report it at -v verobisty level, and
362 change the text and formatting.
363]
364[Fix #490, unpack now gives a proper error message.
365Andrea Vezzosi <sanzhiyan@gmail.com>**20090208165240
366 Ignore-this: 358dd291624f8858a52ae2ff27a7e0c2
367]
368[Use the new withTempDirectory function
369Duncan Coutts <duncan@haskell.org>**20090202012255
370 In particular it means that install will unpack packages into
371 different temp dirs on each invocation which means that running
372 install on the same package for different compilers at the same
373 time should not clash. This is quite useful for testing.
374]
375[Add compat withTempDirectory function
376Duncan Coutts <duncan@haskell.org>**20090202011917
377 This is already in Cabal HEAD but we cannot use that yet
378]
379[Add homepage and bug-reports fields to .cabal file
380Duncan Coutts <duncan@haskell.org>**20090201225021]
381[Remove the prefernece and cabal lib version flags from the InstallFlags
382Duncan Coutts <duncan@haskell.org>**20090126012412
383 They are now in the ConfigExFlags instead.
384]
385[Change the install and configure modules to use the extended config flags
386Duncan Coutts <duncan@haskell.org>**20090126011942]
387[Add ConfigExFlags into the configure, install and upgrade commands
388Duncan Coutts <duncan@haskell.org>**20090126010918
389 Not yet passed all the way through.
390]
391[Add ConfigExFlags and related command
392Duncan Coutts <duncan@haskell.org>**20090126010132
393 This is for configure flags that we use in the configure command in the
394 cabal command line tool that are not present in runghc Setup configure
395 command line interface. These are flags that we are moving from the
396 install command, so that we can also use them for the configure command.
397 Initially it's just the flags for specifying package version preferences
398 and  the cabal library version. We'll add constraints later.
399]
400[Remove unnecessary qualified use of ConfigFlags
401Duncan Coutts <duncan@haskell.org>**20090126003951]
402[Make configure use the dependency resolver
403Duncan Coutts <duncan@haskell.org>**20090125170951
404 This means it makes smarter decisions and also decions that are more
405 consistent with those taken by the install command.
406]
407[Update HTTP dep in the bootstrap script
408Duncan Coutts <duncan@haskell.org>**20090123160700]
409[Improve error message when ghc or ghc-pkg are mismatched or not found
410Duncan Coutts <duncan@haskell.org>**20090123160550]
411[Don't use grep -e, solaris does not like it
412Duncan Coutts <duncan@haskell.org>**20090123160443]
413[Fix some FIXMEs and do some TODOs in the list command
414Duncan Coutts <duncan@haskell.org>**20090123004810
415 Now properly prints if the haddock docs are installed and if the
416 tarball is cached. It did print them before but it was lying.
417]
418[Add initial implementation of cabal info
419Duncan Coutts <duncan@haskell.org>**20090119025202
420 It provides more detailed information on a particular package.
421 Still a few TODOs. Fixes #361, #449 and #456.
422]
423[Only print the config file location for the global --help
424Duncan Coutts <duncan@haskell.org>**20090116175900]
425[Update to using HTTP-4000.x
426Duncan Coutts <duncan@haskell.org>**20090116135646
427 This should fix a long-standing bug with http proxies (ticket #352)
428 It should also make downloads faster, or at least use less memory.
429]
430[Parse compiler field from old config files correctly
431Duncan Coutts <duncan@haskell.org>**20090116002851
432 Really old versions of cabal-install generated a default config
433 containing "compiler: GHC". Sadly the new way we generate the
434 config file parser from the command line parser means we end up
435 with a case-sensitive parser as it only matches the exact
436 command line flags. So we hack it and add in a traditional
437 parser for that field only. Really the command line and config
438 file infrastructure needs rewriting again. Sigh.
439]
440[Improve the printing of config file field parse error messages
441Duncan Coutts <duncan@haskell.org>**20090116001421]
442[Read install dirs correctly from old-style .cabal/config files
443Duncan Coutts <duncan@haskell.org>**20090116001321
444 Should fix ticket #365
445]
446[Note in the README that zlib needs the zlib C lib package
447Duncan Coutts <duncan@haskell.org>**20090116000541]
448[Traditional /bin/sh portability fixes for bootstrap.sh
449Duncan Coutts <duncan@haskell.org>**20090115113227]
450[More improvments to the bootstrap.sh script
451Duncan Coutts <duncan@haskell.org>**20090115110612]
452[Rewrite the bootstrap.sh script
453Duncan Coutts <duncan@haskell.org>**20090115102210
454 Hopefully more useful and more robust. In particular it does not
455 download and install packages where suitable versions are already
456 installed. It also checks for deps.
457]
458[Don't add installed constraints system packages that are not installed
459Duncan Coutts <duncan@haskell.org>**20090114143540
460 In particular fixes a problem (ticket #439) where we required the
461 installed version of ghc-prim with compilers that do not have that
462 package such as ghc-6.8 and older, hugs, nhc, lhc etc.
463]
464[cabal update now reports if a newer version of cabal-install is available
465Duncan Coutts <duncan@haskell.org>**20090114133220]
466[Warn if a package index from a remote repo is 15 days or older
467Duncan Coutts <duncan@haskell.org>**20090114124827
468 For example it will print:
469 Warning: The package list for 'hackage.haskell.org' is 16 days old.
470 Run 'cabal update' to get the latest list of available packages.
471]
472[Don't display the category in cabal list output
473Duncan Coutts <duncan@haskell.org>**20090114003549
474 It is probably not sufficiently useful to justify the space it takes.
475]
476[In cabal list, always display available and installed versions
477Duncan Coutts <duncan@haskell.org>**20090114003329
478 Previously we omitted the line if it was not installed, or was
479 not available. However that confused people because it was not
480 obvious that it would list both. Now it shows something like:
481  * foo
482        Latest version available: 1.0
483        Latest version installed: [ Not installed ]
484]
485[Print the location of the config file in the global --help
486Duncan Coutts <duncan@haskell.org>**20090113192215
487 Ticket #413
488]
489[Improve the cabal --help output
490Duncan Coutts <duncan@haskell.org>**20090113192058
491 Put the general info message at the top and make the explanation of
492 installing a hackage package somewhat clearer.
493]
494[Display examples in cabal install --help
495Duncan Coutts <duncan@haskell.org>**20090113161426
496 Examples:
497   cabal install                     Package in the current directory
498   cabal install foo                 Package from the hackage server
499   cabal install foo-1.0             Specific version of a package
500   cabal install 'foo < 2'           Constrained package version
501]
502[Print a newline after entering upload password
503Duncan Coutts <duncan@haskell.org>**20090113142604
504 So we end up with:
505   Hackage password:
506   Uploading test.tar.gz...
507 rather than:
508   Hackage password: Uploading test.tar.gz...
509]
510[Respect the --package-db flag when compiling Setup.hs
511Duncan Coutts <duncan@haskell.org>**20081221184755
512 Fixes ticket #394.
513]
514[Use a more precise package substitution test in improvePlan
515Duncan Coutts <duncan@haskell.org>**20081219215922
516 This is where we take a valid plan and we "improve" it by swapping
517 installed packages for available packages wherever possible. This
518 change is to the condition we use in deciding if it is safe to use
519 the installed package in place of a reinstall. Previously we checked
520 that the dependencies of the installed version were exactly the same
521 as the dependencies we were planning to reinstall with. That was
522 valid but rather conservative. It caused problems in some situations
523 where the installed package did not exactly match the available
524 package (eg when using development versions of a package or of ghc).
525 What we do now is test if the extra constraints implied by selecting
526 the installed version are consistent with the existing set of
527 constraints. This involves threading the constraint set around. In
528 theory this should even cope with adding additional packages to the
529 plan as a result of selecting an installed package.
530]
531[Use installed constraints instead of hiding versions of the base package
532Duncan Coutts <duncan@haskell.org>**20081219193740
533 We want to stop cabal-install from accidentally trying to upgrade
534 the base package since this doesn't work in most cases. We used to
535 achieve that by deleting the base package from the available package
536 index. We now do it by leaving the package index as is and instead
537 adding a constraint that we pick only an installed version of base.
538 This is a nicer hack and has the potential to give better error
539 messages.
540]
541[Fix constraint set handling for installed constraints
542Duncan Coutts <duncan@haskell.org>**20081219182328
543 A rather subtle bug. The code was actually correct but the transitionsTo
544 assertion was not accounting for a transition between the case where
545 a package's available version had been excluded and then the whole thing
546 got excluded by a version constraint. It counted one side as a loss
547 without a corresponding gain on the other side.
548]
549[Add a install/upgrade --preference='foo < 2' flag
550Duncan Coutts <duncan@haskell.org>**20081218213849
551 This behaves just like the preferred-versions file in the hackage index
552 but it can be specified on the command line or in a config file.
553]
554[Generalise the way preferences are specified to the resolver
555Duncan Coutts <duncan@haskell.org>**20081218204917
556 We still provide a default global policy, but now we give a
557 list of per-package preferences which can be on the version
558 or installed state. Later preferences override earlier ones.
559]
560[Workaround for a url parsing bug that breaks http proxies that need auth
561Duncan Coutts <duncan@haskell.org>**20081218165541
562 Diagnosis and patch from Valery V. Vorotyntsev.
563]
564[Implement cabal install --constraint=
565Duncan Coutts <duncan@haskell.org>**20081216235032
566 Connect up the existing user interface with the new dep resolver api.
567]
568[Have the dep resolver take constraints and targets separately
569Duncan Coutts <duncan@haskell.org>**20081216233446]
570[Add PackageInstalledConstraint to the PackageConstraint type
571Duncan Coutts <duncan@haskell.org>**20081215224538
572 This should be useful for things like preventing upgrading
573 the base package for ghc.
574]
575[A bit more renaming in the top down resolver
576Duncan Coutts <duncan@haskell.org>**20081215224324]
577[Take preferences into account in the bogus resolver
578Duncan Coutts <duncan@haskell.org>**20081215221728]
579[Mostly renaming and trivial refactoring
580Duncan Coutts <duncan@haskell.org>**20081215221034]
581[Change the dep resolver interface to pass constraints separately from targets
582Duncan Coutts <duncan@haskell.org>**20081215215634
583 This lets us specify constraints for packages that are not targets.
584]
585[Rename and rearrange the PackagePreferences type
586Duncan Coutts <duncan@haskell.org>**20081215204836]
587[Don't re-export PackageName from Distribution.Client.Dependency
588Duncan Coutts <duncan@haskell.org>**20081215203617
589 It used to be a type alias.
590]
591[Use the Platform type rather than passing around the OS and Arch separately
592Duncan Coutts <duncan@haskell.org>**20081215202856]
593[Bump version to 0.6.1
594Duncan Coutts <duncan@haskell.org>**20081210224713]
595[Tidy up the unpack code
596Duncan Coutts <duncan@haskell.org>**20081210223633
597 Also fix a bug for tar files that contain entries for files
598 without preceding entries for the directories they are in.
599]
600[Clean up the code in Main
601Duncan Coutts <duncan@haskell.org>**20081210223242
602 Make the names more regular and set up the various flags
603 in a more regular way.
604]
605[Use (\_ -> []) instead of mempty to avoid funky Monoid instance
606Duncan Coutts <duncan@haskell.org>**20081210223106
607 This would let us build with ghc-6.4 or nhc if it were not for other issues.
608]
609[Fix warning aobut -fffi in OPTIONS pragma
610Duncan Coutts <duncan@haskell.org>**20081203005449]
611[Mention where files get downloaded to at verbosity level verbose
612Duncan Coutts <duncan@haskell.org>**20081203004427]
613[Implement 'cabal unpack' command as in #390
614Andrea Vezzosi <sanzhiyan@gmail.com>**20081113185923]
615[Remove use of tabs
616Duncan Coutts <duncan@haskell.org>**20081122163527]
617[Put explicit lower bound on version of base
618Duncan Coutts <duncan@haskell.org>**20081122163151
619 It does not build with ghc-6.4.2, missing Functor instance for Either.
620]
621[Use a more general fix for "cabal install base"
622Duncan Coutts <duncan@haskell.org>**20081122163026
623 It's not specific to LHC. Normally we prevent upgrading of base
624 since it's unlikely to work and would normally be accidental.
625 However when the user explicitly asks to upgrade base then we
626 let them do that and they can keep the pieces when it breaks.
627]
628[Warn about use of tabs
629Duncan Coutts <duncan@haskell.org>**20081122154309]
630[Only send the base file name when uploading tarballs
631Duncan Coutts <duncan@haskell.org>**20080903230334
632 The server should ignore the dir part anyway but there's no
633 need to send it in the first place.
634]
635[Slightly better lhc support.
636Lemmih <lemmih@gmail.com>**20081121034338
637 Ignore-this: 9f51f465aa87d1c6677ca492f877ecd6
638]
639[TAG 0.6.0
640Duncan Coutts <duncan@haskell.org>**20081011195420]
641[Bump version to 0.6.0
642Duncan Coutts <duncan@haskell.org>**20081011195314]
643[Improve the README, better install instructions
644Duncan Coutts <duncan@haskell.org>**20081011185919
645 And slightly better intro guide to the main commands.
646]
647[Bump versions of deps in the bootstrap script
648Duncan Coutts <duncan@haskell.org>**20081011184937]
649[Add Eq for a couple types in the anon build reports
650Duncan Coutts <duncan@haskell.org>**20081011184825]
651[Drop silly export
652Duncan Coutts <duncan@haskell.org>**20081011184805]
653[Apparnetly builds with unix-2.0 which is what came with ghc-6.6
654Duncan Coutts <duncan@haskell.org>**20081010234836]
655[Fix the -i dir for compiling Setup.hs when it's the current dir
656Duncan Coutts <duncan@haskell.org>**20081010234558
657 map "" to "."
658]
659[Tidy up the preferred-versions file parser
660Duncan Coutts <duncan@haskell.org>**20081010070105]
661[Bump version number and dependencies
662Duncan Coutts <duncan@haskell.org>**20081010065854]
663[Relax deps to build with ghc-6.10
664Duncan Coutts <duncan@haskell.org>**20081007230701]
665[Handle build reports with missing logs better
666Duncan Coutts <duncan@haskell.org>**20081007230635]
667[Add DownloadFailed as a possible failure for installation
668Duncan Coutts <duncan@haskell.org>**20081007230418
669 Should now be caught during installing a bunch of packages
670 and not cause immediate overall failure. It should instead
671 be treated like any other package build failure and be
672 reported at the end and only affect other dependent builds.
673]
674[Fix search paths for compiling Setup.hs scrips
675Duncan Coutts <duncan@haskell.org>**20081007213630
676 and in particular for bootstrapping the Cabal lib.
677]
678[Fix selecting paired packages
679Duncan Coutts <duncan@haskell.org>**20081007062930
680 Previously when we selected base 4 (and as a consequence
681 slected base 3 too) we didn't properly trace the dependencies
682 of base 3 so if nothing actually required base 3 then we ended
683 up with base 3 in the solution but not with syb which it
684 depends on. Consequently the solution was invalid.
685 Now we select the paired package properly (hopefully).
686]
687[Take preferred versions into account in dependency planning
688Duncan Coutts <duncan@haskell.org>**20081006055129
689 This means we can now globally prefer base 3 rather than 4.
690 However we need to be slightly careful or we end up deciding
691 to do silly things like rebuild haskell98 against base 3.
692 That would happen because the h98 package doesn't constrain
693 the choice to one or the other and we would prefer base 3.
694 So we have to add that we really prefer whatever it uses
695 currently (if any).
696]
697[Pass the package suggested version constraints through to the resolver
698Duncan Coutts <duncan@haskell.org>**20081006042758
699 Not used yet.
700]
701[Fix selection of paired packages
702Duncan Coutts <duncan@haskell.org>**20081006040616]
703[Read preferred versions from the package index
704Duncan Coutts <duncan@haskell.org>**20081006030259
705 From a file named 'preferred-versions' in the 00-index.tar.gz
706 If there are several they are combined. Contents is like:
707 base < 4
708 one suggested version constraint per line.
709]
710[Refactor and update the hackage index reading code
711Duncan Coutts <duncan@haskell.org>**20081005202747]
712[Print more details about what is to be installed with -v
713Duncan Coutts <duncan@haskell.org>**20081005075556
714 Reports if installs are new or reinstalls and for reinstalls
715 prints what dependencies have changed.
716]
717[When finalising paired packages, cope with there being multiple choices
718Duncan Coutts <duncan@haskell.org>**20081005053821
719 For ordinary packages we selected a single version which means
720  we added an equality constraint. As a consequence we used to
721 assume there was only one version left when finalising. For
722 paired packages there may be two versions left if the package
723 did not directly constrain the choice to just one. If there is
724 more than one version remaining then we have to pick between
725 them. At the moment we still pick the highest version, but
726 later we can take a global preference or polciy into account.
727]
728[When selecting paired packages, select both.
729Duncan Coutts <duncan@haskell.org>**20081005053804]
730[Handle constraints on paired packages
731Duncan Coutts <duncan@haskell.org>**20081005051919
732 The trick is that when applying constraints to paired
733 packages, the constraint has to exclude both packages at
734 once. We exclude the pair together or not at all. If it
735 would only exclude one then we discard the constraint.
736]
737[Add the notion of paired packages to the Constraints ADT
738Duncan Coutts <duncan@haskell.org>**20081005013141
739 Packages like base-3 and base-4 are paired. This means they are
740 supposed to be treated equivalently in some contexts. Paired
741 packages are installed packages with the same name where one
742 version depends on the other.
743]
744[Make InstalledPackage an instance of PackageFixedDeps
745Duncan Coutts <duncan@haskell.org>**20081005012741]
746[Add the glue code to actully report excluded packages
747Duncan Coutts <duncan@haskell.org>**20081005001400
748 Now displayed in the output of install --dry-run -v
749]
750[Have Constraints.constrain report the excluded packages
751Duncan Coutts <duncan@haskell.org>**20081004235006
752 Each time we apply a constraint we can end up excluding some
753 extra package. Report that list of packages because it is
754 quite interesting information to get insight into what the
755 resolver is actually doing.
756]
757[Separate the construction of the exclusion list from its use
758Duncan Coutts <duncan@haskell.org>**20081004234421
759 Previously directly inserted packages into the excluded package
760 list. Now we generate a list of them and then add them. We want
761 the list of newly excluded packages separately because it is
762 interesting information to report to the user when -v is on.
763]
764[Generalise the logging of selected and discarded packages
765Duncan Coutts <duncan@haskell.org>**20081004232555
766 Allow for selecting several packages in one go.
767 Currently when we select a package we only list the over versions
768 of the same package that that excludes, and not the other packages
769 we exclude by applying the dependency constraints of the selected
770 package. In future we would like to do that so we now report the
771 package name of discards not just the version. Though we do group
772 by the package name to avoid too much repition.
773]
774[Fix infinite loop in the TopDown dependency resolver
775Andrea Vezzosi <sanzhiyan@gmail.com>**20080925181441
776 The loop occurred only if a package depended on another one
777 with the same name, e.g. base-3.0.3.0 <- base-4.0.0.0
778]
779[small improvements to bootstrap
780Duncan Coutts <duncan@haskell.org>**20080926214828
781 patch sent in by brian0, ticket #357
782]
783[Update to the development version of the Cabal lib
784Duncan Coutts <duncan@haskell.org>**20080831225243
785 The branch of cabal-install that tracks Cabal-1.4 now lives at
786 http://darcs.haskell.org/cabal-branches/cabal-install-0.5/
787]
788[Allow use of curl in bootstrap.sh
789Duncan Coutts <duncan@haskell.org>**20080826233400
790 Patch from jsnx. Fixes ticket #343. Also, use "cd blah; cd .."
791 instead of "pushd blah; popd" as some shells lack pushd/popd
792]
793[Relax version constraint on unix package
794Duncan Coutts <duncan@haskell.org>**20080826232851
795 Allows building with ghc-6.6.1
796]
797[Use mplus not mappend for combining tar filename checks
798Duncan Coutts <duncan@haskell.org>**20080826232606
799 mappend would join the error messages in the case that both
800 checks failed. Also the monoid instance was new in base 3.
801]
802[TAG 0.5.2
803Duncan Coutts <duncan@haskell.org>**20080826214238]
804Patch bundle hash:
80593232bfbc76237144cc754fc3cc9924aef1fe271