Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

catalog.rst 3.8KB

5 år sedan
5 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. The Package Catalog
  2. ###################
  3. ``dds`` stores a catalog of available packages, along with their dependency
  4. statements and information about how a source distribution thereof may be
  5. maintained.
  6. Viewing Catalog Contents
  7. ************************
  8. The default catalog database is stored in a user-local location, and the
  9. package IDs available can be listed with ``dds catalog list``. This will only
  10. list the IDs of the packages, but none of the additional metadata about them.
  11. Adding Packages to the Catalog
  12. ******************************
  13. There are two primary ways to add entries to the package catalog.
  14. Adding Individual Packages
  15. ==========================
  16. A single package can be added to the catalog with the ``dds catalog add``
  17. command:
  18. .. code-block:: text
  19. dds catalog add <package-id>
  20. [--depends <requirement> [--depends <requirement> [...]]]
  21. [--git-url <url>]
  22. [--git-ref <ref>]
  23. [--auto-lib <Namespace>/<Name>]
  24. The ``<package-id>`` positional arguments is the ``name@version`` package ID
  25. that will be added to the catalog. The following options are supported:
  26. ``--depends <requirement>``
  27. This argument, which can be specified multiple times to represent multiple
  28. dependencies, sets the dependencies of the package within the catalog. If
  29. the obtained package root contains a ``package.dds``, then the dependencies
  30. listed here must be identical to those listed in ``package.dds``, or
  31. dependency resolution may yield unexpected results.
  32. ``--git-url <url>``
  33. Specify a Git URL to clone from to obtain the package. The root of the
  34. cloned repository must be a package root, but does not necessarily need to
  35. have the ``package.dds`` and ``library.dds`` files if relying on the
  36. ``--auto-lib`` parameter.
  37. ``--git-ref`` **must** be passed with ``--git-url``.
  38. ``--git-ref <ref>``
  39. Specify a Git ref to clone. The remote must support cloning by the ref that
  40. is specified here. Most usually this should be a Git tag.
  41. ``dds`` will perform a shallow clone of the package at the specified
  42. Git reference.
  43. ``--auto-lib``
  44. This option must be provided if the upstream does not already contain the
  45. ``dds`` files that are necessary to export the library information. This
  46. can only be specified for packages that contain a single library root at
  47. the package root.
  48. The form of the argument is that of ``<Namespapce>/<Name>``, where
  49. ``Namespace`` and ``Name`` are the usage requirement keys that should be
  50. generated for the library.
  51. Bulk Imports via JSON
  52. =====================
  53. The ``dds catalog import`` supports a ``--json`` flag that specifies a JSON
  54. file from which catalog entries will be generated.
  55. .. note::
  56. The ``--json`` flag can be passed more than once to import multiple JSON
  57. files at once.
  58. The JSON file has the following structure:
  59. .. code-block:: javascript
  60. {
  61. // Import version spec.
  62. "version": 1,
  63. // Packages section
  64. "packages": {
  65. // Subkeys are package names
  66. "acme-gadgets": {
  67. // Keys within the package names are the versions that are
  68. // available for each package.
  69. "0.4.2": {
  70. // `depends` is an object of dependencies for this
  71. // particular version of the package.
  72. "depends": {
  73. // A mapping of package names to version ranges
  74. "acme-widgets": "^1.4.1"
  75. },
  76. // Specify the Git remote information
  77. "git": {
  78. // `url` and `ref` are required.
  79. "url": "http://example.com/git/repo/acme-gadgets.git",
  80. "ref": "v0.4.2-stable",
  81. // The `auto-lib` is optional, to specify an automatic
  82. // library name/namespace pair to generate for the
  83. // root library
  84. "auto-lib": "Acme/Gadgets"
  85. }
  86. }
  87. }
  88. }
  89. }