Matthias Andreas Benkard | a1e8443 | 2023-12-05 21:12:16 +0100 | [diff] [blame] | 1 | // SPDX-FileCopyrightText: © 2023 Matthias Andreas Benkard <code@mail.matthias.benkard.de> |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 4 | |
Matthias Andreas Benkard | 15456c8 | 2024-07-20 10:52:54 +0200 | [diff] [blame] | 5 | import org.jspecify.annotations.NullMarked; |
| 6 | |
Matthias Andreas Benkard | 716fc32 | 2023-12-12 19:13:01 +0100 | [diff] [blame] | 7 | /** |
| 8 | * The {@code jgvariant} command line tool. |
| 9 | * |
Matthias Andreas Benkard | 6146428 | 2024-03-02 13:50:21 +0100 | [diff] [blame] | 10 | * <p>The {@link eu.mulk.jgvariant.tool} module contains a tool called {@code jgvariant} that can be |
| 11 | * used to manipulate GVariant-formatted files from the command line. Its primary purpose is to |
| 12 | * enable the scripting of OSTree repository management tasks. |
Matthias Andreas Benkard | 716fc32 | 2023-12-12 19:13:01 +0100 | [diff] [blame] | 13 | * |
Matthias Andreas Benkard | 6146428 | 2024-03-02 13:50:21 +0100 | [diff] [blame] | 14 | * <p>The {@link eu.mulk.jgvariant.tool.Main} class defines the entry point of the tool. |
Matthias Andreas Benkard | 716fc32 | 2023-12-12 19:13:01 +0100 | [diff] [blame] | 15 | * |
Matthias Andreas Benkard | 8e5f1f5 | 2024-03-02 14:54:34 +0100 | [diff] [blame] | 16 | * <h2>Usage Examples</h2> |
| 17 | * |
| 18 | * <h3>Dumping the contents of an OSTree summary file</h3> |
Matthias Andreas Benkard | 716fc32 | 2023-12-12 19:13:01 +0100 | [diff] [blame] | 19 | * |
| 20 | * {@snippet lang="sh" : |
| 21 | * $ jgvariant ostree summary read ./jgvariant-ostree/src/test/resources/ostree/summary |
| 22 | * } |
| 23 | * |
| 24 | * <p>Output: |
| 25 | * |
| 26 | * {@snippet lang="json" : |
| 27 | * { |
| 28 | * "entries": [ |
| 29 | * { |
| 30 | * "ref": "mulkos/1.x/amd64", |
| 31 | * "value": { |
| 32 | * "checksum": "66ff167ff35ce87daac817447a9490a262ee75f095f017716a6eb1a9d9eb3350", |
| 33 | * "metadata": { |
| 34 | * "fields": { |
| 35 | * "ostree.commit.timestamp": 1640537170 |
| 36 | * } |
| 37 | * }, |
| 38 | * "size": 214 |
| 39 | * } |
| 40 | * } |
| 41 | * ], |
| 42 | * "metadata": { |
| 43 | * "fields": { |
| 44 | * "ostree.summary.last-modified": 1640537300, |
| 45 | * "ostree.summary.tombstone-commits": false, |
| 46 | * "ostree.static-deltas": { |
| 47 | * "3d3b3329dca38871f29aeda1bf5854d76c707fa269759a899d0985c91815fe6f-66ff167ff35ce87daac817447a9490a262ee75f095f017716a6eb1a9d9eb3350": "03738040e28e7662e9c9d2599c530ea974e642c9f87e6c00cbaa39a0cdac8d44", |
| 48 | * "31c8835d5c9d2c6687a50091c85142d1b2d853ff416a9fb81b4ee30754510d52": "f481144629474bd88c106e45ac405ebd75b324b0655af1aec14b31786ae1fd61", |
| 49 | * "31c8835d5c9d2c6687a50091c85142d1b2d853ff416a9fb81b4ee30754510d52-3d3b3329dca38871f29aeda1bf5854d76c707fa269759a899d0985c91815fe6f": "2c6a07bc1cf4d7ce7d00f82d7d2d6d156fd0e31d476851b46dc2306b181b064a" |
| 50 | * }, |
| 51 | * "ostree.summary.mode": "bare", |
| 52 | * "ostree.summary.indexed-deltas": true |
| 53 | * } |
| 54 | * } |
| 55 | * } |
| 56 | * } |
Matthias Andreas Benkard | 8e5f1f5 | 2024-03-02 14:54:34 +0100 | [diff] [blame] | 57 | * |
| 58 | * <h3>Adding a static delta to an OSTree summary file</h3> |
| 59 | * |
Matthias Andreas Benkard | 7cce4ea | 2024-03-02 21:21:51 +0100 | [diff] [blame] | 60 | * <p>Superblock checksum <code>0...</code>, between commits <code>3...</code> and <code>6... |
Matthias Andreas Benkard | 8e5f1f5 | 2024-03-02 14:54:34 +0100 | [diff] [blame] | 61 | * </code>: |
| 62 | * |
| 63 | * {@snippet lang="sh" : |
Matthias Andreas Benkard | 7cce4ea | 2024-03-02 21:21:51 +0100 | [diff] [blame] | 64 | * $ jgvariant ostree summary add-static-delta ./jgvariant-ostree/src/test/resources/ostree/summary 03738040e28e7662e9c9d2599c530ea974e642c9f87e6c00cbaa39a0cdac8d44 66ff167ff35ce87daac817447a9490a262ee75f095f017716a6eb1a9d9eb3350 3d3b3329dca38871f29aeda1bf5854d76c707fa269759a899d0985c91815fe6f |
Matthias Andreas Benkard | 8e5f1f5 | 2024-03-02 14:54:34 +0100 | [diff] [blame] | 65 | * } |
| 66 | * |
Matthias Andreas Benkard | 7cce4ea | 2024-03-02 21:21:51 +0100 | [diff] [blame] | 67 | * <p>Superblock checksum <code>f...</code>, between the empty commit and <code>3...</code>: |
Matthias Andreas Benkard | 8e5f1f5 | 2024-03-02 14:54:34 +0100 | [diff] [blame] | 68 | * |
| 69 | * {@snippet lang="sh" : |
Matthias Andreas Benkard | 7cce4ea | 2024-03-02 21:21:51 +0100 | [diff] [blame] | 70 | * $ jgvariant ostree summary add-static-delta ./jgvariant-ostree/src/test/resources/ostree/summary f481144629474bd88c106e45ac405ebd75b324b0655af1aec14b31786ae1fd61 31c8835d5c9d2c6687a50091c85142d1b2d853ff416a9fb81b4ee30754510d52 |
Matthias Andreas Benkard | 8e5f1f5 | 2024-03-02 14:54:34 +0100 | [diff] [blame] | 71 | * } |
Matthias Andreas Benkard | 716fc32 | 2023-12-12 19:13:01 +0100 | [diff] [blame] | 72 | */ |
Matthias Andreas Benkard | 15456c8 | 2024-07-20 10:52:54 +0200 | [diff] [blame] | 73 | @NullMarked |
Matthias Andreas Benkard | ec2c34a | 2024-03-02 13:48:04 +0100 | [diff] [blame] | 74 | module eu.mulk.jgvariant.tool { |
Matthias Andreas Benkard | a1e8443 | 2023-12-05 21:12:16 +0100 | [diff] [blame] | 75 | requires transitive eu.mulk.jgvariant.ostree; |
Matthias Andreas Benkard | a1e8443 | 2023-12-05 21:12:16 +0100 | [diff] [blame] | 76 | requires info.picocli; |
| 77 | requires jakarta.json; |
| 78 | requires jakarta.json.bind; |
| 79 | requires java.logging; |
| 80 | requires static com.google.errorprone.annotations; |
| 81 | requires static org.apiguardian.api; |
Matthias Andreas Benkard | 15456c8 | 2024-07-20 10:52:54 +0200 | [diff] [blame] | 82 | requires static org.jspecify; |
Matthias Andreas Benkard | a1e8443 | 2023-12-05 21:12:16 +0100 | [diff] [blame] | 83 | |
| 84 | opens eu.mulk.jgvariant.tool to |
| 85 | info.picocli; |
| 86 | |
| 87 | exports eu.mulk.jgvariant.tool; |
| 88 | } |