Commit graph

105 commits

Author SHA1 Message Date
Sergio Correia 9f62663888
Minor cleanups to keep the linter happy
* Unexported:
  - QuestionCallback
  - SliceToStringSet

* Unreachable return in parser.go

* Unneded else in dependencies.go

* Punctuation in error message in install.go
2018-03-19 11:39:47 -04:00
Sergio Correia 32f8396eca
Add --gpg' and --gpgflags` flags
`--gpg' is the GnuPG binary, while `--gpgflags' are extra
arguments to be passed to  GnuPG.

Also Update man page and usage regarding GnuPG options.
2018-03-17 19:15:29 -04:00
morganamilo c091460d8c
Use a question callback for ignorepkg
The callback is set to allways silently say yes, When passing to pacman
for the intall pacman will then ask the question giving the user
a chance to answer.
2018-03-16 00:18:13 +00:00
morganamilo ca4dac0685
Update doc for --rebuild 2018-03-14 15:02:24 +00:00
morganamilo 18af700053
Add --rebuild flag
Similar to the --redownload flag, when specifed targets will be rebuilt
even if an up to date version is cached. --rebuildall can be used to
ensure uninstalled dependencies are rebuilt as well.

Additionally, unlike --redownload there is also --rebuildtree. This
causes a rebuild and reinstall of a package and all of it's dependencies
recursivley. This is designed for when a libary updae, breaks an
installed AUR package due to a partial upgrade. polybar is a common
example

