You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
3.8KB

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