Commit Graph

53 Commits

Author SHA1 Message Date
Loic Reyreaud
7ee206f36e
Implement proper diff display
As raised in #994, diff display was not proper when interrupting during
download or diff review.

This commit introduce:
- Add a ref in the git tree named "YAY_DIFF_REVIEW" which is set to the last
diff reviewed by the user.
- Change the function displaying diff to user to make proper use of this
new ref. If the ref does not exist in the git tree, it will display the
diff from origin to HEAD@{upstream}.
- Add a function updating the YAY_DIFF_REVIEW after it has been reviewed
by user. It uses the `toDiff` list in the `install` function.
- Add utils function related to handling this change in download.go.

This change only consider diff reviewed to update the YAY_DIFF_REVIEW ref.
If a user does not enable review, the ref will not be updated and the
user will be prompted for review when he enables diff review.

Signed-off-by: Loic Reyreaud <reyreaud.loic@gmail.com>
2019-10-07 13:59:17 +02:00
Jguer
9e205eef4b
Move MultiError to types package 2019-10-05 17:35:46 +01:00
Maryse47
f8339fc568
Use BuildDir instead of cacheHome to store PKGBUILDS with -G
BuildDir resolves to same place as cacheHome by default but it's configurable which helps in case user want to chose different directory to store PKGBUILDS.
2019-09-29 15:42:34 +00:00
Jguer
d34a84204a Changes -G in ABS to use git and symlink result.
Fixes #1027
2019-09-20 18:34:05 +01:00
Christian Muehlhaeuser
3700c1daa6
Avoid unnecessary conversion
stderr is already a string.
2019-07-19 11:51:42 +02:00
morganamilo
6415c23be2
Random fixups 2019-04-23 17:03:09 +01:00
morganamilo
112046853b
Use correct case on go-alpm import 2019-04-23 16:53:20 +01:00
Motkov Kirill
14ac756298 Code improvements
- Removed yoda condition.
- Renamed/removed variables which shadows built-in names.
- Rewrited if-else-if-else chains to switch statements.
2019-03-10 16:36:01 +03:00
Motkov.Kirill
504e4e21af remove unwanted space 2019-02-26 14:41:35 +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
cezarmathe
6a95783790
Fixed a comment in download.go, line 18 2018-11-30 11:41:30 +02:00
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
morganamilo
1beeaaf299
Limit download concurrency to 25 threads 2018-09-04 20:03:23 +01:00
morganamilo
004595a396
Dont rm directories with -G unless using -f 2018-08-30 15:30:52 +01:00
morganamilo
c93b3fca9e
Fix tests 2018-08-29 21:15:01 +01:00
morganamilo
e547173d42
Use goroutines for fetching abs packages 2018-08-18 17:14:07 +01:00
morganamilo
a1edd09a52
Fixup getPkgbuildsFromABS
Make it output more similary to downloadPkgbuilds. Refactor to remove
all the indention.
2018-08-18 17:12:42 +01:00
morganamilo
cba56c3f9e
Use downloadPkgbuilds for -G 2018-08-18 17:12:42 +01:00
morganamilo
297bf31cdf
Set GIT_TERMINAL_PROMPT=0 for clone and fetch 2018-08-09 16:25:14 +01:00
morganamilo
8c2adaddb3
Hide git output 2018-08-09 16:25:14 +01:00
morganamilo
2a60dd7052
Remove unneeded variables 2018-07-30 14:14:16 +01:00
morganamilo
a61eb0d568
Use no-progress when cloning packages
The output is annoying and takes up many lines. All AUR packages clone
extremley fast anyway, making the progress unneeded.
2018-07-28 16:15:01 +01:00
morganamilo
473a2de225
Refactor pssToFoo() functions
Previously each call to an external command had two functions.
PassToFoo() and PassToFooCapture(). These functions are always similar
and end up with duplicated code.

So instead have the passToFoo() functions return the cmd itself and
create small helper functions show() and capture() which will run the
command and either forward it to std{out,err,in} or capture the output

