Commit graph

129 commits

Author SHA1 Message Date
morganamilo 33d056e9ac
Split Targets to Targets and Explicit
Targets are used for tracking wether a package should be marked as
explicitly installed or as a dependency. This is not ideal because you
can have a target such as java-environment that resolves to a different
package.

Therefore Targets are now used only for the initial dependency resolving
and checking for missing dependencies. The Explicit set is now used to
mark what packages are explicit, seperate from the targets.
2018-05-29 16:47:43 +01:00
morganamilo d51205194e
Support skiping updates and showing warnings
The warnings were moved down to after the upgrade menu, mainly because
it is a lot easier to do this way, it may get moved back if it can be
done in a non hacky way,
2018-05-29 13:15:40 +01:00
morganamilo b76d085418
Improve provider menu
Sort the provider menu alphabetically. Always ensure direct matches show
up first. This ensures hitting enter for the default value will always
be the same package that the user/dependency requested if an exact match
exists.

If a package is already installed pick that instead of providing a menu.

Ensure duplicates do not show up in the menu.
2018-05-29 13:13:33 +01:00
morganamilo 671f836ec5
Calculate makeDeps properly
MakeOnly would be set to true when moving from normal deps to make deps
But would incorrectly stay set to true when moving to the deps of the
following packages.

depOrder.Aur now only holds one package from each base like
depCatagories does.
2018-05-29 13:13:33 +01:00
morganamilo 2e7a022b7c
Use new dependency code in install()
The old depTree and depCatagories has been changed to depPool and
depOrder in the install function.
2018-05-29 13:13:33 +01:00
J Guerreiro 0c49f0f7cb
Merge pull request #419 from Jguer/impgopkgchange
Implement new gopkgbuild Newer method
2018-05-15 12:48:39 +01:00
Jguer 3dc5238bd2 Implement new gopkgbuild Newer method
Signed-off-by: Jguer <me@jguer.space>
2018-05-14 22:22:47 +01:00
Jguer d15f899809 Fixes #417
Signed-off-by: Jguer <me@jguer.space>
2018-05-14 18:33:48 +01:00
morganamilo 1b6d80f122
Fix --ignore flag while skipping updates ammended
Ammend to 58d53b1
Thought this was already included in the commit.
2018-05-12 00:24:47 +01:00
morganamilo 2bf310d37c
Fix --ignore flag while skipping updates
If --ignore was specified on the command line and the user skips
packages using the number menu, packages would not be properly skipped
because they the manual --ignore would overide the --ignore from the
menu.

Now correctly combine both --ignore flags into a single combined flag
when passing to pacman.
2018-05-12 00:17:10 +01:00
morganamilo 5e712b221e
Add missing --ignorearch arg to makepkg call 2018-05-10 21:02:03 +01:00
Jguer 66362aa981 Bump MAJOR_VERSION
This bump reflects the big change introduced with using git cloning.
Therefore we know all versions pre-6 do not use git clone

Signed-off-by: Jguer <me@jguer.space>
2018-04-26 20:53:34 +01:00
Tom Swartz 1c9715dddf Fix typos 2018-04-23 13:06:56 -04:00
morganamilo 8ccb5de6ac
Prefix aur/ to aur updates 2018-04-17 19:54:44 +01:00
morganamilo 63471b9ede
Fix misspellings and typos 2018-04-17 18:01:34 +01:00
morganamilo 110a905a0c
Use filepath.Join() for adding paths together 2018-04-17 01:32:31 +01:00
Jguer 0216b116f4 Fix typos and lint
Signed-off-by: Jguer <me@jguer.space>
2018-04-16 14:13:11 +01:00
morganamilo cf47746d20 Use git clone for pkgbuild downloading
Use git clone over tarballs for pkgbuild downloading during -S. This
option can still be toggled using the config flags.

The config option for selecting clone or tarball will be overiden if an
existing package is cached. The method used to download the package
perviously will be used regardless of the config.
2018-04-16 14:12:02 +01:00
morganamilo 694c74f5b4
Remove no longer needed function and lint 2018-04-16 00:18:01 +01:00
morganamilo 24f596959d
Dont bump pkgver() while downloading sources
Previously we ran pkgver() right after dowloading sources. This is
a problem because prepare() should be called and all dependencies
should be installed before pkgver().

