Commit Graph

79 Commits

Author SHA1 Message Date
Joe Groocock
52bf777e67
Print errors on stderr
This makes a start on fixing https://github.com/Jguer/yay/issues/715
It is by no means a complete solution, but instead a start
2018-11-20 22:27:30 +00:00
Jguer
2ed7df4f5a
Unexport consts. Make default a literal
Signed-off-by: Jguer <me@jguer.space>
2018-10-22 21:00:16 +01:00
morganamilo
a83f8fb9e8
Remove depPool and depOrder code 2018-10-13 17:04:21 +01:00
J Guerreiro
f74a4f33b5
Revert "Don't show missing packages if they are ignored. Closes #752" 2018-10-08 11:51:19 +01:00
Jguer
9ad7c34949
Don't show missing packages if they are ignored 2018-10-08 00:20:43 +01:00
Jguer
293339263c
Fix -Qu to respect -q. Fixes #726 2018-09-24 10:52:29 +01:00
Jguer
d0cb79de6b
Make hash an unsigned integer 2018-08-29 18:30:16 +01:00
morganamilo
0454e8918b
Add --aururl 2018-08-19 05:10:24 +01:00
morganamilo
40776fa184
implement formatPkgbase as Base.String
Now that Base is its own type, it is much neater to have this as its
stringer function.
2018-08-18 17:05:12 +01:00
morganamilo
43feb12c85
Merge handles.Aur and depOrder.Bases
depOrder.Aur contains the order in which AUR packages are to be
installed. While depOrder.bases contains the actual package data
organized by pkgbase.

deoOrder.AUR is kind of counterintuitive, as it only contains one
package from each package base.

For example if you were to install libc++{,abi,experimental},
depOrder.Aur would only contain one of those packages, which one
actually being quite random. depOrder.Bases[pkg.Pkgbase] will then be
looked up and everything under that slice would be installed.

This means that the only real use depOrder.Aur has, is to give the
pkgbase. So to cut out the middleman, lets merge .Aur and .Bases into
a single field.

Doing this has also heped to spot som subtle bugs:

Fix subtle split package errors.

The number menus now correctly list and respect (installed) for bases
that have atleast one of their packages installed.

Entering package names in number menus now always expects the pkgbase
name instead of the random package which happened to make it into .Aur.

--rebuild and --redownload correctly handles split packages.

formatPkgbase is also used more.
2018-08-18 17:05:12 +01:00
morganamilo
3dc350d3ac
Simplify formatPkgBase
Only pass the packages belonging to the desired pkgbase. Before our
entire list of every pkgbase had to be passed, as well as an example
package from the base we are looking for.

This lets use use formatPkgBase easier in other places outside of
install.

Many of the functions in install could also be simplified in a similar
way, although that has not been done in this commit.
2018-08-15 20:11:19 +01:00
morganamilo
7c74dc5dec
Use none for empty fields 2018-07-24 13:04:32 +01:00
morganamilo
523c471a45
Add extra fields to -Si[i] 2018-07-24 13:04:32 +01:00
morganamilo
f5a35d4d1d
Correctly handle AUR providers during noconfirm 2018-06-19 22:20:24 +01:00
morganamilo
5f2933271a
Use slices for targets instead of stringsets
The order of targets does somewhat matter. For example doing something
like 'pacman -S db1/foo db2/foo' should cause the second package to be
skipped.

The order of targets also effects in which order they are resolved. This
should make errors more reproducable if any ever occur.
2018-06-02 17:56:09 +01:00
J Guerreiro
c36bfc1237
Merge pull request #401 from Morganamilo/deps3
Dependency system rewrite
2018-05-30 17:16:23 +01:00
morganamilo
7ba552e91f
Tweak -Si output
Always show popularity as a decimal
Always show out of date value
2018-05-30 16:01:48 +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
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
morganamilo
b2d3eb5c49
Add new dependency code to replace the old code
This is a rewrite of the dependency system, It aims to be cleaner
written, with a better idea of what is needed from the start, meaning
less new code being hacked on for things that were not thought about.
This version also aims to use as many small functions as possible, for
cleaner code and better testing.

Added dep.go:
    general dependency functions
Added depPool.go:
    Replacement of depTree, dependencies were never ordered so
    a tree did not really make sense. Instead the term pool
    makes more sense.
Added depOrder.go:
    Replacement of depCatagories, This simply orders the
    dependencies, dependencies are still catagorized as repo and AUR
    but I believe this to be a better name
Added depCheck.go:
    Replaces conflicts.go and also contains the missing dependency
    code

This version is mostly the same as the old version with a few
improvments:
    Missing packages will print the full dependency tree
    Versioned dependency checking errors should be fixed
    Make depends should be calculated properly
    Experimental AUR provide searcher

This code has been added along side the old code for testing and is not
currently used by the install process. Once the install process is moved
to use this code, the old code will be removed.
2018-05-29 13:13:27 +01:00
Jguer
3f15788c6a
Unexport functions and structures 2018-05-20 16:17:05 +01:00
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