--rebuild allows you to easily skip the cache and rebuild against a newer
libary version. --rebuildtree is a more nuclear option where you can
rebuild the whole dependency tree.
2018-03-14 15:01:20 +00:00
Morgana f9d4d9bafb
Merge pull request #235 from Morganamilo/fix#228
Add support for db/name
2018-03-13 17:14:22 +00:00
morganamilo 74196306fa
Respect --ignore and --ignoregroup flags
And enable version colouring on repo ignore and devel ignore
2018-03-12 23:46:23 +00:00
morganamilo 2bd4cdc590
Pass yay -Sl to pacman 2018-03-11 23:34:09 +00:00
morganamilo 5446f5d0a4
Add support for db/name
Adds the ability to pick which database to install a package from. This
is extended to also support for AUR packages. For example `extra/git`
and `aur/yay` should both work`. When not explicitly requesting
a database repo packages will be choosen over the AUR.

This features extends to yogurt mode, listings where a package shows up
in multiple database/the AUR is now handled.

The aur does not have a real pacman databse like core, extra ect. But
can be accessed as if was one with `aur/name`. Using Yay with a pacman
repository named "aur" is undefined.
2018-03-11 21:32:36 +00:00
Jguer 803d957282 Fix typos
Signed-off-by: Jguer <me@jguer.space>
2018-03-11 21:19:19 +00:00
morganamilo d03890a3c4
Remove unneeded functions 2018-03-10 03:04:54 +00:00
morganamilo 287bac04c9
Use parseNumberMenu() for yogurt mode 2018-03-10 03:04:54 +00:00
morganamilo 296f59f855
Handle sudoloop flag 2018-03-08 16:06:40 +00:00
morganamilo 2bb8070213
Add flags for all missing config options
With this The user should never have to manually edit the yay config
file. All options can be set directly through yay using
`yay --<option> <value> --save`
2018-03-08 14:56:53 +00:00
morganamilo 15409ad4e5
Add doc for --mflags 2018-03-07 23:36:09 +00:00
morganamilo cee0d74643
Add --mflags option to pass args to makepkg 2018-03-07 23:18:00 +00:00
morganamilo dec395753c
Remove accidental debug string 2018-03-07 22:58:13 +00:00
morganamilo 5a7654909d
Add doc for --save 2018-03-07 22:37:44 +00:00
morganamilo 33b76045e7
Add --save option
Before setting options such as --topdown would be saved to the config
file automaticly when used. Now this is no longer done by default and
isntead the --save flag must be passed for this to happen.

If --save is passed the config is now saved as soon as the argument
parsing is finished apposed to before where it was saved when yay exits.
This means that config changes will now apply if the user does a ^C
before yay finishes.
2018-03-07 22:34:45 +00:00
Morgana a7be7a839d
Merge pull request #208 from Morganamilo/redownload
Add support to skip pkgbuild downloads.
2018-03-07 21:56:18 +00:00
morganamilo a6cab60888
Add --redownloadall option and fix manpage descs 2018-03-07 21:32:55 +00:00
morganamilo 9b4264f346
Set default config in the correct place 2018-03-07 16:26:15 +00:00
morganamilo 74ef0beaed
Fix error when cacheHome does not exist
And refactor initYay out into smaller parts
2018-03-07 05:27:54 +00:00
morganamilo 1d3a87bd70
Move ~/.config/yay_vcs.json to ~/.cache/vcs.json
And refactor the file paths to constants in config.go
2018-03-06 17:43:57 +00:00
morganamilo d5fc1e0de5
Update docs for --redownload and --noredownload 2018-03-06 15:17:55 +00:00
morganamilo f66349696e
Add support to skip pkgbuild downloads.
If a pkgbuild is already in cache and matches the version on
the aur skip the download.

The version we check comes from the .SRCINFO file on disk which is never
updated. (updates through pkgver() edit the pkgbuild but do not effect
the .SRCINFO). Therefore if the the version of the .SRCINFO matches the
AUR's version there must not be  an update.

In the case of the on disk version being newer than the AUR version we
can assume user interaction and they probably do not want it overwitten
so in that case also skip the download.
2018-03-06 04:08:37 +00:00
morganamilo 80c59a74cc
Use git ls-remote to track devel updates
Use the command `git ls-remote <url> <branch>` to track devel updates
rather than relying on the GitHub API.

This allows devel update to work for every git based source and
elimantes the rate limiting from GitHub.

The yay_vcs.json format has changed to better support packages which
multiple vcs sources and to track the protocols each source uses. And
track the branch that each source tracks in it's fragment.
2018-03-05 23:05:13 +00:00
morganamilo 55bfd619dc
Improve printing
Add ( and ) to "installed" to match groups and out of date
Show popularity as well as voted in yogurt mode
Show download and install size in yogurt mode
Remove printing of white and black
Fix incorrect message on number menu
Yellow is now almost never used
Use `v` instead of `r` when printing version
show when a page was marked out of date on search and info
2018-03-02 20:32:33 +00:00
morganamilo ed2c231a72
Refactor printing
Drop the Fb suffix for printing colours
Seperate bold, fb and bg printing into individual functions
2018-03-02 04:39:16 +00:00
J Guerreiro 35599cdccf
Merge pull request #193 from Morganamilo/updatemanpage
Update manpage and usage
2018-03-01 09:47:49 +00:00
morganamilo 8e7af3e186
Update manpage and usage
Reword a lot of manpage and usage options.

Remove the `-Yg` and `-Y --getpkgbuild` options from documentation and
code as they have moved to `-G` and `--getpgkbuild`.

Update the version in the man page. Because our version is based on our
commit number added a `+` after the version number to indicated that
this is the version the manpage was written at but it also applies to
newer versions.

Added missing `-c --complete` and `-f --fish` options to the manpage.
But left them out of usage.

Added myself to the authors section. I do feel a bit bad about adding
myself and only myself but I thought it was not a good idea to add 20
names and fill up the page. There's currently no rules on who should be
added and not really a huge need for them right now. I guess we can just
add more people when we deem they belong there whatever that criteria
is.
2018-03-01 02:09:24 +00:00
morganamilo 111a7f73dc
Hide pacman output when setting install reason
Stderr is shown if Pacman returns non 0.
2018-02-28 17:41:42 +00:00
Morgana 9c4b4d73f9
Merge pull request #183 from Morganamilo/fix#88
Save the VSC info when install finishes.
2018-02-27 19:08:01 +00:00
morganamilo 8fb83f3e70
Save the VSC info when install finishes.
Save the VSC Info as soon as the package install finishes. This should
ensure the VSC db does not end up in an incorrect state if an install
fails or is cancelled by the user.

This also adds better support for split packages. When one or more
packages are installed from the same base each individual package is
added to the db not just the base. This allows us to track individual
updates from the same base so that if one package gets updated we don't
assume all packages in the base are updated.
2018-02-27 17:14:40 +00:00
Daniel Martí 73d6f9b1ab all: remove unused code
And simplify some code too.
2018-02-27 10:16:53 +00:00
morganamilo 04a9830e0b
Fix tests 2018-02-27 03:41:39 +00:00
morganamilo 716d775d5f
Improve formatting
Ignorepkg also colours version differences like the upgrade menu
Tweaked formatting when asking for users to eneter number
2018-02-27 02:02:33 +00:00
morganamilo 2856a7276c
Refactoring and improving insall process
This commit mostly focuses on merging the install() and upgradePkgs()
functions to be more integrated. Instead of both making their own aur
queries they now both combine theyre needes into one query. This gives
us a speed up and allows us to easily print orphands, misising and out
of date in one clean block.
2018-02-27 02:02:33 +00:00
morganamilo 3fb77b1d72
Use aurInfo() for -G 2018-02-27 02:02:33 +00:00
J Guerreiro f000afaa42
Merge pull request #168 from seankhliao/master
add config.String() to pretty print default config in valid json
2018-02-27 01:44:45 +00:00
morganamilo 85a99198c3
Fix handling of -- in parser 2018-02-20 17:03:50 +00:00
Sean Liao 56db82ed10 fix stray tab 2018-02-20 23:12:07 +08:00
Sean Liao d12685debc separate printing default and current config 2018-02-20 23:08:29 +08:00
Sean Liao 57773b6c2d add config.String() to pretty print default config in valid json 2018-02-20 22:24:48 +08:00
morganamilo 4298e77632
Fix passing incorrect flags during yay -Sy[s,i] 2018-02-17 23:00:18 +00:00
morganamilo d04ca15228
Hang on first sudo
Currently sudoloop is run in parallel with the rest of the code this
causes the first sudo prompt to ask for a password while the code
continues running.

Instead hang on the first sudo, giving the chance for the user to enter
a password then continue the loop in the background.
2018-02-16 18:12:22 +00:00
Jguer 6913770b4d Merge branch 'lessmakepkg' of https://github.com/Morganamilo/yay into Morganamilo-lessmakepkg 2018-02-16 17:16:56 +00:00
Jguer 9f734bdf8d References #147. Sudo loop is off by default 2018-02-16 13:15:05 +00:00
morganamilo e1f3cb6682
run cleanafter after finishing the install process
Cleanafter is now run right at the very end of install instead of after
each makepkg command.
2018-02-15 21:41:49 +00:00
Brian Allred 510bd7e172 Fix extended info (-Sii) not passing to pacman 2018-02-14 10:10:07 -06:00