Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-28 Thread Panu Matilainen
Merged #2921 into master.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#event-11949396433
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-28 Thread Panu Matilainen
@pmatilai approved this pull request.

Looks fine now, thanks.



-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#pullrequestreview-1905848211
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-27 Thread Florian Festi
@ffesti commented on this pull request.



> @@ -42,6 +41,20 @@ static struct poptOption optionsTable[] = {
 POPT_TABLEEND
 };
 
+static ARGV_t gpgkeyargs(ARGV_const_t args) {
+ARGV_t gpgargs = argvNew();
+for (char * const * arg = args; *arg; arg++) {
+   if (strncmp(*arg, "gpg-pubkey-", 11)) {
+   char * gpgarg = rpmExpand("gpg-pubkey-", *arg, NULL);

No idea why moving the code elsewhere didn't solve the issue...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#discussion_r1504149610
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-27 Thread Florian Festi
@ffesti pushed 1 commit.

c33f2943fe01fd629a0beda4efcf2a3b60b1c7f0  Add --list and --delete to rpmkeys

-- 
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921/files/3ae469d7df0755d847fedd7bbc8f7edd6ec13251..c33f2943fe01fd629a0beda4efcf2a3b60b1c7f0
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-26 Thread Panu Matilainen
@pmatilai commented on this pull request.



> @@ -42,6 +41,20 @@ static struct poptOption optionsTable[] = {
 POPT_TABLEEND
 };
 
+static ARGV_t gpgkeyargs(ARGV_const_t args) {
+ARGV_t gpgargs = argvNew();
+for (char * const * arg = args; *arg; arg++) {
+   if (strncmp(*arg, "gpg-pubkey-", 11)) {
+   char * gpgarg = rpmExpand("gpg-pubkey-", *arg, NULL);

Again, why the macro expand? 'rpmkeys --delete %{somemacro}' seems like a weird 
use-case to support, I'd think for something like OpenPGP keys you'd rather 
always be explicit about the key.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#pullrequestreview-1902735001
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-26 Thread Panu Matilainen
@pmatilai commented on this pull request.



> @@ -42,6 +41,20 @@ static struct poptOption optionsTable[] = {
 POPT_TABLEEND
 };
 
+static ARGV_t gpgkeyargs(ARGV_const_t args) {
+ARGV_t gpgargs = argvNew();

argvNew() is wholly unnecessary here (it almost always is), just initialize to 
NULl and argvAdd() and similar will alloc it as needed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#pullrequestreview-1902726014
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-21 Thread Panu Matilainen
> Well, I stuck to the names that were in the code...

I know. My not-so-thoroughly thought up names from 10+ years ago, and a fine 
example of why not to leave such half-assed pieces laying around in the 
codebase :laughing: 

> It also uses "--delete" while rpm itself uses "--erase". Not sure if that is 
> good because it is a slightly different operation or bad because it is 
> inconsistent. Opinions?

I'm quite sure I chose the names for familiarity from gpg, which has 
--list-keys and --delete-keys.
I always quite disliked the "erase" terminology in rpm anyhow.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#issuecomment-1958879565
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-21 Thread Florian Festi
@ffesti pushed 1 commit.

109d770953bb47582727bc33def7df064a92f080  Add --list and --delete to rpmkeys

-- 
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921/files/44709043703d3f0e0f3f0534e05a3fcb3df8ea93..109d770953bb47582727bc33def7df064a92f080
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-21 Thread Florian Festi
Well, I stuck to the names that were in the code...

but it turns out the "keys" in in the name of the utility already and we don't 
need to repeat that in the cli parameter. It also uses "--delete" while rpm 
itself uses "--erase". Not sure if that is good because it is a slightly 
different operation or bad because it is inconsistent. Opinions?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#issuecomment-1957711787
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-21 Thread Florian Festi
@ffesti pushed 1 commit.

44709043703d3f0e0f3f0534e05a3fcb3df8ea93  Add --list and --delete to rpmkeys

-- 
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921/files/20e8342f76425d1085138973e2f4a7837c8dcb87..44709043703d3f0e0f3f0534e05a3fcb3df8ea93
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-21 Thread Panu Matilainen
@pmatilai commented on this pull request.



>  case MODE_LISTKEY:
+   if (args != NULL) {
+   argerror(_("--list-keys does not take any arguments"));
+   }
+   ARGV_t query = argvSplitString("gpg-pubkey", " ", ARGV_NONE);

It's a bit creative way to initialize an argv... I think
```
ARGV_t query = NULL;
argvAdd(, "gpg-pubkey");
```
...would be a well worth the one extra line in obviousness :smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#pullrequestreview-1892397084
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-21 Thread Panu Matilainen
@pmatilai commented on this pull request.



>  case MODE_LISTKEY:
+   if (args != NULL) {
+   argerror(_("--list-keys does not take any arguments"));

I think it should (take optional arguments), actually. It could be useful for 
eg checking whether a particular key is imported, without having to query all 
and grep.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#pullrequestreview-1892392916
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-21 Thread Florian Festi
@ffesti pushed 2 commits.

1fcfcb58c1025a36b8b44d13c688f3e70ae779fd  Don't advertise rpm -qa gpg-pubkey* 
in man page
20e8342f76425d1085138973e2f4a7837c8dcb87  Add --list-keys and --delete-key to 
rpmkeys

-- 
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921/files/757932ecc5450b8e84f18b8e28e046d901d65e5b..20e8342f76425d1085138973e2f4a7837c8dcb87
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-20 Thread Panu Matilainen
I think I initially wanted to add a sane API for these and then have rpmkeys 
use that, and when that seemed painful I gave up. But the user wont care *how* 
it's achieved if it works in a meaningful manner. And, for the user this is far 
saner than 'rpmkeys --import -> rpm -q -> rpm --erase'. 

Two things:
1) Lets make the option names consistent - either they all should have plural 
-keys, or none should have it. Since the pre-existing --import doesn't have it, 
maybe the --delete and --list shouldn't have either? Or, we could add 
--import-keys as alias to --import.
2) Tests for both added operations.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#issuecomment-1956077388
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-20 Thread Panu Matilainen
@pmatilai commented on this pull request.



> @@ -75,7 +74,29 @@ int main(int argc, char *argv[])
break;
 /* XXX TODO: actually implement these... */

Maybe delete this comment while at it? :smile: A fine example of why comments 
are so bad - they don't get updated along with the code.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#pullrequestreview-1892306320
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-20 Thread Panu Matilainen
@pmatilai commented on this pull request.



> @@ -75,7 +74,29 @@ int main(int argc, char *argv[])
break;
 /* XXX TODO: actually implement these... */
 case MODE_DELKEY:
+   struct rpmInstallArguments_s * ia = 
+   ARGV_t gpgargs = argvNew();
+   for (char * const * arg = args; *arg; arg++) {
+   if (strncmp(*arg, "gpg-pubkey-", 11)) {
+   char * gpgarg = rpmExpand("gpg-pubkey-", *arg, NULL);

Why the macro expand? That seems weird/wrong in this context.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#pullrequestreview-1892305237
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-20 Thread Florian Festi
This feels a bit too quick and dirty. Comments welcome.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921#issuecomment-1956047845
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] Add --list-keys and --delete-key to rpmkeys (PR #2921)

2024-02-20 Thread Florian Festi
This is a  bit of a hack as it manipulates the parsed cli parameters to
to the right thing and then calls rpmcliQuery and rpmErase.



You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2921

-- Commit Summary --

  * Add --list-keys and --delete-key to rpmkeys
  * Dont advertise rpm -qa gpg-pubkey* in man page

-- File Changes --

M docs/man/rpmkeys.8.md (18)
M tools/rpmkeys.c (25)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2921.patch
https://github.com/rpm-software-management/rpm/pull/2921.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2921
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/2...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint