Commit Graph

47 Commits

Author SHA1 Message Date
morganamilo
63471b9ede
Fix misspellings and typos 2018-04-17 18:01:34 +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
6125dd979e
Fix versioned dep checking
Before versioned deps with the same name would be combined into a single
version range.

For example:
`foo>1 foo>3 foo<4 foo<5` would be merged into the range `3<foo<4`

This was assumed to be fine because of course no package is going to
have conflicting dependencies `foo>3 foo<1` but what was not thought
about it that a package or packages could provide multiple versions of
a provider. Java being example, you could have 8 and 9 provided for at
the same time.

This then causes a problem when you try to install two packages at once,
one requiring `java<8` and the other `java>9` when combined this leads
to a range that can not be satisfied.

Instead we now never merge dependencies but check them all individually.

We also make sure to pull in all already installed providers. The reason
for this is, before if a package did not apear in the dep tree we
assumed it to be satisfied because of the .FindSatisfier in the dep
resolving. So if you installed a package that needs `foo=1` and you
already had a package providing that it would not be in the dep tree and
we assume it is fine. But if you install a package that needs `foo=1`
and install a package that prvoides `foo=2` then foo will all of
a sudden be in the dep tree but only version 2 will be there. For this
reason we also load all the already installed packages in so that the
`foo=1` will be there.
2018-04-03 01:47:42 +01:00
morganamilo
2e7bb5e7a3
Save provides separately from pkgnames
Now if `foo` wants to install `bar`

if you do `yay -S foo bar-git` Yay will detect bar is satisfied and not
try to install `bar` as well as `bar-git`.
2018-03-29 16:38:20 +01:00
morganamilo
31fecc3ec2
Don't check versioning for devel packages
Devel packages can't be trusted to sho their real provides. Pretend that
that the provide applies to all versions. In the rare case where the
dependency is unsatisfied pacman will refuse to install so no harm can
be caused.
2018-03-29 14:43:22 +01:00
morganamilo
1e01eafb43
Separate gendb from install 2018-03-22 18:23:20 +00:00
morganamilo
074ea4465a
Make aurInfo return a pointer 2018-03-22 18:11:00 +00:00
morganamilo
7fd2a74bd2
Lint 2018-03-22 16:39:27 +00:00
morganamilo
0c0cd4f883
Add utils.go 2018-03-22 16:38:21 +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
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
morganamilo
7eea7eb9b5
Fix and improve version checking
Fix typo where adding to has instead of depStrings

Error correcly when missing packages

Also handle cases where a package is provided multiple times. If one
package provies `foo=1` and another provides `foo=2` before the latter
would just overide the former version. Now both versions will be checked
against.
2018-03-17 02:09:17 +00:00
Morgana
4c4737d952
Merge pull request #247 from Morganamilo/versions
Check versioned deps during the dep fetching process
2018-03-17 00:40:43 +00:00
morganamilo
fae0c506cc
Support db/name for groups 2018-03-16 01:14:34 +00:00
morganamilo
69a86c6a78
Check versioned deps during the dep fetching process
Check versioned deps such as `foo>1` `foo=2` `foo<3`
2018-03-15 17:05:17 +00:00
morganamilo
47bb527a1b
Change getNameFromDep to allow getting the dep too 2018-03-15 14:23:12 +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
morganamilo
62e244db0f
Improve db/name system and add support for -Si 2018-03-13 21:38:10 +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
6e97fa7cb6
Ensure targets are never listed as make depends
when doing `yay -S foo bar` where `bar` is a makedep of `foo` in rare
cases bar would be listed as [aur make] even thought it was explicitly
requested.
2018-03-12 18:49:03 +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
Peter Dyer
c0402e61a6
Spellchecked comments and formatted to commenting standards.
Reformatted comments to have a space between // and the start of the
comment.
Added capital letters and punctuation.
Fixed most grammar and spelling mistakes.
Fixed date to yyyy/mm/dd.
2018-03-03 02:57:30 +00:00
morganamilo
cfd391b423
Add comments to describe certain functions
Comments have been added to a couple of functions here and there
where I feel warrent some explanation. Hopefully this makes it a little
easier for people to contribute.

