Commit graph

87 commits

Author SHA1 Message Date
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 9b4264f346
Set default config in the correct place 2018-03-07 16:26:15 +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 d5fc1e0de5
Update docs for --redownload and --noredownload 2018-03-06 15:17:55 +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
J Guerreiro 35599cdccf
Merge pull request #193 from Morganamilo/updatemanpage
Update manpage and usage
2018-03-01 09:47:49 +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
morganamilo 111a7f73dc
Hide pacman output when setting install reason
Stderr is shown if Pacman returns non 0.
2018-02-28 17:41:42 +00:00
Morgana 9c4b4d73f9
Merge pull request #183 from Morganamilo/fix#88
Save the VSC info when install finishes.
2018-02-27 19:08:01 +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
Daniel Martí 73d6f9b1ab all: remove unused code
And simplify some code too.
2018-02-27 10:16:53 +00:00
morganamilo 04a9830e0b
Fix tests 2018-02-27 03:41:39 +00:00
morganamilo 716d775d5f
Improve formatting
Ignorepkg also colours version differences like the upgrade menu
Tweaked formatting when asking for users to eneter number
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 3fb77b1d72
Use aurInfo() for -G 2018-02-27 02:02:33 +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
morganamilo 85a99198c3
Fix handling of -- in parser 2018-02-20 17:03:50 +00:00
Sean Liao 56db82ed10 fix stray tab 2018-02-20 23:12:07 +08:00
Sean Liao d12685debc separate printing default and current config 2018-02-20 23:08:29 +08:00
Sean Liao 57773b6c2d add config.String() to pretty print default config in valid json 2018-02-20 22:24:48 +08:00
morganamilo 4298e77632
Fix passing incorrect flags during yay -Sy[s,i] 2018-02-17 23:00:18 +00:00
morganamilo d04ca15228
Hang on first sudo
Currently sudoloop is run in parallel with the rest of the code this
causes the first sudo prompt to ask for a password while the code
continues running.

Instead hang on the first sudo, giving the chance for the user to enter
a password then continue the loop in the background.
2018-02-16 18:12:22 +00:00
Jguer 6913770b4d Merge branch 'lessmakepkg' of https://github.com/Morganamilo/yay into Morganamilo-lessmakepkg 2018-02-16 17:16:56 +00:00
Jguer 9f734bdf8d References #147. Sudo loop is off by default 2018-02-16 13:15:05 +00:00
morganamilo e1f3cb6682
run cleanafter after finishing the install process
Cleanafter is now run right at the very end of install instead of after
each makepkg command.
2018-02-15 21:41:49 +00:00
Brian Allred 510bd7e172 Fix extended info (-Sii) not passing to pacman 2018-02-14 10:10:07 -06:00
Jguer 78742a9429
fix #147 with a sudo loop 2018-02-13 18:20:15 +00:00
J Guerreiro 3bc33c1b64
Revert "Respect --noconfirm in config" 2018-02-09 20:27:34 +00:00
J Guerreiro 20128f4776
Merge pull request #142 from Morganamilo/fix#122
Respect --noconfirm in config
2018-02-09 09:52:00 +00:00
morganamilo 519014af3d
Respect --noconfirm in config 2018-02-09 03:34:29 +00:00
Kaushal M 22d10f287a
Re-add support for PacmanBin 2018-02-08 15:04:47 +05:30
Jguer c0901ff86b Fixes --noconfirm. Changes default build location to ~/.cache/yay/ 2018-02-07 12:06:56 +00:00
J Guerreiro d2db36ac7a
Merge pull request #129 from simon04/typos
Fix typos in code/comments
2018-02-05 09:00:41 +00:00
Jonas Platte 9c524a4ece s/PKGBuild/PKGBUILD 2018-02-01 10:13:32 +01:00
Simon Legner 750ae0254c Fix typos in code/comments 2018-01-31 22:07:02 +01: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 fa479c2670 Updates fish completions
Updates man page and usage
Changes -G to -Yg but doesn't remove previous option yet.
2018-01-31 19:27:11 +09:00
Jguer f466fc74f5
Ports more text to new colour format. 2018-01-26 11:30:33 +00:00
Jguer a4d0ef108f
Fixes #75. Needs sudo. Prints number of updates and update list. 2018-01-25 20:39:26 +00:00
J Guerreiro 69c8bf37c8
Merge pull request #106 from Jguer/print
Basic new Print option implementation
2018-01-21 08:05:02 +09:00
Jguer 9d55882ce2
Added statistics to new interface. Removed old. 2018-01-21 03:39:53 +09:00
Jguer 42889821d3
New print option, added new completion syntax, fixed fish completion 2018-01-21 02:48:40 +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
J Guerreiro 479e2f0ce0
Merge pull request #97 from samosaara/master
Support for ranges when selecting packages
2018-01-18 21:02:35 +09:00