[pacman-dev] [PATCH] Add short options for mark as deps or explicit
The main (only) purpose of -D is to be able to change packages installation status (deps or explicit). Having a short form offer a similar experience that other main pacman option (e.g. Su). Signed-off-by: Sébastien Luttringer <seblu@seblu.net> --- src/pacman/pacman.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 38b28e1..bd33c2d 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -165,8 +165,8 @@ static void usage(int op, const char * const myname) } else if(op == PM_OP_DATABASE) { printf("%s: %s {-D --database} <%s> <%s>\n", str_usg, myname, str_opt, str_pkg); printf("%s:\n", str_opt); - addlist(_(" --asdeps mark packages as non-explicitly installed\n")); - addlist(_(" --asexplicit mark packages as explicitly installed\n")); + addlist(_(" -d --asdeps mark packages as non-explicitly installed\n")); + addlist(_(" -e --asexplicit mark packages as explicitly installed\n")); } else if(op == PM_OP_DEPTEST) { printf("%s: %s {-T --deptest} [%s] [%s]\n", str_usg, myname, str_opt, str_pkg); printf("%s:\n", str_opt); @@ -446,7 +446,9 @@ static int parsearg_global(int opt) static int parsearg_database(int opt) { switch(opt) { + case 'd': case OP_ASDEPS: config->flags |= ALPM_TRANS_FLAG_ALLDEPS; break; + case 'e': case OP_ASEXPLICIT: config->flags |= ALPM_TRANS_FLAG_ALLEXPLICIT; break; default: return 1; } -- 1.8.1.5
On 05/03/13 11:03, Sébastien Luttringer wrote:
The main (only) purpose of -D is to be able to change packages installation status (deps or explicit). Having a short form offer a similar experience that other main pacman option (e.g. Su).
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
Signed-off-by: Allan
On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote:
The main (only) purpose of -D is to be able to change packages installation status (deps or explicit). Having a short form offer a similar experience that other main pacman option (e.g. Su).
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
The --asdeps option for -S and -U does not have a shortopt. In my worthess opinion, this is a bad idea, as -d for those operations is --nodeps. -- William Giokas | KaiSforza GnuPG Key: 0x73CD09CF Fingerprint: F73F 50EF BBE2 9846 8306 E6B8 6902 06D8 73CD 09CF
On Wed, Mar 6, 2013 at 2:19 PM, William Giokas <1007380@gmail.com> wrote:
On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote:
The main (only) purpose of -D is to be able to change packages installation status (deps or explicit). Having a short form offer a similar experience that other main pacman option (e.g. Su).
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
The --asdeps option for -S and -U does not have a shortopt. In my worthess opinion, this is a bad idea, as -d for those operations is --nodeps.
This was my thought as well. If we are willing to use a shortopt, it should apply to ALL top-level operations in the same fashion (or be rejected completely), and not mislead. -Q/--query match this criteria, but currently -d for -U/-S would be totally unexpected. So -1 from me. I have consciously made decisions over the past 3 years to not add new shortopts unless they are universally applicable, so this would be a step against that. If we were to do this, we would want to remove the -d shortopt for --nodeps in the next release, and then add these in the following release. However, this is cumbersome as `--nodeps --nodeps` is really silly to type out as we allow this option to be passed twice for even more dep-ignoring behavior. -Dan
Or, alternatively, change it to something like --resolve-deps=some, --resolve-deps=none, etc
On 07/03/13 06:31, Dan McGee wrote:
On Wed, Mar 6, 2013 at 2:19 PM, William Giokas <1007380@gmail.com> wrote:
On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote:
The main (only) purpose of -D is to be able to change packages installation status (deps or explicit). Having a short form offer a similar experience that other main pacman option (e.g. Su).
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
The --asdeps option for -S and -U does not have a shortopt. In my worthess opinion, this is a bad idea, as -d for those operations is --nodeps.
This was my thought as well. If we are willing to use a shortopt, it should apply to ALL top-level operations in the same fashion (or be rejected completely), and not mislead. -Q/--query match this criteria, but currently -d for -U/-S would be totally unexpected. So -1 from me.
I have consciously made decisions over the past 3 years to not add new shortopts unless they are universally applicable, so this would be a step against that. If we were to do this, we would want to remove the -d shortopt for --nodeps in the next release, and then add these in the following release. However, this is cumbersome as `--nodeps --nodeps` is really silly to type out as we allow this option to be passed twice for even more dep-ignoring behavior.
I made the decision to take this based on: 1) it would be good to have a short options 2) the short letters made sense 3) the current usage of -d/-e in -Q is fairly similar 4) the current usage of -d in -S is an operation that is unrelated to -D so will not cause confusion. People manage to understand that -Sd is different from -Qd. Why the need to enforce consistency when there is already none? Allan
On 03/07/13 at 02:51pm, Allan McRae wrote:
On 07/03/13 06:31, Dan McGee wrote:
On Wed, Mar 6, 2013 at 2:19 PM, William Giokas <1007380@gmail.com> wrote:
On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote:
The main (only) purpose of -D is to be able to change packages installation status (deps or explicit). Having a short form offer a similar experience that other main pacman option (e.g. Su).
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
The --asdeps option for -S and -U does not have a shortopt. In my worthess opinion, this is a bad idea, as -d for those operations is --nodeps.
This was my thought as well. If we are willing to use a shortopt, it should apply to ALL top-level operations in the same fashion (or be rejected completely), and not mislead. -Q/--query match this criteria, but currently -d for -U/-S would be totally unexpected. So -1 from me.
I have consciously made decisions over the past 3 years to not add new shortopts unless they are universally applicable, so this would be a step against that. If we were to do this, we would want to remove the -d shortopt for --nodeps in the next release, and then add these in the following release. However, this is cumbersome as `--nodeps --nodeps` is really silly to type out as we allow this option to be passed twice for even more dep-ignoring behavior.
I made the decision to take this based on:
1) it would be good to have a short options 2) the short letters made sense 3) the current usage of -d/-e in -Q is fairly similar 4) the current usage of -d in -S is an operation that is unrelated to -D so will not cause confusion.
People manage to understand that -Sd is different from -Qd. Why the need to enforce consistency when there is already none?
Allan
I think that the problem is not just that -d means different things for different operations, but that --asdeps and --asexplicit shorten differently based on the operation. A user would likely see that --asdeps shortens to -d with -D and assume it to do the same for -S because --asdeps is a valid option there too. A short option may mean different things for different operations, but all operations that accept a particular long option should use the same short option for it. apg
On 07/03/13 15:30, Andrew Gregory wrote:
On 03/07/13 at 02:51pm, Allan McRae wrote:
On 07/03/13 06:31, Dan McGee wrote:
On Wed, Mar 6, 2013 at 2:19 PM, William Giokas <1007380@gmail.com> wrote:
On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote:
The main (only) purpose of -D is to be able to change packages installation status (deps or explicit). Having a short form offer a similar experience that other main pacman option (e.g. Su).
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
The --asdeps option for -S and -U does not have a shortopt. In my worthess opinion, this is a bad idea, as -d for those operations is --nodeps.
This was my thought as well. If we are willing to use a shortopt, it should apply to ALL top-level operations in the same fashion (or be rejected completely), and not mislead. -Q/--query match this criteria, but currently -d for -U/-S would be totally unexpected. So -1 from me.
I have consciously made decisions over the past 3 years to not add new shortopts unless they are universally applicable, so this would be a step against that. If we were to do this, we would want to remove the -d shortopt for --nodeps in the next release, and then add these in the following release. However, this is cumbersome as `--nodeps --nodeps` is really silly to type out as we allow this option to be passed twice for even more dep-ignoring behavior.
I made the decision to take this based on:
1) it would be good to have a short options 2) the short letters made sense 3) the current usage of -d/-e in -Q is fairly similar 4) the current usage of -d in -S is an operation that is unrelated to -D so will not cause confusion.
People manage to understand that -Sd is different from -Qd. Why the need to enforce consistency when there is already none?
Allan
I think that the problem is not just that -d means different things for different operations, but that --asdeps and --asexplicit shorten differently based on the operation. A user would likely see that --asdeps shortens to -d with -D and assume it to do the same for -S because --asdeps is a valid option there too. A short option may mean different things for different operations, but all operations that accept a particular long option should use the same short option for it.
OK. I separate out the --asdep for -S/-U and -D mentally because they are doing completely different things. But I see the point. Patch denied. Allan
On Thu, Mar 7, 2013 at 6:32 AM, Allan McRae <allan@archlinux.org> wrote:
On 07/03/13 15:30, Andrew Gregory wrote:
On 03/07/13 at 02:51pm, Allan McRae wrote:
On 07/03/13 06:31, Dan McGee wrote:
On Wed, Mar 6, 2013 at 2:19 PM, William Giokas <1007380@gmail.com> wrote:
On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote:
The main (only) purpose of -D is to be able to change packages installation status (deps or explicit). Having a short form offer a similar experience that other main pacman option (e.g. Su).
Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
The --asdeps option for -S and -U does not have a shortopt. In my worthess opinion, this is a bad idea, as -d for those operations is --nodeps.
This was my thought as well. If we are willing to use a shortopt, it should apply to ALL top-level operations in the same fashion (or be rejected completely), and not mislead. -Q/--query match this criteria, but currently -d for -U/-S would be totally unexpected. So -1 from me.
I have consciously made decisions over the past 3 years to not add new shortopts unless they are universally applicable, so this would be a step against that. If we were to do this, we would want to remove the -d shortopt for --nodeps in the next release, and then add these in the following release. However, this is cumbersome as `--nodeps --nodeps` is really silly to type out as we allow this option to be passed twice for even more dep-ignoring behavior.
I made the decision to take this based on:
1) it would be good to have a short options 2) the short letters made sense 3) the current usage of -d/-e in -Q is fairly similar 4) the current usage of -d in -S is an operation that is unrelated to -D so will not cause confusion.
People manage to understand that -Sd is different from -Qd. Why the need to enforce consistency when there is already none?
Allan
I think that the problem is not just that -d means different things for different operations, but that --asdeps and --asexplicit shorten differently based on the operation. A user would likely see that --asdeps shortens to -d with -D and assume it to do the same for -S because --asdeps is a valid option there too. A short option may mean different things for different operations, but all operations that accept a particular long option should use the same short option for it.
OK. I separate out the --asdep for -S/-U and -D mentally because they are doing completely different things. But I see the point.
ok, we can use -e to explicit deps, as it's not used on -S/-U/-D (which have all --asexplicit). -d is used by --nodeps, do you have a suggestion for a short option for --asdeps? -- Sébastien "Seblu" Luttringer https://www.seblu.net GPG: 0x2072D77A
On Thu, Mar 7, 2013 at 9:08 AM, Sébastien Luttringer <seblu@seblu.net> wrote:
On Thu, Mar 7, 2013 at 6:32 AM, Allan McRae <allan@archlinux.org> wrote:
On 07/03/13 15:30, Andrew Gregory wrote:
On 03/07/13 at 02:51pm, Allan McRae wrote:
On 07/03/13 06:31, Dan McGee wrote:
On Wed, Mar 6, 2013 at 2:19 PM, William Giokas <1007380@gmail.com> wrote:
On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote: > The main (only) purpose of -D is to be able to change packages installation > status (deps or explicit). Having a short form offer a similar experience that > other main pacman option (e.g. Su). > > Signed-off-by: Sébastien Luttringer <seblu@seblu.net>
The --asdeps option for -S and -U does not have a shortopt. In my worthess opinion, this is a bad idea, as -d for those operations is --nodeps.
This was my thought as well. If we are willing to use a shortopt, it should apply to ALL top-level operations in the same fashion (or be rejected completely), and not mislead. -Q/--query match this criteria, but currently -d for -U/-S would be totally unexpected. So -1 from me.
I have consciously made decisions over the past 3 years to not add new shortopts unless they are universally applicable, so this would be a step against that. If we were to do this, we would want to remove the -d shortopt for --nodeps in the next release, and then add these in the following release. However, this is cumbersome as `--nodeps --nodeps` is really silly to type out as we allow this option to be passed twice for even more dep-ignoring behavior.
I made the decision to take this based on:
1) it would be good to have a short options 2) the short letters made sense 3) the current usage of -d/-e in -Q is fairly similar 4) the current usage of -d in -S is an operation that is unrelated to -D so will not cause confusion.
People manage to understand that -Sd is different from -Qd. Why the need to enforce consistency when there is already none?
Allan
I think that the problem is not just that -d means different things for different operations, but that --asdeps and --asexplicit shorten differently based on the operation. A user would likely see that --asdeps shortens to -d with -D and assume it to do the same for -S because --asdeps is a valid option there too. A short option may mean different things for different operations, but all operations that accept a particular long option should use the same short option for it.
OK. I separate out the --asdep for -S/-U and -D mentally because they are doing completely different things. But I see the point.
ok, we can use -e to explicit deps, as it's not used on -S/-U/-D (which have all --asexplicit).
-d is used by --nodeps, do you have a suggestion for a short option for --asdeps?
Not every operation deserves a shortopt; these are used so much less than other operations that I don't feel the loss of self-explanation is worth it. -Dan
On Thu, Mar 07, 2013 at 09:29:55AM -0600, Dan McGee wrote:
On Thu, Mar 7, 2013 at 9:08 AM, Sébastien Luttringer <seblu@seblu.net> wrote:
On Thu, Mar 7, 2013 at 6:32 AM, Allan McRae <allan@archlinux.org> wrote:
On 07/03/13 15:30, Andrew Gregory wrote:
On 03/07/13 at 02:51pm, Allan McRae wrote:
On 07/03/13 06:31, Dan McGee wrote:
On Wed, Mar 6, 2013 at 2:19 PM, William Giokas <1007380@gmail.com> wrote: > On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote: >> The main (only) purpose of -D is to be able to change packages installation >> status (deps or explicit). Having a short form offer a similar experience that >> other main pacman option (e.g. Su). >> >> Signed-off-by: Sébastien Luttringer <seblu@seblu.net> > > The --asdeps option for -S and -U does not have a shortopt. In my > worthess opinion, this is a bad idea, as -d for those operations is > --nodeps.
This was my thought as well. If we are willing to use a shortopt, it should apply to ALL top-level operations in the same fashion (or be rejected completely), and not mislead. -Q/--query match this criteria, but currently -d for -U/-S would be totally unexpected. So -1 from me.
I have consciously made decisions over the past 3 years to not add new shortopts unless they are universally applicable, so this would be a step against that. If we were to do this, we would want to remove the -d shortopt for --nodeps in the next release, and then add these in the following release. However, this is cumbersome as `--nodeps --nodeps` is really silly to type out as we allow this option to be passed twice for even more dep-ignoring behavior.
I made the decision to take this based on:
1) it would be good to have a short options 2) the short letters made sense 3) the current usage of -d/-e in -Q is fairly similar 4) the current usage of -d in -S is an operation that is unrelated to -D so will not cause confusion.
People manage to understand that -Sd is different from -Qd. Why the need to enforce consistency when there is already none?
Allan
I think that the problem is not just that -d means different things for different operations, but that --asdeps and --asexplicit shorten differently based on the operation. A user would likely see that --asdeps shortens to -d with -D and assume it to do the same for -S because --asdeps is a valid option there too. A short option may mean different things for different operations, but all operations that accept a particular long option should use the same short option for it.
OK. I separate out the --asdep for -S/-U and -D mentally because they are doing completely different things. But I see the point.
ok, we can use -e to explicit deps, as it's not used on -S/-U/-D (which have all --asexplicit).
-d is used by --nodeps, do you have a suggestion for a short option for --asdeps?
Not every operation deserves a shortopt; these are used so much less than other operations that I don't feel the loss of self-explanation is worth it.
-Dan
+1. We've made a point of explcitly *removing* the shortopts for infrequently used or dangerous options (-k no longer exists for --dbonly, and -f for --force has gone away). I tend to think that anything involving the -D operation can be destructive and infrequently used. Let's not go in the opposite direction of this.
On Thu, Mar 7, 2013 at 4:58 PM, Dave Reisner <d@falconindy.com> wrote:
On Thu, Mar 07, 2013 at 09:29:55AM -0600, Dan McGee wrote:
On Thu, Mar 7, 2013 at 9:08 AM, Sébastien Luttringer <seblu@seblu.net> wrote:
On Thu, Mar 7, 2013 at 6:32 AM, Allan McRae <allan@archlinux.org> wrote:
On 07/03/13 15:30, Andrew Gregory wrote:
On 03/07/13 at 02:51pm, Allan McRae wrote:
On 07/03/13 06:31, Dan McGee wrote: > On Wed, Mar 6, 2013 at 2:19 PM, William Giokas <1007380@gmail.com> wrote: >> On Tue, Mar 05, 2013 at 02:03:14AM +0100, Sébastien Luttringer wrote:
-d is used by --nodeps, do you have a suggestion for a short option for --asdeps?
Not every operation deserves a shortopt; these are used so much less than other operations that I don't feel the loss of self-explanation is worth it.
+1. We've made a point of explcitly *removing* the shortopts for infrequently used or dangerous options (-k no longer exists for --dbonly, and -f for --force has gone away). I tend to think that anything involving the -D operation can be destructive and infrequently used. Let's not go in the opposite direction of this.
Here, there anything destructive to mark a package as explicit or as deps. It instructs pacman about your usage of a package to be able to act accordingly. I use it frequently to clean the output of "pacman -Qtd" to be able to run "pacman -R $(pacman -Qdtq)" to clean my system. Although my use doesn't mean frequently for anybody else, I guess that behavior is sane and could be recommended to keep an archlinux system clean over the time. Allow users to instruct pacman about which package are here by choice or by dependency of another chosen package have nothing to do with force an installation of a package when pacman detect something which should not be done and ask users to bypass its judgment. Technically I tend to think there is no lost of meaning adding a short option here, mainly because we don't remove the long form, and people which want to be meaningful should use long options. Taking the opposite, -D is completely dedicated to marking packages and nobody argue to remove -D and let only --database because it's not frequently used. I'll probably not able to convince anyone on this because I think that short options are only syntax sugar and every long options should have its counterpart _except_ for dangerous options. Cheers, -- Sébastien "Seblu" Luttringer https://www.seblu.net GPG: 0x2072D77A
participants (7)
-
Allan McRae
-
Andrew Gregory
-
Dan McGee
-
Dave Reisner
-
Simon Gomizelj
-
Sébastien Luttringer
-
William Giokas