@@ -398,31 +398,46 @@ Check ``cabal fetch --help`` for a complete list of options.
398
398
cabal get
399
399
^^^^^^^^^
400
400
401
- ``cabal get [PACKAGES] `` (synonym: ``cabal unpack ``) downloads and unpacks
401
+ ``cabal get [FLAGS] [ PACKAGES] `` (synonym: ``cabal unpack ``) downloads and unpacks
402
402
the source code of ``PACKAGES `` locally. By default the content of the
403
403
packages is unpacked in the current working directory, in named subfolders
404
404
(e.g. ``./filepath-1.2.0.8/ ``), use ``--destdir=PATH `` to specify another
405
405
folder. By default the latest version of the package is downloaded, you can
406
406
ask for a spefic one by adding version numbers
407
407
(``cabal get random-1.0.0.1 ``).
408
408
409
+ The ``cabal get `` command supports the following options:
410
+
409
411
.. option :: -s[[head|this|...]] , --source-repository[=[head|this|...]]
410
412
411
- Clone the package's source repository (Darcs, Git, etc.) instead
412
- of downloading the tarball. Only works if the package specifies
413
- a ``source-repository ``.
413
+ Clone the package's source repository (Darcs, Git, etc.)
414
+ instead of downloading the tarball. Only works if the
415
+ package specifies a ``source-repository ``.
414
416
415
417
.. option :: --index-state=STATE
416
418
417
419
Pin your request to a specific Hackage index state. Available
418
420
``STATE `` formats: Unix timestamps (e.g. ``@1474732068 ``),
419
421
ISO8601 UTC timestamps (e.g. ``2016-09-24T17:47:48Z ``), or ``HEAD ``
420
422
(default).
423
+ This determines which package versions are available as well as which
424
+ ``.cabal `` file revision is selected (unless ``--pristine `` is used).
421
425
422
426
.. option :: --pristine
423
427
424
428
Unpacks the pristine tarball, i.e. disregarding any Hackage revision.
425
429
430
+ .. option :: -d , --destdir=PATH
431
+
432
+ Where to place the package source, defaults to (a subdirectory of)
433
+ the current directory.
434
+
435
+ .. option :: --only-package-description , --package-description-only
436
+
437
+ Unpack the original pristine tarball, rather than updating the
438
+ ``.cabal `` file with the latest revision from the package archive.
439
+
440
+
426
441
.. _command-group-config :
427
442
428
443
Project configuration
@@ -478,6 +493,12 @@ flag.
478
493
cabal freeze
479
494
^^^^^^^^^^^^
480
495
496
+ If a package is built in several different environments, such as a
497
+ development environment, a staging environment and a production
498
+ environment, it may be necessary or desirable to ensure that the same
499
+ dependency versions are selected in each environment. This can be done
500
+ with the ``freeze `` command:
501
+
481
502
``cabal freeze `` writes out a **freeze file ** which records all of
482
503
the versions and flags that are picked by the solver under the
483
504
current index and flags. Default name of this file is
@@ -511,15 +532,88 @@ cabal gen-bounds
511
532
``cabal gen-bounds [FLAGS] `` generates bounds for all dependencies that do not
512
533
currently have them. Generated bounds are printed to stdout. You can then
513
534
paste them into your .cabal file.
535
+ The generated bounds conform to the `Package Versioning Policy `_, which is
536
+ a recommended versioning system for publicly released Cabal packages.
537
+
538
+ .. code-block :: console
539
+
540
+ $ cabal gen-bounds
541
+
542
+ For example, given the following dependencies without bounds specified in
543
+ :pkg-field: `build-depends `:
544
+
545
+ ::
546
+
547
+ build-depends:
548
+ base,
549
+ mtl,
550
+ transformers,
551
+
552
+ ``gen-bounds `` might suggest changing them to the following:
553
+
554
+ ::
555
+
556
+ build-depends:
557
+ base >= 4.15.0 && < 4.16,
558
+ mtl >= 2.2.2 && < 2.3,
559
+ transformers >= 0.5.6 && < 0.6,
514
560
515
- See `the section on generating dependency version bounds <cabal-package.html#generating-dependency-version-bounds >`__ for more details and examples.
516
561
517
562
cabal outdated
518
563
^^^^^^^^^^^^^^
519
564
520
565
``cabal outdated [FLAGS] `` checks for outdated dependencies in the package
521
566
description file or freeze file.
522
567
568
+ Manually updating dependency version bounds in a ``.cabal `` file or a
569
+ freeze file can be tedious, especially when there's a lot of
570
+ dependencies. The ``cabal outdated `` command is designed to help with
571
+ that. It will print a list of packages for which there is a new
572
+ version on Hackage that is outside the version bound specified in the
573
+ ``build-depends `` field. The ``outdated `` command can also be
574
+ configured to act on the freeze file and
575
+ ignore major (or all) version bumps on Hackage for a subset of
576
+ dependencies.
577
+
578
+ Examples:
579
+
580
+ .. code-block :: console
581
+
582
+ $ cd /some/package
583
+ $ cabal outdated
584
+ Outdated dependencies:
585
+ haskell-src-exts <1.17 (latest: 1.19.1)
586
+ language-javascript <0.6 (latest: 0.6.0.9)
587
+ unix ==2.7.2.0 (latest: 2.7.2.1)
588
+
589
+ $ cabal outdated --simple-output
590
+ haskell-src-exts
591
+ language-javascript
592
+ unix
593
+
594
+ $ cabal outdated --ignore=haskell-src-exts
595
+ Outdated dependencies:
596
+ language-javascript <0.6 (latest: 0.6.0.9)
597
+ unix ==2.7.2.0 (latest: 2.7.2.1)
598
+
599
+ $ cabal outdated --ignore=haskell-src-exts,language-javascript,unix
600
+ All dependencies are up to date.
601
+
602
+ $ cabal outdated --ignore=haskell-src-exts,language-javascript,unix -q
603
+ $ echo $?
604
+ 0
605
+
606
+ $ cd /some/other/package
607
+ $ cabal outdated --freeze-file
608
+ Outdated dependencies:
609
+ HTTP ==4000.3.3 (latest: 4000.3.4)
610
+ HUnit ==1.3.1.1 (latest: 1.5.0.0)
611
+
612
+ $ cabal outdated --freeze-file --ignore=HTTP --minor=HUnit
613
+ Outdated dependencies:
614
+ HUnit ==1.3.1.1 (latest: 1.3.1.2)
615
+
616
+
523
617
``cabal outdated `` supports the following flags:
524
618
525
619
.. option :: --freeze-file
@@ -575,8 +669,6 @@ description file or freeze file.
575
669
be used without arguments, in that case major version bumps are ignored for
576
670
all packages.
577
671
578
- See `the section on listing outdated dependency version bounds <cabal-package.html#listing-outdated-dependency-version-bounds >`__ for more details and examples.
579
-
580
672
.. _command-group-build :
581
673
582
674
Project building and installing
@@ -1157,3 +1249,5 @@ cabal report
1157
1249
.. option :: -p PASSWORD or -pPASSWORD , --password=PASSWORD
1158
1250
1159
1251
Your Hackage password.
1252
+
1253
+ .. include :: references.inc
0 commit comments