|
| 1 | +# Command-Line Interface |
| 2 | + |
| 3 | +## General |
| 4 | + |
| 5 | +The `repopulator` module provides a simple command-line interface to create repositories. |
| 6 | + |
| 7 | +You can invoke the command-line either via a script |
| 8 | +```bash |
| 9 | +$ repopulator |
| 10 | +``` |
| 11 | +or as a module |
| 12 | +```bash |
| 13 | +$ python3 -m repopulator |
| 14 | +``` |
| 15 | + |
| 16 | +The general form of the command line is: |
| 17 | + |
| 18 | +```bash |
| 19 | +$ repopulator TYPE -o DEST [options...] -p package1 package2 .... |
| 20 | +``` |
| 21 | + |
| 22 | +where `TYPE` is one of: `alpine`, `apt`, `freebsd`, `pacman`, `rpm` and `DEST` is the destination directory for the repository. |
| 23 | + |
| 24 | +You can obtain overall help by using |
| 25 | +```bash |
| 26 | +$ repopulator -h/--help |
| 27 | +``` |
| 28 | + |
| 29 | +and a help about available options for each repository via: |
| 30 | +```bash |
| 31 | +$ repopulator TYPE -h/--help |
| 32 | +``` |
| 33 | + |
| 34 | +Options and their effect for each repository type are described below |
| 35 | + |
| 36 | +## Alpine |
| 37 | + |
| 38 | +The general command-line form for Alpine pkg repository is: |
| 39 | + |
| 40 | +```bash |
| 41 | +$ repopulator alpine -o DEST -d DESC -k KEY_PATH [-w KEY_PASSWORD] [-s SIGNER] \ |
| 42 | + -p package1 package2 ... \ |
| 43 | + -a ARCH1 -p package3 package4 ... \ |
| 44 | + -a ARCH2 -p package5 package6 ... |
| 45 | + |
| 46 | +``` |
| 47 | + |
| 48 | +Where: |
| 49 | + |
| 50 | +`-d DESC`, `--desc DESC` |
| 51 | +: The repository description |
| 52 | + |
| 53 | +`-k KEY_PATH`, `--key KEY_PATH` |
| 54 | +: The path to private key for signing. If `-s/--signer` option is not supplied the stem of the private key filename is used as the name. So for example a key `[email protected]` will result in `[email protected]` being used as a signer name. |
| 55 | + |
| 56 | +`-w KEY_PASSWORD`, `--password KEY_PASSWORD` |
| 57 | +: The password for the private key, if needed |
| 58 | + |
| 59 | +`-s SIGNER`, `--signer SIGNER` |
| 60 | +: The signer name that overrides automatic deduction from the key filename described above |
| 61 | + |
| 62 | +`-a ARCH`, `--arch ARCH` |
| 63 | +: Forces the architecture of the _following_ packages to be `ARCH`. |
| 64 | + |
| 65 | +`-p path ...`, `--package path...` |
| 66 | +: `.apk` packages to add |
| 67 | + |
| 68 | +By default, internal architecture of the package is used to decide under which architecture to register it in the repo. |
| 69 | +Some packages (such as `-doc-`, `-openrc-` etc.) do not have specific architecture and are marked as `noarch`. All Alpine packages in a repo must belong to some architecture so you need to use `-a ARCH` with them. |
| 70 | + |
| 71 | +If you wish to "stop" the latest `-a ARCH` effect and revert to using architecture of the package use `-a` without an argument. |
| 72 | + |
| 73 | +## APT |
| 74 | + |
| 75 | +The general command-line form for APT repository is: |
| 76 | + |
| 77 | +```bash |
| 78 | +$ repopulator apt -o DEST -k KEY_NAME -w KEY_PASSWORD \ |
| 79 | + -d DISTRO1 \ |
| 80 | + [--origin ORIGIN] [--label LABEL] [--suite SUITE] \ |
| 81 | + [--codename CODENAME] [--version VERSION] [--desc DESC] \ |
| 82 | + [-c COMPONENT1] \ |
| 83 | + -p package1 package2 ... \ |
| 84 | + [-c COMPONENT2] \ |
| 85 | + -p package3 package4 ... \ |
| 86 | + -d DISTRO2 \ |
| 87 | + ... |
| 88 | +``` |
| 89 | + |
| 90 | +Where: |
| 91 | + |
| 92 | +`-k KEY_NAME`, `--key KEY_NAME` |
| 93 | +: Name or ID of the GPG key for signing |
| 94 | + |
| 95 | +`-w KEY_PASSWORD`, `--password KEY_PASSWORD` |
| 96 | +: GPG key password |
| 97 | + |
| 98 | +`-d DISTRO`, `--distro DISTRO` |
| 99 | +: Starts a new distribution named `DISTRO` (e.g. `jammy` or `focal`). All subsequent arguments refer to this distribution until the next `-d/--distro` argument. The distribution name can be a path like `stable/updates` |
| 100 | + |
| 101 | +`--origin ORIGIN` |
| 102 | +: Optional `Origin` field for the distribution. See https://wiki.debian.org/DebianRepository/Format#Origin |
| 103 | + |
| 104 | +`--label LABEL` |
| 105 | +: Optional `Label` field for the distribution. See https://wiki.debian.org/DebianRepository/Format#Label |
| 106 | + |
| 107 | +`--suite SUITE` |
| 108 | +: Optional `Suite` field for the distribution. See https://wiki.debian.org/DebianRepository/Format#Suite. If omitted defaults to the last component of distribution path. |
| 109 | + |
| 110 | +`--codename CODENAME` |
| 111 | +: Optional `Codename` field for the distribution. See https://wiki.debian.org/DebianRepository/Format#Codename. If omitted defaults to the last component of distribution path. |
| 112 | + |
| 113 | +`--version VERSION` |
| 114 | +: Optional `Version` field for the distribution. See https://wiki.debian.org/DebianRepository/Format#Version. If omitted defaults to the last component of distribution path. |
| 115 | + |
| 116 | +`--desc DESC` |
| 117 | +: Optional `Description` field for the distribution. See https://wiki.debian.org/DebianRepository/Format#Description. If omitted defaults to the last component of distribution path. |
| 118 | + |
| 119 | +`-c COMPONENT`, `--comp COMPONENT` |
| 120 | +: Optional component of the _following_ packages. If not specified or component name is omitted defaults to `main`. You can specify multiple components for a distribution. |
| 121 | + |
| 122 | +`-p path ...`, `--package path...` |
| 123 | +: `.deb` (or `.udeb`) packages to add to the current distribution and component |
| 124 | + |
| 125 | +## FreeBSD |
| 126 | + |
| 127 | +The general command-line form for FreeBSD repository is: |
| 128 | + |
| 129 | +```bash |
| 130 | +$ repopulator freebsd -o DEST -k KEY_PATH [-w KEY_PASSWORD] \ |
| 131 | + -p package1 package2 ... |
| 132 | +``` |
| 133 | + |
| 134 | +Where: |
| 135 | + |
| 136 | +`-k KEY_PATH`, `--key KEY_PATH` |
| 137 | +: The path to private key for signing. |
| 138 | + |
| 139 | +`-w KEY_PASSWORD`, `--password KEY_PASSWORD` |
| 140 | +: The password for the private key, if needed |
| 141 | + |
| 142 | +`-p path ...`, `--package path...` |
| 143 | +: `.pkg` packages to add |
| 144 | + |
| 145 | + |
| 146 | +## Pacman |
| 147 | + |
| 148 | +The general command-line form for Pacman repository is: |
| 149 | + |
| 150 | +```bash |
| 151 | +$ repopulator pacman -o DEST -k KEY_NAME -w KEY_PASSWORD \ |
| 152 | + -n name -p package1 package2 ... |
| 153 | +``` |
| 154 | + |
| 155 | +Where: |
| 156 | + |
| 157 | +`-k KEY_NAME`, `--key KEY_NAME` |
| 158 | +: Name or ID of the GPG key for signing |
| 159 | + |
| 160 | +`-w KEY_PASSWORD`, `--password KEY_PASSWORD` |
| 161 | +: GPG key password |
| 162 | + |
| 163 | +`-n NAME`, `--name NAME` |
| 164 | +: Repository name |
| 165 | + |
| 166 | +`-p path ...`, `--package path...` |
| 167 | +: `.zst` packages to add. If a matching .sig file with the same name exists next to the package, it will be automatically used to supply the package signature |
| 168 | + |
| 169 | +## RPM |
| 170 | + |
| 171 | +The general command-line form for Pacman repository is: |
| 172 | + |
| 173 | +```bash |
| 174 | +$ repopulator rpm -o DEST -k KEY_NAME -w KEY_PASSWORD \ |
| 175 | + -p package1 package2 ... |
| 176 | +``` |
| 177 | + |
| 178 | +Where: |
| 179 | + |
| 180 | +`-k KEY_NAME`, `--key KEY_NAME` |
| 181 | +: Name or ID of the GPG key for signing |
| 182 | + |
| 183 | +`-w KEY_PASSWORD`, `--password KEY_PASSWORD` |
| 184 | +: GPG key password |
| 185 | + |
| 186 | +`-p path ...`, `--package path...` |
| 187 | +: `.rpm` packages to add. |
0 commit comments