Commit graph

159 commits

Author SHA1 Message Date
morganamilo 80e66ce479
Allow many aur packages to be installed at once.
After building an AUR package don't install it right away. Instead queue
it for install.

Then when a package comes along that does not have all of its
dependencies satisfied, install the queued packages before builting.

This allows a standard AUR update to be done with one transaction, while
building AUR packages with long dependency chains will work as normal.

This feature is behind the `--batchinstall` flag.
2019-06-17 14:25:59 +01:00
Jguer 86b73689a3
Should fix #960. Bumps patchversion 2019-06-03 23:39:30 +01:00
morganamilo 112046853b
Use correct case on go-alpm import 2019-04-23 16:53:20 +01:00
J Guerreiro 888a289a1b
Revert "Add SudoBin" 2019-03-29 22:09:27 +00:00
Pierre-Alain TORET 877c794bc2 Add SudoBin and SudoFlags 2019-03-27 15:16:39 +01:00
Motkov Kirill 14ac756298 Code improvements
- Removed yoda condition.
- Renamed/removed variables which shadows built-in names.
- Rewrited if-else-if-else chains to switch statements.
2019-03-10 16:36:01 +03:00
Motkov Kirill 0878b485ae remove suspicious err reassigns 2019-03-05 23:10:04 +03:00
Motkov.Kirill a33801615c miss assignment to err 2019-03-05 11:10:56 +03:00
morganamilo 5ce4a49687
Update go-alpm 2019-02-04 16:56:02 +00:00
Jguer 0f57ed0ba8
Update to version 9.1.0 2019-01-20 15:52:21 +00:00
Jguer d3a9082f2a
Update patch version of yay to reflect makefile changes 2018-12-07 14:00:17 +00:00
Jguer 47373c5631
update version 2018-12-06 08:09:05 +00:00
Jguer 5bcadc58ac
Fix tests and prepare for release 2018-12-01 15:03:46 +00:00
morganamilo 556a76c38d
Fix each iota not starting at 0 2018-11-29 20:42:06 +00:00
Joe Groocock 52bf777e67
Print errors on stderr
This makes a start on fixing https://github.com/Jguer/yay/issues/715
It is by no means a complete solution, but instead a start
2018-11-20 22:27:30 +00:00
Jguer 2ed7df4f5a
Unexport consts. Make default a literal
Signed-off-by: Jguer <me@jguer.space>
2018-10-22 21:00:16 +01:00
Jguer 1f1cee7023
Update manual config version 2018-10-18 09:19:45 +01:00
Jguer 621b8aac43
Update constant version. Add transitional support for patch version 2018-10-08 18:46:51 +01:00
morganamilo 4fc6a1a711
Fix provider menu showing when it shouldn't
If the package is already installed, we need to check if it is in the
repos to see if it aplies to rebuild tree. Normally alpm will not prompt
us to select a provider if we already have one installed. An exception
comes up when we have a provider installed that is from the AUR. In this
case FindSatisfier() still asks us to select a provider.

Now make sure to never to never show the menu if the package exists in
the local repo.
2018-09-25 14:33:25 +01:00
Jguer 9ac4ab6c25
Update to 1138 2018-09-24 17:35:13 +01:00
Peter Dyer e6238d32fa Set SigLevel to 0
Previous default SigLevels caused 3rd party databases to take a very long time to
load and also to not load properly. Probably due to missing keys(?).
Pacman takes a long time to check the databases. For now, always set to
SigLevel 0 like how go-alpm did in its config parsing. Needs more
looking into for a proper fix.
2018-09-19 19:52:58 +01:00
morganamilo b2f636d93b
Use go-pacmanconf for config parsing
This moves the config parsing from out of alpm and into the
go-pacmanconf libary plus some boilerplate code to get it into our alpm
config.

This makes sense as many config options such as UseColor and CleanMethod
have nothing to do with alpm and only relate to pacman.

pacman-conf is used instead of direct config parsing. This tool resolves
defaults and includes for us, so we don't need to handle it.