Instead bump the pkgver while building then get the new pkgver used for
install. Previously we parsed `makepkg --printsrcinfo` to get the new
version. Insead use `makepkg --packagelist` as it is much faster.
2018-04-16 00:17:56 +01:00
J Guerreiro aa649d9b41
Merge pull request #349 from Morganamilo/fix#331
Lots of formatting tweaks
2018-04-12 15:40:22 +01:00
morganamilo ac571d314a
Support entering package name during askCleanEdit 2018-04-12 13:01:54 +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 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 072e8e6189
Fix number menu 2018-04-05 14:10:30 +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 00a1baf509
Fix number menu 2018-04-04 21:54:03 +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 b8ef531b76
Strip request targets instead of making a new one 2018-04-03 17:48:56 +01:00
Peter Dyer 4400ebc31e Skip SRCINFOs that cannot be parsed during gendb
Install will still abort if a SRCINFO cannot be parsed.
2018-04-02 19:27:16 +01:00
morganamilo e5c99778df
Strip db prefix from request targets 2018-04-02 17:50:04 +01:00
morganamilo ed964bf04d
Try alpmArch and any when looking for built pkgs.
Instead of trying to figure out if the package is of arch any just try
both.
2018-04-02 14:56:07 +01:00
J Guerreiro 5b7daa129a
Merge pull request #302 from Morganamilo/fix#287
Only pass needed upgrades to deptree
2018-04-02 12:48:53 +02:00
Jguer 307daf32e7 Rename functions to more standard go form and typo fix some variables 2018-04-01 19:54:33 +02:00
morganamilo a04dd94282
Only pass needed upgrades to deptree
To know what AUR packages need updating a rpc request is needed for all
packages. The dep tree is designed to cache everything to minimize the
amount of rpc requests. The downside of this is the dep tree ends up
with all sorts of packages in cache that it doesn't need. Then the
deptree tries to resolve deps for all of thoes packages.

By spliting the sysupgrade from the dep tree this stops this from
happening, it uses one more rpc request but also may lower the amount of
total rpc requests needed lated on.

This fixes a couple of tiny bugs such as triggering providers prompts
and printing AUR out of date messages for packages that are not going
to be installed.

This also fixes another display bug where repo packages from -Su would
not apear when printing the packages to be installed under [Repo].
2018-03-29 19:05:38 +01:00
J Guerreiro 85238c2a93
Merge pull request #277 from Morganamilo/gendb
Separate gendb from install
2018-03-25 18:04:36 +02:00
morganamilo 2b9437741e
Handle db/name with --redownload and similar flags
--redownload is meant to only download the targets the user provides.
If the user enters aur/foo then Yay will find the package foo from the
aur, --redownload will see thats not what the user entered and skips the
download.

This makes it so after the dep searching is done, all db/ prefixes are
dropped.
2018-03-23 17:07:20 +00:00
morganamilo 1e01eafb43
Separate gendb from install 2018-03-22 18:23:20 +00:00
morganamilo 2ea16836eb
Fix nothing to do if upgrading only repo packages
Dont display clean/edit menu when upgrading only repo packages.
2018-03-22 17:12:33 +00:00
morganamilo 0c0cd4f883
Add utils.go 2018-03-22 16:38:21 +00:00
Morgana ac02498177
Merge pull request #269 from Morganamilo/conflicts
More conflict checking
2018-03-22 15:27:39 +00:00
morganamilo a1a05bced4
Don't mark targets as dependencies 2018-03-22 15:22:05 +00:00
morganamilo 4a8ec944bf
Move conflict checking to its own file 2018-03-22 07:19:25 +00:00
morganamilo 804bd45f2c
More conflict checking
This commit extends the conflict checking a lot, it adds support for:
	Conflicting with provides as well as actual package names
	Reverse conflicts
	Inner conflicts

Both normal conflicts and inner conflicts are run in parallel.
Messages are now printing when checking conflicts.

This also fixes packages sometimes being listed as conflicting with
themselves.

The inner conflict is a little verbose and could be toned down a little
but I am insure exactly how to tone it down.
2018-03-22 07:18:58 +00:00
morganamilo 98ea801004
Pass -Su to pacman during sysupgrade
Previosly during `yay -Su` Yay would pass
`pacman -S <packages that need upgrade>` to pacman.

Instead pass `pacman -Su --ignore <number menu choices>`

This allows yay to handle replaces and package downgrades `-Suu`
2018-03-22 07:13:18 +00:00
morganamilo 885614ef45
Move repo install to after numbermenus 2018-03-21 00:45:26 +00:00
morganamilo df11b85e54
Implement the provider question and imitate pacman
Implement the alpm question QuestionSelectProvider and print the select
menu in a way similar to how pacman does it.
2018-03-20 15:56:13 +00:00