Commit Graph

58 Commits

Author SHA1 Message Date
morganamilo
d6ab6ed9ac
Use native build date when printing news
Use the build date of the newest native package instead of the install
date of any package.
2018-05-17 20:11:07 +01:00
morganamilo
9f071a8e9b
Only show new news when calling -Pw
New news is defined as news that is newer than the install date of the
newest package on the users system.

All news can be shown using -Pww
2018-05-16 17:19:09 +01:00
Gravemind
6c49436942 Fix typo --foreigne to --foreign 2018-05-12 15:41:32 +02:00
Anna
aaf89c0c1c
Merge pull request #387 from Morganamilo/news2
Print the descriptions of news item
2018-05-08 21:05:10 +01:00
Anna
58f23bfe9a
Merge pull request #377 from AlexWayfer/make_upgrade_output_as_table
Make upgrade output as table
2018-05-07 23:05:34 +01:00
Alexander Popov
58283a9799
Make upgrade output as table 2018-05-08 00:41:35 +03:00
morganamilo
a10241f7ab
Print descriptions of news
Print the full descriptions of each news item.

The description is formatted as html, basic parsing is done to display
it properly. -q/--quiet can be used to diplay title only.
2018-05-07 01:46:08 +01:00
morganamilo
6af2b5c6e1
Respect bottomup for -Pw
This commit also refactors the news related sructs into their own types
instead of being anonymous and moves the printing to its own .Print()
function.
2018-05-07 01:06:24 +01:00
Jonas Thiem
188df1ac93 Use formatTime for news 2018-05-06 04:25:23 +02:00
Jonas Thiem
2161dace3f Collapsing rss struct 2018-05-06 04:06:58 +02:00
Jonas Thiem
8dd08327b1 Add --news to --print 2018-05-06 02:26:03 +02:00
Simon Legner
e6dae03329 Use ISO 8601 date format (yyyy-mm-dd) 2018-05-04 12:36:14 +02: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
Morgana
2aaf5f8694
Merge pull request #329 from AlexWayfer/improve_versions_output
Highlight diff between old and new versions better
2018-04-09 16:15:40 +01:00
Alexander Popov
1e4c029a2e
Add common stylize function for reduce code repeation
Also check for input length, don't create empty stylized strings.
2018-04-08 22:46:28 +03:00
morganamilo
9ba9b03396
Show pkgver during -Ss when package is out of date 2018-04-07 23:02:10 +01: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
morganamilo
7768fab978
Supress pacman error printing
add22f5957 added error checks to all the
passToPacman commands. This makes `yay -Q nonexistantpackage` return
non 0 as it should. Annoyingly it also made yay print `exit status = n`
which is the error string from passToPacman calls. This error doesn't
add much and is quite annoying, expecially when calling pacman commands
like `-Q` or `-Si` where yay should be kind of 'hidden' and print just
like pacman does.

Now set the error string to "" for pacman commands and don't print an
error if it == "" (avoids empty line printed).

Also behave more like pacman when using `yay -Qu`.
2018-03-23 19:56:28 +00:00
morganamilo
549c75dfeb
Support provides in -Si 2018-03-23 07:11:57 +00:00
morganamilo
7fd2a74bd2
Lint 2018-03-22 16:39:27 +00:00
morganamilo
1864ec3083
Respect --color
`--color auto` is the same as `--color always` until a suitable method
for auto has been decided.
2018-03-21 05:42:19 +00:00
morganamilo
add22f5957
Extend aur support for -Qu
-Qu now has AUR support, it functions identically to `-Pu` and may replace
it in the futre.

Aditionally the pacman options `-n` and `-m` are also supported to
filter out native and non native packages. Other flags are not supported
currently.

Using any other `-Q` will fallback to Pacman.
2018-03-21 05:03:22 +00:00
J Guerreiro
c072146190
Merge pull request #227 from Morganamilo/numbermenu
Use numbermenu for cleanBuilds and editPkgbuilds
2018-03-11 19:46:53 +00:00
morganamilo
91757f51c7
Fix formatting on upgrade menu
commit 5286f385 broke the alignment on -> in the upgrade menu.

This commit moves the function responsable for printing the upgrade menu
from upgrade.go to print.go, fixes the formating to how it was before
and changes the padding on the number to three digits instead of two.
This allows proper alignment on numbers >100 which is not unheard of.
2018-03-11 04:13:13 +00:00
morganamilo
f0f20269a0
Show versions when printing Packages to install 2018-03-08 23:54:18 +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
morganamilo
181663b7cb
Refactor f() to a dedicated function colourHash()
Also enable colourHash() for yogurt mode.
2018-03-02 01:08:14 +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
31d6a95c2a
Tweak some of the printting and fix formatting 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
c189a98018
Re enable -Pu and -Pn 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
e71d66f3c6
use aurInfo() for -Ps 2018-02-27 02:02:33 +00:00
Jguer
433f5b6ce1
Apply linting to patch 2018-02-16 17:18:59 +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
Michael Rees
27c99a566b
Different colors for AUR/repo packages 2018-02-05 14:18:16 -06:00
Michael Rees
3df03c3291
Prettify repository download messages 2018-02-05 14:05:58 -06:00
Jguer
ecc337c29f
Finishes porting text to new colour format. 2018-01-26 15:04:10 +00:00
Jguer
f466fc74f5
Ports more text to new colour format. 2018-01-26 11:30:33 +00:00
Jguer
5286f3858c
References #109. Begins to add escape codes and string constants 2018-01-26 10:18:49 +09:00
Jguer
a4d0ef108f
Fixes #75. Needs sudo. Prints number of updates and update list. 2018-01-25 20:39:26 +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
61065dc930
Satisfied linter 2018-01-19 23:51:18 +09:00