I commented on a couple of functions but my main focus is:
	DepTree
	DepCatagories
	StringSet
	Arguments

These are parts that have been mostly written by me and might seem
confusing without taking a while to study the code. Especially the first
two mentioned. They're a little complex, I'm not sure if they need to be
This is just how I came up with them. Hopefully helping other people
understand them will let them come up with improvments I did not see.
I'm not the best at explaining things but I did try my best here.
2018-03-03 01:34:39 +00:00
Jguer
76a766c840 Small lint of project
Signed-off-by: Jguer <me@jguer.space>
2018-03-02 11:32:35 +00:00
Morgana
3109ae759e
Merge pull request #195 from Morganamilo/fixprovides
Fix duplicate packages when printing dependencies
2018-03-01 22:01:38 +00:00
morganamilo
2fbfbc4de1
Fix duplicate packages when printing dependencies
e01c4b3969 made some bad assumptions.
Removing the aliases caused packages to not installed when required only
through provides and not their package name. This fixes that by
re enabling the aliases and simply removing duplicates at the end.
2018-03-01 21:57:52 +00:00
morganamilo
4934d24643
Revert "Fix duplicate packages when printing dependencies"
This reverts commit e01c4b3969.
2018-03-01 14:30:16 +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
Morgana
238d3a0b6c
Merge pull request #187 from Morganamilo/fix#10
Better dep checking on split packages
2018-02-28 11:15:59 +00:00
morganamilo
d14654a141
Better dep checking on split packages
Split packages are built at the same time so make sure the dependancies
for all packages in the base are installed before building.
2018-02-28 03:55:23 +00:00
morganamilo
d75bb2bafb
Check for groups when creating the depTree
And if we do find a group just ignore it completley and pass it to
pacman.

Because it's ignored by the depTree it fails to show up when printing
whats to be installed under [Repo]. This is a minor visual thing for now
so I think it's probably best to figure that out at another point.
2018-02-27 20:48:25 +00:00
morganamilo
e01c4b3969
Fix duplicate packages when printing dependencies
The depTree holds info on all packages by name ready for the
depCatagories to catagorize and order them. To make things easier when
a repo package was added to the deptree it was also aliased to all of
its provides. So to find a package in the deptree you could search for
its provides instead of it's name and still find it.

The depCatagories is meant to filter out unneeded packages such as the
aliases but as it turns out if a package depends on a package and
something it provides then that alias is no longer unneeded and will end
up in the depCatagories.

Because these are just alias provieds still points to the original
package so you end up with the package name displaed to the user twice
when printing dependencies.

This commit just comments out the aliasing. It should have no effect
on package finding because where it used to seach by alias to find the
package it should instead fail then try to preform a lookup itself using
findSatisfyer and find the package.

This is probably a little less efficient than before but the database is
already on disk so there should be no real perfomance difference.
2018-02-27 19:03:52 +00:00
morganamilo
4ef282c54e
go fmt 2018-02-27 02:02:33 +00:00
morganamilo
4a142425ec
Add support fot CheckDepends
Note when installing CheckDepends are still refered to as MakeDepends.
They are both only needed during build time so technically that is
correct. I don't see much of a use creating a third field so I'm leaving
it as is for now.
2018-02-27 02:02:33 +00:00
morganamilo
7558f8fcf8
Use aurInfo for -S and -Su
This also improves the dependency by switching to stringSets for some
structures that previously contained duplicates.
2018-02-27 02:02:33 +00:00
morganamilo
b8f2ac0ab3
No longer split on space in getNameFromDep()
This should not make any real difference as pkgnames and pkgvers
should not contain whitespace. But there was a problem where a packagepkg
connected two deps by quoting them.

depends=('make qt5-tools')

Because we split on spaces this caused yay to generate an error saying
it couldn't find 'make' when instead it should say it cant find
'make qt5tools' which was a little confusing.

This commit should fix the misleading error.
2018-02-22 21:17:47 +00:00
Jguer
433f5b6ce1
Apply linting to patch 2018-02-16 17:18:59 +00:00
morganamilo
3c7118e9de
Have MakeOnly live up to it's name
Fix for packages which are makedeps to one package but runtime deps to
another showing up in MakeOnly
2018-02-16 16:27:53 +00:00
morganamilo
cdaee7d1d4
Improve support for split packages
Split packages are now grouped together when printing displaying the
package base and the packages inside of the base to beinstalled. If only
one packge is to be installed from a base and the package name matches
the base name print normally

