1
0
mirror of https://github.com/Jguer/yay synced 2024-07-09 04:46:19 +00:00
Commit Graph

61 Commits

Author SHA1 Message Date
morganamilo
ef7e8acb13
Refactor complex map types into their own type
map[string][]string  -> mapStringSlice
mao[string]stringSet -> mapStringSet
2018-05-07 23:42:41 +01:00
Jguer
d319576303 Use megacheck to lint project
Signed-off-by: Jguer <me@jguer.space>
2018-04-27 01:25:40 +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
Reeto Chatterjee
992c27e82e
Merge branch 'master' into master 2018-04-07 16:42:56 +00: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
5bcb51bf00
Don't abort during AUR search error 2018-04-03 06:49:41 +01:00
morganamilo
fe3743c5ba
Try each search term against RPC if one fails
Allows searching the RPC for words that may be too short or have
too many results as long as another word in the search will work.

If no words can be used without error then the last error will be
returned and the program will exit.
2018-04-02 15:27:07 +01:00
Reeto Chatterjee
b103a34f3b Use exisiting util function 2018-03-24 18:31:55 +00:00
Reeto Chatterjee
51f7b14777 Remove assumption of unique provides 2018-03-24 12:40:51 +00:00
Reeto Chatterjee
21df6b1d57 Update deps properly and lint 2018-03-24 00:04:28 +00:00
Reeto Chatterjee
1b704a869d Add recursive removal of packages 2018-03-23 23:45:46 +00:00
morganamilo
074ea4465a
Make aurInfo return a pointer 2018-03-22 18:11:00 +00:00
morganamilo
0c0cd4f883
Add utils.go 2018-03-22 16:38:21 +00:00
morganamilo
3ceda128fc
Dont use FindSatisfier() in packageSlices()
Now that install() no longer relies on packageSlices() we can drop the
use of FindSatisfier() so that only direct package names are understood,
this is how pacman -Si works.

This also fixes a small issue where `yay -Si mysql` would fail. This is
because two repo packages provide `mysql`. This causes Yay to not bother
checking the AUR even though there is a package in the AUR called `mysql`
2018-03-20 15:56:13 +00:00
morganamilo
fae0c506cc
Support db/name for groups 2018-03-16 01:14:34 +00:00
morganamilo
62e244db0f
Improve db/name system and add support for -Si 2018-03-13 21:38:10 +00:00
morganamilo
57a8048cb8
Use goroutinuies for devel updates
The update process was already partly parallel: repo, aur and devel
updates where each given their own goroutine.

This gives two further layers of parallelization. Firstly the
`needsUpdate()` function is now run in parallel for each package checked.
One package may have many vcs sources so `needsUpdate()` also checks all
of its sources in parallel.

This gives an aproxamte 3x speedup for `yay -Su --devel` timing from
when the command starts to when the number menu apears.

unfortunately git://bitbucket.org/volumesoffun/polyvox.git never
resolves on my machine for some reason so it always hits the 5 second
timout period.

It then moves on to http:/bitbucket.org/volumesoffun/polyvox.git/ which
does resolve as expected. I have not looked into it but I fear this
applies to all gitbucket repos. Luckly they are few and far between.
2018-03-13 17:18:46 +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
morganamilo
6988537552
Add parseNumberMenu()
This function is designed to replace the existing number menu
in upcoming commits.
2018-03-10 03:04:44 +00:00
morganamilo
e6b36eaf74
Fix min() 2018-03-08 04:07:51 +00:00
morganamilo
5f4c6e136b
Fix for yay locking when querying AUR 2018-03-08 02:26:06 +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
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
Daniel Martí
73d6f9b1ab all: remove unused code
And simplify some code too.
2018-02-27 10:16:53 +00:00
morganamilo
4ef282c54e
go fmt 2018-02-27 02:02:33 +00:00
morganamilo
46cc1f2c09
Display missing, orphans and out of date in groups
Instead of printing each warning on a seperate line, group up the
warnings by type (missing, orphan, out of date) and display each
group on its own line.
2018-02-27 02:02:33 +00:00
morganamilo
3f7c731f99
Make aurInfo concurrent 2018-02-27 02:02:33 +00:00
morganamilo
2856a7276c
Refactoring and improving insall process
This commit mostly focuses on merging the install() and upgradePkgs()
functions to be more integrated. Instead of both making their own aur
queries they now both combine theyre needes into one query. This gives
us a speed up and allows us to easily print orphands, misising and out
of date in one clean block.
2018-02-27 02:02:33 +00:00
morganamilo
346a579c23
Add function to wrap rpc.Info with warnings
Warns for orphans, out of date and missing
Respects requestsplitn in config
2018-02-27 02:01:46 +00:00
morganamilo
da8538364a
Fix -Si failing when given a non existing package 2018-02-17 17:48:51 +00:00
Brian Allred
510bd7e172 Fix extended info (-Sii) not passing to pacman 2018-02-14 10:10:07 -06:00
Jguer
3f69df424f
fixes some display messages and eliminates secret sauce 2018-02-08 22:51:43 +00:00
Jguer
fb220d45d5
Resolves #115. Ignore aur/package on install 2018-01-31 16:01:16 +00:00
Jguer
5286f3858c
References #109. Begins to add escape codes and string constants 2018-01-26 10:18:49 +09: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
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
morganamilo
a3df41368b
Merge branch 'master' into fix#62 2018-01-07 21:59:39 +00:00
l4
ba143bdb36 fix query info with -Si 2018-01-06 20:50:54 +07:00
morganamilo
96f499ff44
Reimplement all previously existing operations
This reimplemens all operations yay previously supported:
	'-S' 'Syu' 'Si' ect.

Currently the argument objects are not fully implemented with the code.
Theres alot of funky conversion from
	argument object -> pkg, flags -> argument object
This is to just get back to the functionally we had before (almost).

I have not looked into it yet but alot of the time pacman flags get
passed to makepkg. this cases an error for most commands now because the
new system Passes all flags:
	`yay -Syu` -> flags = '-S' '-y' '-u'
while the old system would have done:
	`yay -Syu` -> op = '-Suy', flags = ''

So extra flags are no longer passed at all currently.

This means:
	'yay -S aic94xx-firmware --noconfirm -b /tmp/pacutilesu2q6hw/tmp-pacman -d'
will no longer error and 'aic94xx-firmware' will be installed but the
database path change will not apply and the dep checking will not be
skipped.
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
morganamilo
c0eac580a8
Count from 1 instead of 0 when searching packages
I feel like starting from 1 is much better ergonomically while not using
a numpad. This could be added as a config option instead if you would
prefer.
2017-12-30 06:18:09 +00:00
Jguer
58ab6fd06f File closure fixed on init 2017-10-19 14:59:26 +09:00
Jguer
a6a0b9b441 git devel package support restored, house keeping, fixes related to config files. 2017-10-19 11:30:37 +09: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