Commit graph

138 commits

Author SHA1 Message Date
Anna bd162cc317
Merge pull request #454 from Morganamilo/makepkg
Stop prepare running twice
2018-06-02 15:23:51 +01:00
morganamilo 942e389d85
Stop prepare running twice
Prepare ends up getting ran twice every time we install a package,
theres not problems with doing so apart from a little inefficiency.

Previously the install flow would be like this:
	downlod sources + verify
	prepare + pkgver bump
	full build (prepare included)

Now on the last point pass no extract to use the srcdir from the
previous command and pass noprepare and holdver because we allready did
these steps previously.
2018-06-02 14:16:00 +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 9afd671905
Support any PKGDEST and PKGEXT
Pacman 5.1 removes the symlink to the current directory for built
packages. This causes Yay to break for people who have set an external
PKGDEST.

Pacman 5.1 also brings an improved --packagelist option. This makes
it much simpler to find where packages will be placed. Hence this fix
also simplifies the code.

Yay has an -Sc option to clear it's cache. If using an external PKGDEST
this is now mostly useful for clearing out old pkgbuilds and sources.
paccache should be used for cleaning build packages.
2018-05-31 05:42:03 +01:00
morganamilo 7a1e2de6cd
Simplfy upgrade skipping 2018-05-30 03:21:17 +01:00
morganamilo e76f978d63
Only show warnings for pkgs that are being updated
The previous warning system would show warnings recursivley for all
packages being resolved. While I like this, other have complained at it
being overly verbose.

Either way the main purpose of this is to allow warnings to be printed
before the upgrade menu shows. This is mostly just to get a usable
warning system.

This may change if a better solution is found.
2018-05-29 23:39:02 +01:00
morganamilo b140e66f6a
Improve --asdeps and --asexplicit handling
Correctly handle --asdeps and --asexplicit for both repo packages and
aur packages.
2018-05-29 22:35:58 +01:00
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