Only build and install once per package base

Only ask questions once per package base for editing pkgbuils and clean
build
2018-02-16 15:49:18 +00:00
Jguer
41c37153e5
remove unneeded struct entries. Minor linting fix 2018-02-13 17:52:33 +00:00
Simon Legner
750ae0254c Fix typos in code/comments 2018-01-31 22:07:02 +01:00
morganamilo
5100fea56a
Fix install not listing all dependencies
Sometimes yay will not list all of the dependancies it needs when
installing packages. I mostly noticed this on libjpeg-turbo and the
issue was that the packages requring libjpeg-turbo were only requesting
libjpeg which was provided by libjpeg-turbo.

Now when we cache package info from the syncdb also alias the package name
to all of it's provides.
2018-01-22 12:46:30 +00:00
Jguer
3c9a31994c
Linted using Neoformat, all linters enabled 2018-01-21 07:37:10 +09:00
morganamilo
3275f8d8ac
New install algorithm
I have replaced the old install and dependancy algorithms with a new
design that attemps to be more pacaur like. Mostly in minimizing user
input. Ask every thing first then do everything with no need for more
user input.

It is not yet fully complete but is finished enough so that it works,
should not fail in most cases and provides a base for more contributors
to help address the existing problems.

The new install chain is as follows:
	Source info about the provided targets
	Fetch a list of all dependancies needed to install targets
		I put alot of effort into fetching the dependancy tree
		while making the least amount of aur requests as
		possible. I'm actually very happy with how it turned out
		and yay wil now resolve dependancies noticably faster
		than pacaur when there are many aur dependancies.
	Install repo targets by passing to pacman
	Print dependancy tree and ask to confirm
	Ask to clean build if directory already exists
	Download all pkgbuilds
	Ask to edit all pkgbuilds
	Ask to continue with the install
	Download the sources for each packagebuild
	Build and install every package
		using -s to get repo deps and -i to install
	Ask to remove make dependancies

There are still a lot of things that need to be done for a fully working
system. Here are the problems I found with this system, either new or
existing:
	Formating
		I am not so good at formatting myself, I thought best to
		leave it until last so I could get feedback on how it
		should look and help implementing it.
	Dependancy tree
		The dependancy tree is usually correct although I have
		noticed times where it doesnt detect all the
		dependancies that it should. I have only noticed this
		when there are circular dependancies so i think this
		might be the cause. It's not a big deal currently
		because makepkg -i installed repo deps for us which
		handles the repo deps for us and will get the correct
		ones. So yay might not list all the dependancies. but
		they will get installed so I consider this a visual bug.
		I have yet to see any circular dependancies in the AUR
		so I can not say what will happend but I#m guessing that
		it will break.
	Versioned packages/dependencies
		Targets and dependancies with version constriants such
		as 'linux>=4.1' will not be checked on the aur side of
		things but will be checked on the repo side.
	Ignorepkg/Ignoregroup
		Currently I do not handle this in any way but it
		shouldn't be too hard to implement.
	Conflict checking
		This is not currently implemented either
	Split Paclages
		Split packages are not Handles properly. If we only
		specify one package so install from a split package
		makepkg -i ends up installing them all anyway. If we
		specify more than one (n) package it will actually build the
		package base n times and reinstall every split package
		n times.
	Makepkg
		To get things working I decided to keep using the
		makepkg -i method. I plan to eventually replace this
		with a pacman -U based method. This should allow passing
		args such as --dbpath and --config to aur packages
		aswell as help solve some problems such as the split
		packages.
	Clean build
		I plan to improve the clean build choice to be a little
		more smart and instead of check if the directory exists,
		check if the package is already build and if so skip the
		build all together.
2018-01-20 10:00:12 +00:00
Jguer
8fa7c4069e Resolves #57. Added Package ignoring to AUR. Handles made private. 2017-10-18 11:38:19 +09:00
jguer
9afd66109a FilterPackages replaces ForeignPackages 2017-08-07 14:43:25 +01:00