16 Commits

Author SHA1 Message Date
8381514640 Update changelog for 3.0.1-2 release 2025-11-13 22:07:40 -06:00
a9168d8851 Adopt debcargo auto-gen'd testing stuff
Another thing generated that I'm just trusting is accurate. Oops.
2025-11-13 22:06:11 -06:00
f7b54b9605 Adopt debian/control contents from debcargo output
I never would have guessed just how many things I'm missing. It looks
like it even worked out that there is both a binary and a library, which
is not something I had considered. Neat.
2025-11-13 22:04:49 -06:00
fa8f590019 Drop a copyright notice (!)
I credited Johannes Schauer Marin Rodrigues <josch@debian.org> with the
original debian/rules way back at the start of the packaging branch. It
seemed like good traceability, at the very least.

Now, the rules file is just a bit of boilerplate. I don't think anyone
needs particular credit for this thing, so I'm dropping the explicit
mention.
2025-11-13 22:00:51 -06:00
89179e49e7 Strip out all the imports and exports
Again, comparing against other projects I see none of these things. I'm
dropping them.
2025-11-13 21:58:32 -06:00
47b91a1e42 Remove bogus pre-step inserts
These don't do anything. I've compared against some other Rust packages
(some ProxmoxVE stuff) and the output of debcargo against this crate
(from crates.io, now that it's up). Neither contain these targets. I'm
fairly confident I don't need them at all.
2025-11-13 21:49:28 -06:00
4778c6f362 Add a cargo-checksum.json, remove its fake
See "https://wiki.debian.org/Teams/RustPackaging/Policy"

In section "Library package structure", the policy manual explains that
this file is meant to exist in the Debian package (i.e.: it's not
generated during the build) and should contain the SHA256 checksum of
the upstream crate.

The crate's internal arrangement can change depending on which version
of Cargo was used to create it. This checksum is from Rust 1.93, the
current stable at time of writing. Debian 13's Rust 1.85 produces a
different file with a different sum. I'm not sure what to do about that
right now.
2025-11-13 21:36:08 -06:00
2022da671e Fix: debian/copyright was using old package name. 2025-11-13 20:05:43 -06:00
25af28e97c Update changelog for 3.0.1-1 release 2025-11-13 17:12:47 -06:00
02cabfeb1a Drop entirety of old patch set
Both the Rust edition and the lifetime thing were changed in Rust 1.85,
which is now available in Debian 13. These patches are no longer
necessary.
2025-11-13 17:08:53 -06:00
54b54b42d7 Update gbp.conf debian-branch to "deb/trixie" 2025-11-13 17:08:31 -06:00
21799aa247 Merge tag 'v3.0.1' into deb/trixie
Release v3.0.1, metadata updates
2025-11-13 17:07:52 -06:00
c5c5598fb7 Mark v3.0.1 patch
All checks were successful
/ Compile and upload a release build (release) Successful in 54s
Barely anything has changed, but the package *is* different. v3 is from
months back and is missing information that Crates.io kinda wants.
2025-11-13 16:55:12 -06:00
9e47cb72d5 Remove the comments tracking Debian-specific deps
The Debian 12 dependency versions can go away since I'm no longer
targetting it. The Debian Sid versions haven't been checked in months,
and I'm not actually targetting it *either* (never have been). They can
both go away.
2025-11-13 16:40:01 -06:00
ff2286f44b Add metadata required for publishing to crates.io
I'm not sure they're required. I sure hope not because I don't have a
homepage, and the guide says not to reuse the repo URL there.
2025-11-13 16:36:54 -06:00
d982f42ae7 Update dependency versions for Debian 13 "Trixie"
I'm deciding that I'll only support the latest stable release of
Debian. Somehow I doubt anyone is using this tool, and those who do are
unlikely to need an even longer support window than Debian's stable
release period.

This change bumps the dependencies to match those available in Debian
13. Some upgrades would have already happened, while others are blocked
by the SemVer rules.

For example, Clap 4.0 to 4.5 would happen automatically, but TOML 0.5 to
0.8 would not.
2025-09-11 14:12:12 -05:00
11 changed files with 120 additions and 128 deletions

View File

@@ -1,23 +1,18 @@
[package] [package]
name = "gt-tool" name = "gt-tool"
version = "3.0.0" version = "3.0.1"
edition = "2024" edition = "2024"
license = "GPL-3.0-only"
description = "CLI tools for interacting with the Gitea API. Mainly for attaching files to releases."
# homepage = "" I have no website for a project home page :(
repository = "https://git.gelvin.dev/robert/gt-tool"
readme = "README.md"
[dependencies] [dependencies]
clap = { version = "4.0.7", features = ["derive", "env"] } clap = { version = "4.5.23", features = ["derive", "env"] }
colored = "2.0.0" colored = "2.2.0"
itertools = "0.10.0" itertools = "0.13.0"
reqwest = { version = "0.11.13", features = ["json", "stream", "multipart"] } reqwest = { version = "0.12.15", features = ["json", "stream", "multipart"] }
serde = { version = "1.0.152", features = ["derive"] } serde = { version = "1.0.217", features = ["derive"] }
tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread"] } tokio = { version = "1.43.1", features = ["macros", "rt-multi-thread"] }
toml = "0.5" toml = "0.8.19"
# Packages available in Debian (Sid)
# clap = "4.5.23"
# reqwest = "0.12.15"
# tokio = "1.43.1"
# Debian (Bookworm)
# clap = "4.0.32"
# reqwest = "0.11.13"
# tokio = "1.24.2"

1
debian/cargo-checksum.json vendored Normal file
View File

@@ -0,0 +1 @@
{"package":"62e0ece55a4e0150ab3a3f7f5299e6eb113134975100cddde5a68dfcbb5e1a5c","files":{}}

23
debian/changelog vendored
View File

@@ -1,3 +1,26 @@
gt-tool (3.0.1-2) unstable; urgency=medium
* Fix: debian/copyright was using old package name.
* Add a cargo-checksum.json, remove its fake
* Remove bogus pre-step inserts
* Strip out all the imports and exports
* Drop a copyright notice (!)
* Adopt debian/control contents from debcargo output
* Adopt debcargo auto-gen'd testing stuff
-- Robert Garrett <robertgarrett404@gmail.com> Thu, 13 Nov 2025 22:07:35 -0600
gt-tool (3.0.1-1) unstable; urgency=medium
* Update dependency versions for Debian 13 "Trixie"
* Add metadata required for publishing to crates.io
* Remove the comments tracking Debian-specific deps
* Mark v3.0.1 patch
* Update gbp.conf debian-branch to "deb/trixie"
* Drop entirety of old patch set
-- Robert Garrett <robertgarrett404@gmail.com> Thu, 13 Nov 2025 17:12:26 -0600
gt-tool (3.0.0-1) unstable; urgency=medium gt-tool (3.0.0-1) unstable; urgency=medium
* Make the README title singular * Make the README title singular

73
debian/control vendored
View File

@@ -1,28 +1,83 @@
Source: gt-tool Source: gt-tool
Maintainer: Robert Garrett <robertgarrett404@gmail.com> Maintainer: Robert Garrett <robertgarrett404@gmail.com>
Section: misc Section: rust
Priority: optional Priority: optional
Standards-Version: 4.6.2 Standards-Version: 4.6.2
Build-Depends: Build-Depends:
debhelper-compat (= 13), debhelper-compat (= 13),
dh-cargo, dh-sequence-cargo
librust-clap-dev, Build-Depends-Arch:
librust-colored-dev, cargo:native,
librust-itertools-dev, rustc:native,
librust-reqwest-dev, libstd-rust-dev,
librust-serde-dev, librust-clap-4+default-dev (>= 4.5.23-~~),
librust-tokio-dev, librust-clap-4+derive-dev (>= 4.5.23-~~),
librust-toml-dev, librust-clap-4+env-dev (>= 4.5.23-~~),
librust-colored-2+default-dev (>= 2.2.0-~~),
librust-itertools-0.13+default-dev,
librust-reqwest-0.12+default-dev (>= 0.12.15-~~),
librust-reqwest-0.12+json-dev (>= 0.12.15-~~),
librust-reqwest-0.12+multipart-dev (>= 0.12.15-~~),
librust-reqwest-0.12+stream-dev (>= 0.12.15-~~),
librust-serde-1+default-dev (>= 1.0.217-~~),
librust-serde-1+derive-dev (>= 1.0.217-~~),
librust-tokio-1+default-dev (>= 1.43.1-~~),
librust-tokio-1+macros-dev (>= 1.43.1-~~),
librust-tokio-1+rt-multi-thread-dev (>= 1.43.1-~~),
librust-toml-0.8+default-dev (>= 0.8.19-~~)
Homepage: https://git.gelvin.dev/robert/gt-tool Homepage: https://git.gelvin.dev/robert/gt-tool
Vcs-Git: https://git.gelvin.dev/robert/gt-tool Vcs-Git: https://git.gelvin.dev/robert/gt-tool
Vcs-Browser: https://git.gelvin.dev/robert/gt-tool Vcs-Browser: https://git.gelvin.dev/robert/gt-tool
Rules-Requires-Root: no Rules-Requires-Root: no
X-Cargo-Crate: gt-tool
Package: librust-gt-tool-dev
Architecture: any
Multi-Arch: same
Depends:
${misc:Depends},
librust-clap-4+default-dev (>= 4.5.23-~~),
librust-clap-4+derive-dev (>= 4.5.23-~~),
librust-clap-4+env-dev (>= 4.5.23-~~),
librust-colored-2+default-dev (>= 2.2.0-~~),
librust-itertools-0.13+default-dev,
librust-reqwest-0.12+default-dev (>= 0.12.15-~~),
librust-reqwest-0.12+json-dev (>= 0.12.15-~~),
librust-reqwest-0.12+multipart-dev (>= 0.12.15-~~),
librust-reqwest-0.12+stream-dev (>= 0.12.15-~~),
librust-serde-1+default-dev (>= 1.0.217-~~),
librust-serde-1+derive-dev (>= 1.0.217-~~),
librust-tokio-1+default-dev (>= 1.43.1-~~),
librust-tokio-1+macros-dev (>= 1.43.1-~~),
librust-tokio-1+rt-multi-thread-dev (>= 1.43.1-~~),
librust-toml-0.8+default-dev (>= 0.8.19-~~)
Provides:
librust-gt-tool+default-dev (= ${binary:Version}),
librust-gt-tool-3-dev (= ${binary:Version}),
librust-gt-tool-3+default-dev (= ${binary:Version}),
librust-gt-tool-3.0-dev (= ${binary:Version}),
librust-gt-tool-3.0+default-dev (= ${binary:Version}),
librust-gt-tool-3.0.1-dev (= ${binary:Version}),
librust-gt-tool-3.0.1+default-dev (= ${binary:Version})
Description: CLI tools for interacting with the Gitea API - Rust source code
Mainly for attaching files to releases.
.
Source code for Debianized Rust crate "gt-tool"
Package: gt-tool Package: gt-tool
Architecture: any Architecture: any
Depends: Depends:
${misc:Depends}, ${misc:Depends},
${shlibs:Depends}, ${shlibs:Depends},
${cargo:Depends}
Recommends:
${cargo:Recommends}
Suggests:
${cargo:Suggests}
Provides:
${cargo:Provides}
Built-Using: ${cargo:Built-Using}
Static-Built-Using: ${cargo:Static-Built-Using}
Description: CLI tools for interacting with the Gitea API. Description: CLI tools for interacting with the Gitea API.
Use interactively to talk to your Gitea instance, or automatically via a CI/CD Use interactively to talk to your Gitea instance, or automatically via a CI/CD
pipeline. Currently supports: pipeline. Currently supports:

15
debian/copyright vendored
View File

@@ -1,5 +1,5 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: gt-tools Upstream-Name: gt-tool
Upstream-Contact: Robert Garrett <robertgarrett404@gmail.com> Upstream-Contact: Robert Garrett <robertgarrett404@gmail.com>
Source: https://git.gelvin.dev/robert/gt-tool Source: https://git.gelvin.dev/robert/gt-tool
@@ -11,19 +11,6 @@ Files: debian/*
Copyright: 2025 Robert Garrett <robertgarrett404@gmail.com> Copyright: 2025 Robert Garrett <robertgarrett404@gmail.com>
License: GPL-3+ License: GPL-3+
Files: debian/rules
Copyright:
Johannes Schauer Marin Rodrigues <josch@debian.org>
2025 Robert Garrett <robertgarrett404@gmail.com>
License: GPL-3+
Comment:
The debian/rules file is lifted directly from the tuigreet package. It was
linked in the Debian Rust Team Book as a pretty simple example package. The
only change I've made is to remove the documentation generation target.
.
https://salsa.debian.org/debian/tuigreet/-/blob/master/debian/rules?ref_type=heads
License: GPL-3+ License: GPL-3+
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by

2
debian/gbp.conf vendored
View File

@@ -2,5 +2,5 @@
compression = xz compression = xz
compression-level = 9 compression-level = 9
upstream-tag = v%(version)s upstream-tag = v%(version)s
debian-branch = deb/bookworm debian-branch = deb/trixie

View File

@@ -1,23 +0,0 @@
From: Robert Garrett <robertgarrett404@gmail.com>
Date: Sun, 1 Jun 2025 17:59:20 -0500
Subject: Rust edition downgrade to 2021
Debian Bookworm uses Rust 1.63 which only supports up to the 2021
edition.
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index 39341a1..4ec2031 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "gt-tool"
version = "3.0.0"
-edition = "2024"
+edition = "2021"
[dependencies]
clap = { version = "4.0.7", features = ["derive", "env"] }

View File

@@ -1,39 +0,0 @@
From: Robert Garrett <robertgarrett404@gmail.com>
Date: Fri, 4 Jul 2025 09:36:52 -0500
Subject: Lift the empty-body string outside the let-if
The if-else block that selects between the body of the Release or a
placeholder is returning references to variables that only exist
*inside* the body of the if-else blocks. Newer Rust versions seem to
understand the intent and do The Right Thing anyway (or they have some
other rule for how if-else block scopes work).
Manually lifting the variable to an outer scope resolves the problem.
---
src/structs/release.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/structs/release.rs b/src/structs/release.rs
index 9ed537e..3c4a434 100644
--- a/src/structs/release.rs
+++ b/src/structs/release.rs
@@ -1,3 +1,5 @@
+use std::io::empty;
+
use colored::Colorize;
use serde::{Deserialize, Serialize};
@@ -27,10 +29,11 @@ impl Release {
let published = "Published:".bright_green();
let created = "Created:".green().dimmed();
let author = "Author:".blue();
+ let empty_body = String::from("(empty body)").dimmed();
let body = if !self.body.is_empty() {
- &self.body.white()
+ self.body.white()
} else {
- &String::from("(empty body)").dimmed()
+ empty_body
};
format!(

View File

@@ -1,2 +0,0 @@
0001-Rust-edition-downgrade-to-2021.patch
0002-Lift-the-empty-body-string-outside-the-let-if.patch

25
debian/rules vendored
View File

@@ -1,26 +1,7 @@
#!/usr/bin/make -f #!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
include /usr/share/rustc/architecture.mk
export DEB_HOST_RUST_TYPE
export PATH:=/usr/share/cargo/bin:$(PATH)
export CARGO=/usr/share/cargo/bin/cargo
export CARGO_HOME=$(CURDIR)/debian/cargo_home
export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
%: %:
dh $@ --buildsystem=cargo dh $@ --buildsystem cargo
execute_after_dh_auto_clean: override_dh_auto_test:
$(CARGO) clean dh_auto_test -- test --all
rm -rf $(CARGO_HOME)
rm -rf $(CARGO_REGISTRY)
rm -f debian/cargo-checksum.json
execute_before_dh_auto_configure:
$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
rm -f Cargo.lock
touch debian/cargo-checksum.json

14
debian/tests/control vendored Normal file
View File

@@ -0,0 +1,14 @@
Test-Command: /usr/share/cargo/bin/cargo-auto-test gt-tool 3.0.1 --all-targets --all-features
Features: test-name=rust-gt-tool:@
Depends: dh-cargo (>= 31), rustc, @
Restrictions: allow-stderr, skip-not-installable
Test-Command: /usr/share/cargo/bin/cargo-auto-test gt-tool 3.0.1 --all-targets
Features: test-name=librust-gt-tool-dev:default
Depends: dh-cargo (>= 31), rustc, @
Restrictions: allow-stderr, skip-not-installable
Test-Command: /usr/share/cargo/bin/cargo-auto-test gt-tool 3.0.1 --all-targets --no-default-features
Features: test-name=librust-gt-tool-dev:
Depends: dh-cargo (>= 31), rustc, @
Restrictions: allow-stderr, skip-not-installable