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