Commit Graph

75 Commits

Author SHA1 Message Date
morganamilo
ec48698f35
Add --{no,ask}removemake 2018-07-21 14:20:00 +01:00
morganamilo
3bdb534321
Separate Pacman upgrade and AUR Upgrade by default
Currently When performing a system upgrade, Yay will first refresh the
database then perform the repo and AUR upgrade. This allows Yay to add
some features such as better batch interaction, showing potential
dependency problems before the upgrade starts and combined menus
showing AUR and repo upgrades together.

There has been discussion that this approach is a bad idea. The main issue
people have is that the separation of the database refresh and the upgrade
could lead to a partial upgrade if Yay fails between the two stages.

Personally I do not like this argument, there are valid reasons to Yay
to fail between these points. For example there may be dependency or
conflict issues during the AUR upgrade. Yay can detect these before any
installing actually starts and exit, just like how pacman will when
there are dependency problems.

If Yay does fail between these points, for the previously mentioned
reasons or even a crash then a simple refresh will not cause a
partial upgrade by itself. It is then the user's responsibility
to either resolve these issues or instead perform an upgrade using
pacman directly.

My opinions aside, The discussions on the Arch wiki has reached
a decision, this method is not recommended. So to follow the decided
best practises this behaviour has been disabled by default.

This behaviour can be toggled using the --[no]combinedupgrade flag

It should be noted that Yay's upgrade menu will not show repo packages
unless --combinedupgrade is used.
2018-06-30 03:40:19 +01:00
morganamilo
ea5a94e0f8
Remove default usage of --ask
--ask is no longer used when installing AUR packages, instead pass no
confirm when we know there are no conflicts and wait for manual
confirmation when there are.

This means that when there are no conflicts there should be no change in
behaviour and the user will not need to intervene at all.

The old behaviour can still be used with --useask.
2018-06-22 15:17:34 +01:00
Jguer
2e8d2b4d2c
Bump MAJOR_VERSION 2018-06-19 11:33:07 +01:00
Stephen Brown II
b76fbc8694
Remove ShowDiffs from config struct
Following the improvements in #480, #485, #486, a tiny bit of cleanup for a lone, forgotten line.

Plus the typo had been bugging me since I first saw it.
2018-06-11 15:11:16 -05:00
morganamilo
42f0508625
Add upgrademenu to match {clean,diff,edit}menu 2018-06-11 20:12:17 +01:00
morganamilo
01fa34093f
Support answerdiff to match answer{clean,edit} 2018-06-11 20:11:38 +01:00
morganamilo
065efdbcc0
Enable clean menu by default
I swear set this to true before merging 8430c41 but apparently I didnt.
2018-06-11 19:50:03 +01:00
morganamilo
8430c41be9
Rework editing and diff showing
Clean build needs to happen before downloading pkgbuilds so that they
can be deletd before downloading.

Editing and diff viewing needs to happen after downloading the
pkgbuilds.

Prevously we asked to clean and edit at the same time. Then clean,
download pkgbuilds and open the editor.

This poeses a problem for diff viewing and editing. It's likley that the
user will see the diff and use that to decide if they want to edit the
pkgbuild. Using the current method, the user will be asked to view diffs
and edit before actually seeing any diffs.

Instead split cleaning diff showing and editing to three seperate menus
in the following order:
	show clean menu
	clean
	download pkgbuilds
	show diff menu
	show diffs
	show edit menu
	edit pkgbuilds

Also each menu is seperatly enableable. By default only the diff menu is
shows. If the user wishes to clean build, edit pkgbuilds or disable
diffs then the user can use the --[no]{clean,diff,edit}menu flags. This
replaces the --[no]showdiffs flags.
2018-06-10 16:11:23 +01:00
morganamilo
f20fbd25c1
Implement diffs for pkgbuild viewing.
diff viewing can be toggled via --[no]showdiffs. When enabled diffs will
be shown for packages between the current HEAD and upstream's HEAD.
Packages downloaded via tarballs will be shown in full using the editor

git diff is used to show diffs. Therefore the pager for diffs can be
set via the PAGER and GIT_PAGER enviroment variables.
2018-06-01 18:11:13 +01:00
morganamilo
682040319e
Add config option for pgp key fetching 2018-05-31 16:36:36 +01:00
morganamilo
0ae8fc2a06
Support --aur and --repo flags
These flags limit operations to only check the repos or only check the
AUR. These flags apply to -S, -Si and -Su.