Also the saveVCSInfo() function which was called after every makepkg
call is now only called after the pacman -U succeeds.
2018-07-19 18:37:28 +01:00
morganamilo
00da26a3ce
Always show diffs for newly cloned packages
Newly cloned packages already start out at origin/master, so there is no
diff to show. Track if we cloned a package and if so make sure to show
the full diff
2018-06-10 03:41:25 +01:00
morganamilo
4f8b43cd60
Show diffs before merging
This is what 5775e3..43d2a6 has been leading up to. Git fetch will be
called on all pkgbuilds, then the user is offered a chance to view the
diffs. If they choose to continue, merging happens. This allows users to
abort the install after viewing diffs and still be able to see thoes
diffs again if they try to install later on.

This also makes the git stuff a little more modular which should help in
organzing diff showing + pkgbuild editing.
2018-06-10 03:21:08 +01:00
morganamilo
5775e3c0b7
Split git clone/pull and merge function 2018-06-10 03:17:23 +01:00
morganamilo
c4d319268c
Disable git terminal prompt
This allows requests that want authentication to fail instantly and
silently. Rather than delying the program and printing to the terminal.
2018-06-02 13:52:18 +01:00
Anna
5b6c4101f8
Merge pull request #447 from Morganamilo/fix#131
Implement diffs for pkgbuild viewing.
2018-06-01 19:11:52 +01:00
morganamilo
f20fbd25c1
Implement diffs for pkgbuild viewing.
diff viewing can be toggled via --[no]showdiffs. When enabled diffs will
be shown for packages between the current HEAD and upstream's HEAD.
Packages downloaded via tarballs will be shown in full using the editor

git diff is used to show diffs. Therefore the pager for diffs can be
set via the PAGER and GIT_PAGER enviroment variables.
2018-06-01 18:11:13 +01:00
morganamilo
14b66043a2
Support db prefix and --repo/--aur on -G 2018-06-01 05:06:58 +01:00
Jguer
2b5c725a0c Fixes #430. Don't abort -G just error to signal not all was good
Signed-off-by: Jguer <me@jguer.space>
2018-05-28 13:45:11 +01:00
Jguer
70e5f43171 Quick fix to yay -G error code #430
Signed-off-by: Jguer <me@jguer.space>
2018-05-28 13:31:33 +01:00
Jguer
d15f899809 Fixes #417
Signed-off-by: Jguer <me@jguer.space>
2018-05-14 18:33:48 +01:00
morganamilo
38818757c8
Lint 2018-05-10 20:18:16 +01:00
morganamilo
ee75de0135
Add mised filepath.Join() calls 2018-05-03 01:47:24 +01: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
110a905a0c
Use filepath.Join() for adding paths together 2018-04-17 01:32:31 +01:00
morganamilo
cf47746d20 Use git clone for pkgbuild downloading
Use git clone over tarballs for pkgbuild downloading during -S. This
option can still be toggled using the config flags.

The config option for selecting clone or tarball will be overiden if an
existing package is cached. The method used to download the package
perviously will be used regardless of the config.
2018-04-16 14:12:02 +01:00
morganamilo
694c74f5b4
Remove no longer needed function and lint 2018-04-16 00:18:01 +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
morganamilo
b58746d1ef
Fix -G for non split packages and support multilib
A while ago the url to download a pkgbuild was using pkg.Name(), it was
latter changed to pkg.Base() to support split packages. It seems that
pkg.Base() does not work for non split packages for some reason.

So instead try pkg.Base() and if it is empty default to pkg.Name().

Also add support for downloading from multilib
2018-03-11 23:23:24 +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
4ef282c54e
go fmt 2018-02-27 02:02:33 +00:00
morganamilo
3fb77b1d72
Use aurInfo() for -G 2018-02-27 02:02:33 +00:00
morganamilo
501e777aa0
Fix -G being unable to download split packages
this is a quick fix for now so it can be pushed out for the next
release. -G really should get the fancy split package printing that -S
now has `libc++ (libc++ libc++abi)`.
2018-02-22 21:11:41 +00:00
Jguer
ecc337c29f
Finishes porting text to new colour format. 2018-01-26 15:04:10 +00:00