Commit Graph

93 Commits

Author SHA1 Message Date
Jguer
a591b33262
Add errguards throughout the code to enable golangci-lint 2019-10-13 20:56:27 +01:00
Jguer
bf89b3383c
Move IntRange definition to types package 2019-10-05 19:23:13 +01:00
Jguer
b01790f752
Moved StringSet definition to types package 2019-10-05 18:39:31 +01:00
Jguer
3d31b52799
Moved LessRunes to types package 2019-10-05 18:11:49 +01:00
Jguer
9e205eef4b
Move MultiError to types package 2019-10-05 17:35:46 +01:00
morganamilo
112046853b
Use correct case on go-alpm import 2019-04-23 16:53:20 +01:00
Motkov.Kirill
7b8e45d4e2 rewrite if-else to switch statement 2019-03-04 19:07:04 +03:00
morganamilo
895788e01b
Update go-alpm 2019-02-14 20:45:18 +00:00
morganamilo
5ce4a49687
Update go-alpm 2019-02-04 16:56:02 +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
b3e647aee4
Use MultiError in other goroutines 2018-08-09 16:25:14 +01:00
morganamilo
de59b3911d
Fix padding on time update 2018-08-04 14:24:42 +01:00
Anna
b848514b4b
Merge pull request #585 from Morganamilo/usage
Support Usage in pacman.conf
2018-08-02 13:51:13 +01:00
morganamilo
dfe7738d6e
Use pacman like text for ignorepkg and newerpkg
Now that we are using alpm to fetch packages it generates these mesages
and we can not control the format. So change out format to match.
2018-07-31 22:01:14 +01:00
morganamilo
95bcea8f40
Ensure devel packages exist when updating 2018-07-31 16:58:49 +01:00
morganamilo
2a60dd7052
Remove unneeded variables 2018-07-30 14:14:16 +01:00
morganamilo
f4aa7f7933
Use alpm_sync_sysupgrade for uprepo
This allows us to support the Upgrade Usage option as well as relying on
alpm's logic instead of coming up with out own.

It is possible that this could lead to showing replaces in the upgrade
menu.
2018-07-26 14:00:08 +01:00
Anna
d6b862357d Replace gopkgbuild with go-srcinfo (#528)
* Prefer vercmp over gopkgbuild

* Replace gopkgbuild with go-srcinfo
2018-07-16 15:28:18 +01:00
morganamilo
42f0508625
Add upgrademenu to match {clean,diff,edit}menu 2018-06-11 20:12:17 +01:00
morganamilo
0ae8fc2a06
Support --aur and --repo flags
These flags limit operations to only check the repos or only check the
AUR. These flags apply to -S, -Si and -Su.

-a may also be used as a short option for --aur. --repo has no short
option as -r is taken.
2018-05-31 16:25:49 +01:00
Jguer
3f15788c6a
Unexport functions and structures 2018-05-20 16:17:05 +01:00
Alexander Popov
d1602083f2
Print warnings about newer local packages then remote versions
Inspired by [`pakku`](https://github.com/kitsunyan/pakku)
2018-05-14 11:31:18 +03:00
Alexander Popov
58283a9799
Make upgrade output as table 2018-05-08 00:41:35 +03:00
Jguer
d319576303 Use megacheck to lint project
Signed-off-by: Jguer <me@jguer.space>
2018-04-27 01:25:40 +01:00
Tom Swartz
1c9715dddf Fix typos 2018-04-23 13:06:56 -04:00
morganamilo
72eaf6f582
gofmt -s 2018-04-17 17:54:22 +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
Alexander Popov
38b5680619
Fix make test (gofmt threw "Files need to be linted") 2018-04-08 22:46:33 +03:00
Alexander Popov
46cffa6ba6
Highlight diff between old and new versions better
Split by dots, pluses, dashes, tilds, etc., not only `Version` and `Pkgrel`.

Don't make new version different bold.

Inspired by [`pikaur`](https://github.com/actionless/pikaur).
2018-04-08 02:16:31 +03:00
morganamilo
a33414b723
Repect --answer* flags when --noconfirm is set
This means that menus are now printed in noconfirm mode, I don't see
this as a problem because Pacman still prints its questions during
noconfirm.

When the user has edited pkgbuilds Yay will prompt if they want to
continue with the intall. This prompt is also enabled during noconfirm
to ensure the user is happy with the pkgbuilds.
2018-04-04 22:22:33 +01: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
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
e807cd637f
Sort upgrade menu by pacman.conf order.
When printing the upgrade menu, sort the repos in the order they are
defined in pacman.conf (or more technically, the order they are
registered in alpm). Packages in the same repo are still sorted
alphabetically.

If a repo is not in pacman.conf or the database query fails it will
fallback to alphabetical.
2018-03-26 02:43:58 +01: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
98ea801004
Pass -Su to pacman during sysupgrade
Previosly during `yay -Su` Yay would pass
`pacman -S <packages that need upgrade>` to pacman.

Instead pass `pacman -Su --ignore <number menu choices>`

This allows yay to handle replaces and package downgrades `-Suu`
2018-03-22 07:13:18 +00:00
morganamilo
bb211fdbf7
Don't show package in aur/ if it is also in devel/ 2018-03-22 07:13:18 +00:00
morganamilo
624851b80b
More sorting for upgrade menu
Sort accending instead of decending
Sort by package name as well as repo name
Sort AUR packages as well as repo packages
2018-03-22 07:13:18 +00:00
morganamilo
b5c0cb7a11
Simplify upList()
Before the goroutines in upList() were layed out like:
	upLists()
	|- - - 	upRepo()
	|- - - 	pAur()
		| - - -	upDevel()

Simplified by moving upDevel() from upAur() to upList():
	upList()
	|- - - 	upRepo()
	|- - - 	upAur()
	|- - - 	upDevel()

With the simpler layout it was easy to then remove some un need channel
useage entirely and use WaitGroups in other places.

Now if any of the three inner functions error, upList() will return
a combined error instead of just printing the error and carrying on.
2018-03-22 07:13:18 +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
74196306fa
Respect --ignore and --ignoregroup flags
And enable version colouring on repo ignore and devel ignore
2018-03-12 23:46:23 +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
f7abb1b0ac
Use numbermenu for cleanBuilds and editPkgbuilds 2018-03-11 18:14:16 +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
2aadd1931c
Refactor and improve the upgrade menu
With the planned move to number menus for askcleanbuilds and
askeditpkgbuilds a consistant way is needed to make number menus in
a clean way without rewriting the same code over and over.

The prevous commit introduced `parseNumerMenu()` to create a standard
way to handle number menus. This commit implements the new function for
the upgrade menu both as a test and to bring some new features.

Entering 1-9999999 will no longer cause ram usage to spike to 100%
(before yay would try to build an []int containing the numbers 1 to
9999999).

Suport for discarding/including entire repos by name

> "54 aur extra"
	would skip the package numbered 54 and all packages
	that are listed as aur and extra.

> "^devel ^20"
	would only install packages listed under devel and the package
	numbered 20
2018-03-10 03:04:54 +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
Peter Dyer
66225b949d Add missing space before devel update 2018-03-03 23:42:12 +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