Commit Graph

229 Commits

Author SHA1 Message Date
morganamilo
3c996e5235
Ignore errors while diffing
std{out,err} all passed to the call so errors should print just as
before, the only difference is now yay will not abort after an error
occurs. We always provide a confirmation dialog after viewing diffs so
this should be safe.
2019-11-03 07:01:51 +00:00
morganamilo
b60a888981
Simplify stringset function names
Now that stringset has its own module we can use more basic function
names while keeping it obvious what it does.
2019-10-16 23:18:04 +01:00
morganamilo
dacd77012c
Move multierror to its own module
types is pretty generic as a module name, this should be split into
seperate modules.
2019-10-16 23:18:04 +01:00
morganamilo
cff358d5d6
Move intrange to its own module
types is pretty generic as a module name, this should be split into
seperate modules.
2019-10-16 23:18:04 +01:00
morganamilo
f2579f26a3
Move stringset to its own module
types is pretty generic as a module name, this should be split into
seperate modules.
2019-10-16 23:18:04 +01:00
morganamilo
4d91acc749
Re-add --batchinstall and fix dep issues 2019-10-16 20:59:52 +01:00
Jguer
c180fa8d19
PkgbuildDiffs use MultiError now to accumulate errors instead of breaking execution at any error 2019-10-13 23:23:55 +01:00
Jguer
a591b33262
Add errguards throughout the code to enable golangci-lint 2019-10-13 20:56:27 +01:00
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
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
9e205eef4b
Move MultiError to types package 2019-10-05 17:35:46 +01:00
Jguer
5fa3557817
Store completions in yay's cache folder instead of build directory 2019-10-05 02:10:15 +01:00
Jguer
c5c2e906d3
Move completion to submodule 2019-10-05 02:02:30 +01:00
Jguer
2214bc0cb2
Revert "Merge pull request #778 from Morganamilo/group-transactions"
This reverts commit 6cd47dd83c, reversing
changes made to 16fddae8b6.

Signed-off-by: Jguer <me@jguer.space>
2019-10-04 19:42:17 +01:00
morganamilo
80e66ce479
Allow many aur packages to be installed at once.
After building an AUR package don't install it right away. Instead queue
it for install.

Then when a package comes along that does not have all of its
dependencies satisfied, install the queued packages before builting.

This allows a standard AUR update to be done with one transaction, while
building AUR packages with long dependency chains will work as normal.

This feature is behind the `--batchinstall` flag.
2019-06-17 14:25:59 +01:00
morganamilo
e01af5dfd6
Fixup asdeps logic 2019-06-17 13:15:54 +01:00
morganamilo
c717b61e69
Extract dep and exp setting to their own functions 2019-06-17 13:08:23 +01:00
morganamilo
5ac36ad97e
Ensure global pacman arguments are always used 2019-06-17 13:03:57 +01:00
Jordan Day
37f3309917 Defer clean and remove make 2019-06-11 08:54:24 -05:00
morganamilo
112046853b
Use correct case on go-alpm import 2019-04-23 16:53:20 +01:00
Jguer
e1bc834f5b
Fix #918. Get back in the groove 2019-03-29 22:05:04 +00: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
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
morganamilo
4ab7814af1
Revert "Merge pull request #767 from Morganamilo/merge-dep-pool-order"
This reverts commit c2aeb4bc4e, reversing
changes made to 1f1cee7023.
2019-01-15 18:43:46 +00:00
Jguer
5bcadc58ac
Fix tests and prepare for release 2018-12-01 15:03:46 +00: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
Jguer
2ed7df4f5a
Unexport consts. Make default a literal
Signed-off-by: Jguer <me@jguer.space>
2018-10-22 21:00:16 +01:00
Anna
c2aeb4bc4e
Merge pull request #767 from Morganamilo/merge-dep-pool-order
Merge dep pool order and rework inner conflicts
2018-10-18 10:15:40 +01:00
dvejmz
d42f737849 Handle libalpm callbacks when checking DB satisfiers for a package
Hide provider menu when checking for the existence of a package in
the repos
2018-10-16 23:55:35 +01:00
morganamilo
4ff36fbd4b
Use depSolver in install 2018-10-13 17:04:21 +01:00
morganamilo
704e8406d1
Merge depOrder with depSolver
merge both dependency resolving parts into depSolver. The name was
choosen simply to not colide with the current code.

depSolver works but it not implemented in the install process and is
missing conflict checking.
2018-10-13 17:04:21 +01:00
Anna
6ee14d44b8
Merge pull request #738 from Morganamilo/fix#736
Rework cleanafter
2018-10-04 09:18:57 +01:00
Tom Swartz
ae7400890d Fix Typos 2018-10-02 16:30:18 -04:00
morganamilo
98e6caefef
Fix dangling src/ directory
Yay first calls 'makepkg --nobuild -fC' to update the pkver. Later on we
call 'makepkg -cf --noectract --noprepare --holdver' to actually build
the package.

Inbetween these two calls we keep the already extracted
sources to save time on the reextract and duplicated call to prepare
(pkgbuilds should not require user input but things such as linux-ck do
and calling prepare twice will actually cause them to promt twice)

We also have two checks. First we see if the package is already
installed and up to date (--needed) and secondly we check if the
package is already built.

If any of these conditions are met we skip building the package. This
leaves a dangling src/ directory as 'makepkg -c' was never ran.

Now if these conditions are met tell makepkg to cleanup and exit.
2018-09-27 15:55:43 +01:00
morganamilo
bf0ab3216a
Leave VCS files when using clean after 2018-09-27 15:55:43 +01:00
morganamilo
5c7d6fa3be
Fix --rebuild logic 2018-09-04 20:03:27 +01:00
morganamilo
1beeaaf299
Limit download concurrency to 25 threads 2018-09-04 20:03:23 +01:00
morganamilo
2b6a73041f
Fix redownload logic
--redownload was reversed and redownloaded the deps instead of the
targets.
2018-09-04 19:39:15 +01:00
morganamilo
0454e8918b
Add --aururl 2018-08-19 05:10:24 +01:00
Anna
23ff1e79df
Merge pull request #642 from Morganamilo/needed
skip build when package is up to date and --needed
2018-08-18 21:02:40 +01:00
morganamilo
0f324b37a6
Only print the clean number menu when needed
The input is only asked when needed, but the numbered package list was
still printed either way. This fixes it so the list is not shown unless
needed.
2018-08-18 20:50:20 +01:00
morganamilo
aca65e743a
parsePackageList: include pkgrel in version 2018-08-18 17:54:20 +01:00
morganamilo
907bf3a30e
skip build when package is up to date and --needed
Before --needed was left purerly to pacman. The problem with this is
that if a package is not in the cache, it will end up being build just
for pacman to skip over the install.

Now Yay will handle this and skip the build and install if --needed is
used. The inital clone and pkgver bumb is still donw.
2018-08-18 17:54:17 +01:00
morganamilo
cba56c3f9e
Use downloadPkgbuilds for -G 2018-08-18 17:12:42 +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
afee400662
Use formatPkgbase with getIncompatible
There was a possibly that getIncompatible could be broken when working
with split packages. After looking into it, this does not seem to be the
case, as long as we only work with pkgbases.

arch may be overriden inside of a package function. The global arch
array may be 'any' but package_foo could say arch=('x86_64'). If you
were running arm then should yay warn about this?

I have decided the answer is no. This is because makepkg doesn't care.
It would seem makepkg only checks the global arch array. This leads me
to believe that the global array should contain a the required arch.

Therefore the correct way to do the former example would be to declare
the global arch as 'x86_64' and then override package_bar with 'any'.

So all that we should do is properly use formatPkgbase to list all the
packages under the base.
2018-08-18 17:05:12 +01:00
morganamilo
cd21298355
Return srcinfos instead of using it as a parameter
Also, we do not do a pre and post pkgverbump pass anymore, so theres no
need to name it stale.
2018-08-18 17:05:12 +01:00
morganamilo
29fdf23f50
Remove unneeded code, consistent function names 2018-08-18 17:05:12 +01:00