-a may also be used as a short option for --aur. --repo has no short
option as -r is taken.
2018-05-31 16:25:49 +01:00
morganamilo
c464af6b9b
Implement config option for provider searching 2018-05-29 17:40:35 +01:00
Jguer
84569ef6d9 Fix completions from using wrong path. Regression introduced in filepath join
Signed-off-by: Jguer <me@jguer.space>
2018-04-21 16:43:12 +01:00
morganamilo
110a905a0c
Use filepath.Join() for adding paths together 2018-04-17 01:32:31 +01:00
Jguer
bab050a354 Update const var
Signed-off-by: Jguer <me@jguer.space>
2018-04-16 14:17:14 +01:00
morganamilo
6d876a738c Add --gitflags and --[no]gitclone flags 2018-04-16 13:42:15 +01:00
morganamilo
c75bfe4947
Ask if user wants to contunue right after askedit 2018-04-11 20:23:43 +01:00
morganamilo
06406d7cee
More formatting tweaks
Ensure aurWarnings will always be printed out in one block
use '->' for printing aur warnings and ignored upgrades
use '->' for conflict printing
use '->' for key importing
Say PGP keys not GPG keys
Add back green for input prompts
Use 4 spcaces over \t
2018-04-11 20:23:43 +01:00
morganamilo
191b5ebe47
Make colours more consistent and less ott
Use yellow ==> for warning messages
Keep white text no matter the colour of ==>
Use cyan for pkgname printing like it already is in places
2018-04-11 20:23:43 +01:00
morganamilo
906748ebde
Don't mark repo upgrades as deps during sysupgrade
Before `yay -Syu` called `pacman -Sy <pkgs to upgrade>`
We then later switched to it calling `pacman -Syu` this lead to yay
seeing no targets to when it was upgrading a bunch of packages it
assumed they must be deps. Correct this by adding repo packages to the
targets list.

Also ensure we dont mark packages as dependencies if they are already
installed. For example we install `foo` which requires `bar>5` but we
only have `bar=4` installed. In this case installing `foo` will pull bar
in as a dependency but it should not be marked as such because it
already exists.
2018-04-11 05:35:44 +01:00
morganamilo
60b111545a
Tweak editor input loop
New line before output
Use less bold
Highlight editor and visual variables
Use cyan for highlighting
Use arrow prefix
Use loop instead of goto
2018-04-09 21:04:57 +01:00
morganamilo
f1e98e45a6
Support flags when using the editor
Added --editorflags alongside --editor
$VISUAL and $EDITOR are split on whitespace
2018-04-09 20:50:18 +01:00
morganamilo
a33414b723
Repect --answer* flags when --noconfirm is set
This means that menus are now printed in noconfirm mode, I don't see
this as a problem because Pacman still prints its questions during
noconfirm.

When the user has edited pkgbuilds Yay will prompt if they want to
continue with the intall. This prompt is also enabled during noconfirm
to ensure the user is happy with the pkgbuilds.
2018-04-04 22:22:33 +01:00
morganamilo
8556acdd5f
Add flags for sort order and automating menu input
Added:

--sortby <votes|popularity|id|baseid|name|base|submitted|modified>
--answerclean
--answeredit
--answerupgrade
--noanswerclean
--noansweredit
--noanswerupgrade

TODO: docs and completion
2018-04-04 21:53:32 +01:00
morganamilo
1864ec3083
Respect --color
`--color auto` is the same as `--color always` until a suitable method
for auto has been decided.
2018-03-21 05:42:19 +00: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
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
Sergio Correia
6f25da860c Ask if yay should try to import missing PGP keys
When building a package from the AUR for which there are missing keys,
yay will now prompt the user whether it should try to import such keys
using gpg:

[...]
:: Parsing SRCINFO (1/3): libc++ (libc++abi libc++)
:: Parsing SRCINFO (2/3): aurutils
:: Parsing SRCINFO (3/3): cower
==> GPG keys need importing:
        487EACC08557AD082088DABA1EB2638FF56C0C53, required by: cower
        11E521D646982372EB577A1F8F0871F202119294, required by: libc++ (libc++abi libc++)
        B6C8F98282B944E3B0D5C2530FC3042E345AD05D, required by: libc++ (libc++abi libc++)
        DBE7D3DD8C81D58D0A13D0E76BC26A17B9B7018A, required by: aurutils
==> Import?  [Y/n]
[...]

Default is to try to import the problematic keys ([Y/n]).
2018-03-12 17:11:31 -04:00
morganamilo
cee0d74643
Add --mflags option to pass args to makepkg 2018-03-07 23:18:00 +00:00
morganamilo
7e6def5a5f
Add GitBin and tweak defaults
Use cacheHome for builddir instead of hardcoding ~/.cache
Use the command names in config.*Bin options.

For example PacmanBin is changed to just "pacman" this means yay will
call the pacman commit in PATH. If the user wants to use a different
binary they can still specify a full path in the config.
2018-03-07 23:14:42 +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
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
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
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
Jguer
e800984e8f Release ready
Signed-off-by: Jguer <me@jguer.space>
2018-02-27 01:51:51 +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
Jguer
601f56c348 Update vendor dependencies to latest version. Prepare for stable base
Signed-off-by: Jguer <me@jguer.space>
2018-02-27 01:34:24 +00:00
Sean Liao
57773b6c2d add config.String() to pretty print default config in valid json 2018-02-20 22:24:48 +08:00
Jguer
e0dc149c76
disable saving noconfirm value 2018-02-16 17:44:54 +00:00
Jguer
9f734bdf8d References #147. Sudo loop is off by default 2018-02-16 13:15:05 +00:00
Serede Sixty Six
aba42b109e Added space before [Y/n] and [y/N] prompts. 2018-02-15 01:58:07 +01:00
Jguer
3f69df424f
fixes some display messages and eliminates secret sauce 2018-02-08 22:51:43 +00:00
Jguer
c0901ff86b Fixes --noconfirm. Changes default build location to ~/.cache/yay/ 2018-02-07 12:06:56 +00:00