Control: tag -1 patch

Hi!

On Wed, 2021-12-08 at 20:39:52 +0100, Guillem Jover wrote:
> Package: sqop
> Version: 0.22.2-2
> Severity: wishlist

> One of the main advantages of the SOP CLI is that it is a standardized
> interface, which means having to hardcode specific implementations in
> code kind of defeats the point of that interface. It would be nice to
> be able to by default just use «sop» and use that interface behind
> an alternative (in the dpkg alternatives system), then the local admin
> can select any of the existing implementations. I'm not sure how you'd
> want to decide on the priority of the alternatives though, perhaps at
> least by level of compliance (although I don't mind greatly TBH :)?

I've implemented a proposal for this in the attached patch. It also
adds a «sop» virtual package (or at least pretends to, did not run any
debcargo command) so that other packages can depend on any
implementation of the interface.

I initially included alternatives also for the completion but I don't
think they support the «sop» name anyway (at least the bash and fish
ones), and I don't think they can act in a polymorphic way depending
on the file they have been loaded from either.

The currently proposed patch would not make it possible to easily
denote a default implementation though, so perhaps you'd prefer two
sets of virtual packages, one for the current default, and one for
any implementation. Or another option could be to introduce a real
«sop» package (which then could provide its own command completion
files too :), perhaps the spec, etc, and depend first on the preferred
implementation and the virtual package for any sop implementation such
as «sqop | sop-impl» or whatever. The drawback with the real package
approach is that it requires this artificial metapackage.

I think this would also deserve filing a request for an addition to
the Debian policy virtual-package list for coordination with other
potential SOP implementations, once the layout is settled.

Thanks,
Guillem
diff -Nru rust-sequoia-sop-0.27.0/debian/debcargo.toml rust-sequoia-sop-0.27.0/debian/debcargo.toml
--- rust-sequoia-sop-0.27.0/debian/debcargo.toml	2022-07-07 23:22:50.000000000 +0200
+++ rust-sequoia-sop-0.27.0/debian/debcargo.toml	2022-07-20 01:58:54.000000000 +0200
@@ -20,3 +20,4 @@
 
 [packages.bin]
 section = "utils"
+provides = ["sop"]
diff -Nru rust-sequoia-sop-0.27.0/debian/sqop.alternatives rust-sequoia-sop-0.27.0/debian/sqop.alternatives
--- rust-sequoia-sop-0.27.0/debian/sqop.alternatives	1970-01-01 01:00:00.000000000 +0100
+++ rust-sequoia-sop-0.27.0/debian/sqop.alternatives	2022-07-20 02:00:49.000000000 +0200
@@ -0,0 +1,15 @@
+Name: sop
+Link: /usr/bin/sop
+Alternative: /usr/bin/sqop
+Dependents:
+ /usr/share/man/man1/sop-armor.1.gz sop-armor.1.gz /usr/share/man/man1/sqop-armor.1.gz
+ /usr/share/man/man1/sop-dearmor.1.gz sop-dearmor.1.gz /usr/share/man/man1/sqop-dearmor.1.gz
+ /usr/share/man/man1/sop-decrypt.1.gz sop-decrypt.1.gz /usr/share/man/man1/sqop-decrypt.1.gz
+ /usr/share/man/man1/sop-encrypt.1.gz sop-encrypt.1.gz /usr/share/man/man1/sqop-encrypt.1.gz
+ /usr/share/man/man1/sop-extract-cert.1.gz sop-extract-cert.1.gz /usr/share/man/man1/sqop-extract-cert.1.gz
+ /usr/share/man/man1/sop-generate-key.1.gz sop-generate-key.1.gz /usr/share/man/man1/sqop-generate-key.1.gz
+ /usr/share/man/man1/sop-sign.1.gz sop-sign.1.gz /usr/share/man/man1/sqop-sign.1.gz
+ /usr/share/man/man1/sop-verify.1.gz sop-verify.1.gz /usr/share/man/man1/sqop-verify.1.gz
+ /usr/share/man/man1/sop-version.1.gz sop-version.1.gz /usr/share/man/man1/sqop-version.1.gz
+ /usr/share/man/man1/sop.1.gz sop.1.gz /usr/share/man/man1/sqop.1.gz
+Priority: 100

Reply via email to