Skip to content
This repository has been archived by the owner on May 31, 2018. It is now read-only.

deprecate AUR specific short command options #712

Closed
rmarquis opened this issue Jul 3, 2017 · 8 comments
Closed

deprecate AUR specific short command options #712

rmarquis opened this issue Jul 3, 2017 · 8 comments

Comments

@rmarquis
Copy link
Owner

rmarquis commented Jul 3, 2017

Pacaur provides two sets of command options, one for AUR only specific actions and another one that extends regular pacman options. While this allows quite a lot of flexibility in the way users can use pacaur, this has however the downside of being quite complex to maintain, not to mention being completely ugly.

Also, the usage of two sets of options that somewhat overlap isn't straightforward to understand, as some options haven't the same meaning in one set or another (f.e. -y). To this day, I still see users mixing both sets of options and not understanding how to use pacaur without actually reading the man page.

For theses reasons, I'd like to deprecate the AUR specific short command options, and use only "long" options, similarly to what auracle (cower-ng, see #708) does. F.e, instead of using-s and --search, simply implement search as the AUR only option. The pacman extension set should stay unchanged, still allowing the short -s and long --search options, to be used with -S or --sync.

Implementing a temporary "translator" of the old AUR-only options to the new one with a warning message might be needed here.

Also, simplifiying the getops structure would help. See this reference and blog post to handle nested getops in a much readable form.

@rmarquis rmarquis added the todo label Jul 3, 2017
@rmarquis rmarquis added this to the 5.0.x - later milestone Jul 3, 2017
@rmarquis rmarquis modified the milestones: 5.0.x - later, 4.8.x - new features Jul 12, 2017
@rmarquis
Copy link
Owner Author

rmarquis commented Jul 14, 2017

For the sake of consistency and code simplification, each pacman command that is extended to the AUR should have a direct AUR specific command equivalent:

-Sa  -> sync
-Ssa -> search
-Sia -> info
-Swa -> downloadonly
-Sua -> sysupgrade
-Qua -> upgrades
-Sca -> clean
-Scca -> cleanall
  • makepkg should be renamed to downloadonly (as per pacman convention)
  • update should be renamed to sysupgrade (as per pacman convention)
  • check should be renamed to upgrades (as per pacman convention)
  • clean and cleanall should be added (allow cleaning of specific source directory #715)
  • download should be removed. There isn't a pacman equivalent as ABS integration isn't done in pacaur for a variety of reason, it can be done better done directly by cower -d / auracle download, and could be readded once pacman eventually integrates ABS.
  • check the selective target implementation, as it might not make sense with the sysupgrade naming scheme. Maybe remove it, since it can be replaced by sync --needed.

Man page descriptions should be adjusted accordingly.

Note to self: probably a good idea to ask early feedback on forums. Maybe also add a switch to enforce one set of commands instead of allowing both of them at the same time?

@abouvier
Copy link
Contributor

Why don't you use the getopt command instead of the getopts built-in? It is much more powerful and supports native long option names. This command is provided by util-linux which is in the base and base-devel group. No more $OPTARG ugly hacks needed! See /usr/share/doc/util-linux/getopt/getopt-parse.bash.

@rmarquis
Copy link
Owner Author

There are a number of reasons that made me choose getopts over getopt in the past: built-in, more robust with option that requires an argument - though I don't know if that still the case, but the bottom line is that I hate both. I am planning to use the parseopts library provided by makepkg instead.

@rmarquis
Copy link
Owner Author

rmarquis commented Jul 24, 2017

Partially done in f67d43b, bb02226, 9291462 and 60add4b.

Still missing:

An equivalent of -de would be good to have, as it is useful to quickly view a PKGBUILD. This could be an eauivalent of the upcoming(?) -B pacman flag.

@blueyed
Copy link
Contributor

blueyed commented Aug 7, 2017

As stated in #744 (comment) it seems odd that downloadonly builds a package?!

-Sw -> downloadonly

makes sense.

makepkg should be renamed to downloadonly (as per pacman convention)

This is what I don't get probably.

@rmarquis
Copy link
Owner Author

rmarquis commented Aug 7, 2017

The logic behind this choice is to have similarly names flags as the repo operation. Since -Sw is downloadonly, I choose it as the -Swa equivalent too, but this might not be a wise decision. With retrospect, the long pacman options might not be known very well if at all, so this won't help in clearing any confusion.

While sync, info, search and clean are unambiguous, downloadonly, sysupgrade and upgrades might very well be. Here is another proposal:

-Swa -> buildonly
-Sua -> update
-Qua -> check

downloadonly could be kept for downloading the PKGBUILD and install files only, as an equivalent to the current -d short option.

@rmarquis
Copy link
Owner Author

rmarquis commented Aug 8, 2017

Adjusted in 668393e and 0487a92. This also solves the semantic issue about the selective target implementation, which stays in the code.

Todo:

  • add cloneonly (rather than downloadonly)
  • check update vs upgrade semantic (both are used across the project) (done, use upgrade as this is consistent with pacman usage)

@rmarquis
Copy link
Owner Author

rmarquis commented Sep 7, 2017

Download only / clone only is better left to cower/auracle or any other command line shortcut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants