Commit graph

20 commits

Author SHA1 Message Date
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
Jguer a591b33262
Add errguards throughout the code to enable golangci-lint 2019-10-13 20:56:27 +01:00
Jguer b01790f752
Moved StringSet definition to types package 2019-10-05 18:39:31 +01:00
morganamilo 112046853b
Use correct case on go-alpm import 2019-04-23 16:53:20 +01: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
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 7702a88ebb
Print conflicts in order of install
This is usefull for inner conflicts, you can follow when packages will
be swapped out with others.
2018-10-13 18:24:22 +01:00
morganamilo f648697994
Rework inner conflicts
Inner conflicts now check against the previously installed aur packages
For example when installing yay, yay-bin and yay-git

yay will be checked the previously insalled packages (nothing)

yay-bin will be checked the previously insalled packages and see that it
conflicts with yay and warn you that yay will be removed

yay-git will be checked the previously insalled packages and see that it
conflicts with yay but see that it has already been removed by yay-bin
so does nothing. Then it will see that it conflicts with yay-bin and
warn you that yay-bin will be removed

This example is unlikley to happen unless the user enters
`yay -S yay yay-bin yay-git`. But where this does happen is packages
which have some sort of bootsrapping process such as ffmpeg-libfdk_aac.

If two repo packages conflict then we abort. This is because they will
be installed at the same time and we never swap repo packages mid AUR
install.
2018-10-13 17:04:22 +01:00
morganamilo 5080e400e1
Remove printing conflict name in conflicts
Currently when printing conflicts the package name is printed and then
name of the conflict if it differs from the package name.

For example if yay-git is installed and you are installing yay-bin:
	yay-bin conflicts with yay
	yay-git provides yay

	so the conflict is printed as "yay-bin (yay)"

This is not too bad but some packages have many provides and conflicts
that ends up cluttering the output.

For example if gvim is installed and you are installing vim:
	"gvim, gvim (vim-minimal), gvim (vim)" is printed

Just printing the package name should be enough information. If not the
user can always -Si either package.
2018-10-13 17:04:22 +01:00
morganamilo ff4f076d57
Move depSolver checks back to depCheck.go 2018-10-13 17:04:22 +01:00
morganamilo a83f8fb9e8
Remove depPool and depOrder code 2018-10-13 17:04:21 +01:00
morganamilo 3861aef502
Don't abort on inner conflicts
Currently there may be times where there are inner conflicts but the
install would go okay as packages will be swapped out as they go. Warn
the user but leave it up to them if they want to continue.
2018-10-10 16:31:55 +01:00
morganamilo 1d17940ce9
Abort ealy when there's conflicts with --noconfirm
When using --nouseask, manual intervention is needed to resolve conflicts.
When also useing --noconfirm the install will always fail. So abort
early, before trying to install any AUR packages.
2018-07-20 20:42:47 +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 ea5a94e0f8
Remove default usage of --ask
--ask is no longer used when installing AUR packages, instead pass no
confirm when we know there are no conflicts and wait for manual
confirmation when there are.

This means that when there are no conflicts there should be no change in
behaviour and the user will not need to intervene at all.

The old behaviour can still be used with --useask.
2018-06-22 15:17:34 +01:00
morganamilo 943b2f931a
Tweak missing packages text 2018-05-30 04:06:29 +01:00
morganamilo 6e990e4dc5
Don't conflict with pkgs that are in the depPool
When upgrading multiple packages that are already installed we should
not conflict with already installed packages that are in the depPool.

This is because the version in the depTree is going to replace the
currently installed version of the package and may have different
conflicts.

If there is a conflict between stuff in the depPool these should be
handled by the innerConflicts check anyway.
2018-05-29 13:15:45 +01:00
morganamilo 7b558ba47c
Fix check for missing dependencies
We dont check the dependencies of things already installed becuase,
well, they're already installed. But we should check the dependencies of
targets even if they are installed because they get reinstalled.
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