It is now safe to drop all the config parsing from go-alpm.
2018-09-10 23:07:34 +01:00
Jguer 6e0797a8c7
Set version manually for gcc-go
Signed-off-by: Jguer <me@jguer.space>
2018-09-05 09:21:11 +01:00
morganamilo c004364864
Fix builddir defaulting to config instead of cache 2018-09-04 23:19:31 +01:00
Jguer a109ea480c
Set version manually for gcc-go
Signed-off-by: Jguer <me@jguer.space>
2018-09-04 20:18:33 +01:00
morganamilo 00b880baf9
Fix depends sometimes being ordered incorrectly 2018-09-04 17:48:59 +01:00
morganamilo 8c1658df0b
Expand environment variables in config 2018-08-31 21:20:40 +01:00
Jguer b757d0abd3
Set correct version for manual builds
Signed-off-by: Jguer <me@jguer.space>
2018-08-31 13:33:01 +01:00
morganamilo 0454e8918b
Add --aururl 2018-08-19 05:10:24 +01:00
Alexander F. Rødseth 29f3e011ec Only minor changes 2018-07-31 11:15:17 +02:00
morganamilo bc6028348b
Make the completion refresh time configurable
The default setting is 7 days. The user can specify a different time in
days. -1 can be set to never refresh while 0 can be used to always
refresh.
2018-07-26 13:54:13 +01:00
Anna 96532c0b27
Merge pull request #562 from Morganamilo/#560
Add --makepkgconf
2018-07-24 13:08:21 +01:00
morganamilo 4af671afac
Add --[no]makepkgconf 2018-07-24 13:07:17 +01:00
morganamilo e28f4f3431
Refactor continueTask()
The main reason behind this is for future localisation. yes and no can
be set to the localized equivalent and it should just work.

This Refactor also changes the function in ways which make it much less
confusing.

The param is no longer reversed and changed to a boolean. Before you had
to pass in Yy to get a default of no and vice versa.

The function now retuens false for no and true for yes. Before it would
return true if the default option was choosen.
2018-07-23 13:49:45 +01:00
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
Michael Rees 3df03c3291
Prettify repository download messages 2018-02-05 14:05:58 -06:00
morganamilo 0f0100b4d0
Fixes #122 properly
Options such as --devel are now striped from the parser before handling
the command but the option is still processed so that config.devel would
be true.

Also changed `changedConfig` to a global in config.go
2018-01-31 17:44:15 +00:00
Jguer ce1b09c94d
Fixes #125 2018-01-31 17:25:18 +00:00
Jguer 2f5c4df661
Updates var version so yay-git can update program version 2018-01-31 19:49:16 +09:00
Jguer ecc337c29f
Finishes porting text to new colour format. 2018-01-26 15:04:10 +00:00
Jguer 42889821d3
New print option, added new completion syntax, fixed fish completion 2018-01-21 02:48:40 +09:00
l4 8c1d64c06b local repo goes first
remove the old function

local repo goes first

exit on err passToPacman()
2018-01-16 00:09:32 +07:00
l4 b1e01b3af5
Merge branch 'master' into fix_query_info 2018-01-15 21:02:44 +07:00
l4 ba143bdb36 fix query info with -Si 2018-01-06 20:50:54 +07:00
morganamilo 68a9771327
Move passToPackman from config.go to cmd.go 2018-01-04 08:32:50 +00:00
morganamilo df27396fa0
Teach passToPacman how to use argParsers
passToPacman now takes and argParser as a paramater. And is implemented
for the simple cases in cmd.go. Although passToPacman is now left non
working in places which still try to usr the old call format and will
need to be reimplemented.
2018-01-04 08:32:50 +00:00
Jguer 6305f86a3a
Minor polishing using gometalinter. 2017-12-04 15:24:20 +09:00
Jguer 4c7f341dd2
References #64. Added optional afterclean. Updates man page. Adds entries to --help 2017-12-04 11:39:23 +09:00
Maxim Baz 34d0f372fd
Prevent file corruption by truncating the files 2017-11-21 00:41:55 +01:00
Jguer 58ab6fd06f File closure fixed on init 2017-10-19 14:59:26 +09:00
Jguer a46e6bfa7b Rollback on aggressive permission changes 2017-10-19 11:56:19 +09:00