Commit graph

159 commits

Author SHA1 Message Date
morganamilo 2437937372
Show nothing to do message for nocombinedupgrade 2018-07-12 11:12:12 +01:00
morganamilo dcaf1e5595
Fix -Y and remove debug messages 2018-07-06 15:24:03 +01:00
morganamilo 8dd0d97ae0
Properley seprate aur and repo targets.
When not doing combined upgrade the repo targets need to be extracted
for the early pacman call.
2018-07-05 22:20:18 +01:00
morganamilo 43c52c69d2
Also remove -u when not doing combined upgrade
When not doing combined upgrade we do pacman -Syu early. So there is no
need to use -u when installing repo dependencies of AUR packages.
2018-07-04 14:54:24 +01:00
morganamilo 3bdb534321
Separate Pacman upgrade and AUR Upgrade by default
Currently When performing a system upgrade, Yay will first refresh the
database then perform the repo and AUR upgrade. This allows Yay to add
some features such as better batch interaction, showing potential
dependency problems before the upgrade starts and combined menus
showing AUR and repo upgrades together.

There has been discussion that this approach is a bad idea. The main issue
people have is that the separation of the database refresh and the upgrade
could lead to a partial upgrade if Yay fails between the two stages.

Personally I do not like this argument, there are valid reasons to Yay
to fail between these points. For example there may be dependency or
conflict issues during the AUR upgrade. Yay can detect these before any
installing actually starts and exit, just like how pacman will when
there are dependency problems.

If Yay does fail between these points, for the previously mentioned
reasons or even a crash then a simple refresh will not cause a
partial upgrade by itself. It is then the user's responsibility
to either resolve these issues or instead perform an upgrade using
pacman directly.

My opinions aside, The discussions on the Arch wiki has reached
a decision, this method is not recommended. So to follow the decided
best practises this behaviour has been disabled by default.

This behaviour can be toggled using the --[no]combinedupgrade flag

It should be noted that Yay's upgrade menu will not show repo packages
unless --combinedupgrade is used.
2018-06-30 03:40:19 +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 9ecc604558
Reset before editing
Edits where reset via git before building packages. This allows edits to
actually effect the build package.
2018-06-12 21:08:15 +01:00
morganamilo 42f0508625
Add upgrademenu to match {clean,diff,edit}menu 2018-06-11 20:12:17 +01:00
morganamilo 01fa34093f
Support answerdiff to match answer{clean,edit} 2018-06-11 20:11:38 +01:00
morganamilo ab38507bea
Correctly set op and ignore for repo only installs 2018-06-11 18:49:35 +01:00
morganamilo fcb8c35046
Pass to pacman when there's no AUR packages
Instead of doing all the AUR stuff just pass to pacman and return. No
need for any of Yay's stuff when there's no AUR involved.

Of couse everything before that still happens. Upgrade menu ect.
2018-06-11 00:41:39 +01:00
morganamilo 8430c41be9
Rework editing and diff showing
Clean build needs to happen before downloading pkgbuilds so that they
can be deletd before downloading.

Editing and diff viewing needs to happen after downloading the
pkgbuilds.

Prevously we asked to clean and edit at the same time. Then clean,
download pkgbuilds and open the editor.

This poeses a problem for diff viewing and editing. It's likley that the
user will see the diff and use that to decide if they want to edit the
pkgbuild. Using the current method, the user will be asked to view diffs
and edit before actually seeing any diffs.

Instead split cleaning diff showing and editing to three seperate menus
in the following order:
	show clean menu
	clean
	download pkgbuilds
	show diff menu
	show diffs
	show edit menu
	edit pkgbuilds

Also each menu is seperatly enableable. By default only the diff menu is
shows. If the user wishes to clean build, edit pkgbuilds or disable
diffs then the user can use the --[no]{clean,diff,edit}menu flags. This
replaces the --[no]showdiffs flags.
2018-06-10 16:11:23 +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 2b925aefa3
Lint 2018-06-10 03:21:08 +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 43d2a6601a
Split pkgbuild downloading and merging 2018-06-10 03:18:50 +01:00
morganamilo 73bd713217
Split hash fetching and pkgbuild downloading 2018-06-10 03:17:59 +01:00
morganamilo 1b8d9317e4
Split pkgbuild downloading and up to date checks 2018-06-10 03:17:28 +01:00
morganamilo 5775e3c0b7
Split git clone/pull and merge function 2018-06-10 03:17:23 +01:00
morganamilo 64ab60f4b4
Print true pkgver when skipping build 2018-06-05 14:49:18 +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
Anna bd162cc317
Merge pull request #454 from Morganamilo/makepkg
Stop prepare running twice
2018-06-02 15:23:51 +01:00
morganamilo 942e389d85
Stop prepare running twice
Prepare ends up getting ran twice every time we install a package,
theres not problems with doing so apart from a little inefficiency.

Previously the install flow would be like this:
	downlod sources + verify
	prepare + pkgver bump
	full build (prepare included)

Now on the last point pass no extract to use the srcdir from the
previous command and pass noprepare and holdver because we allready did
these steps previously.
2018-06-02 14:16:00 +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 682040319e
Add config option for pgp key fetching 2018-05-31 16:36:36 +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
morganamilo 9afd671905
Support any PKGDEST and PKGEXT
Pacman 5.1 removes the symlink to the current directory for built
packages. This causes Yay to break for people who have set an external
PKGDEST.

Pacman 5.1 also brings an improved --packagelist option. This makes
it much simpler to find where packages will be placed. Hence this fix
also simplifies the code.

Yay has an -Sc option to clear it's cache. If using an external PKGDEST
this is now mostly useful for clearing out old pkgbuilds and sources.
paccache should be used for cleaning build packages.
2018-05-31 05:42:03 +01:00
morganamilo 7a1e2de6cd
Simplfy upgrade skipping 2018-05-30 03:21:17 +01:00
morganamilo e76f978d63
Only show warnings for pkgs that are being updated
The previous warning system would show warnings recursivley for all
packages being resolved. While I like this, other have complained at it
being overly verbose.

Either way the main purpose of this is to allow warnings to be printed
before the upgrade menu shows. This is mostly just to get a usable
warning system.

This may change if a better solution is found.
2018-05-29 23:39:02 +01:00
morganamilo b140e66f6a
Improve --asdeps and --asexplicit handling
Correctly handle --asdeps and --asexplicit for both repo packages and
aur packages.
2018-05-29 22:35:58 +01:00
morganamilo 33d056e9ac
Split Targets to Targets and Explicit
Targets are used for tracking wether a package should be marked as
explicitly installed or as a dependency. This is not ideal because you
can have a target such as java-environment that resolves to a different
package.

Therefore Targets are now used only for the initial dependency resolving
and checking for missing dependencies. The Explicit set is now used to
mark what packages are explicit, seperate from the targets.
2018-05-29 16:47:43 +01:00
morganamilo d51205194e
Support skiping updates and showing warnings
The warnings were moved down to after the upgrade menu, mainly because
it is a lot easier to do this way, it may get moved back if it can be
done in a non hacky way,
2018-05-29 13:15:40 +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 671f836ec5
Calculate makeDeps properly
MakeOnly would be set to true when moving from normal deps to make deps
But would incorrectly stay set to true when moving to the deps of the
following packages.

depOrder.Aur now only holds one package from each base like
depCatagories does.
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
J Guerreiro 0c49f0f7cb
Merge pull request #419 from Jguer/impgopkgchange
Implement new gopkgbuild Newer method
2018-05-15 12:48:39 +01:00
Jguer 3dc5238bd2 Implement new gopkgbuild Newer method
Signed-off-by: Jguer <me@jguer.space>
2018-05-14 22:22:47 +01:00
Jguer d15f899809 Fixes #417
Signed-off-by: Jguer <me@jguer.space>
2018-05-14 18:33:48 +01:00
morganamilo 1b6d80f122
Fix --ignore flag while skipping updates ammended
Ammend to 58d53b1
Thought this was already included in the commit.
2018-05-12 00:24:47 +01:00
morganamilo 2bf310d37c
Fix --ignore flag while skipping updates
If --ignore was specified on the command line and the user skips
packages using the number menu, packages would not be properly skipped
because they the manual --ignore would overide the --ignore from the
menu.

Now correctly combine both --ignore flags into a single combined flag
when passing to pacman.
2018-05-12 00:17:10 +01:00
morganamilo 5e712b221e
Add missing --ignorearch arg to makepkg call 2018-05-10 21:02:03 +01:00
Jguer 66362aa981 Bump MAJOR_VERSION
This bump reflects the big change introduced with using git cloning.
Therefore we know all versions pre-6 do not use git clone

Signed-off-by: Jguer <me@jguer.space>
2018-04-26 20:53:34 +01:00
Tom Swartz 1c9715dddf Fix typos 2018-04-23 13:06:56 -04:00
morganamilo 8ccb5de6ac
Prefix aur/ to aur updates 2018-04-17 19:54:44 +01:00
morganamilo 63471b9ede
Fix misspellings and typos 2018-04-17 18:01:34 +01:00
morganamilo 110a905a0c
Use filepath.Join() for adding paths together 2018-04-17 01:32:31 +01:00
Jguer 0216b116f4 Fix typos and lint
Signed-off-by: Jguer <me@jguer.space>
2018-04-16 14:13:11 +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 24f596959d
Dont bump pkgver() while downloading sources
Previously we ran pkgver() right after dowloading sources. This is
a problem because prepare() should be called and all dependencies
should be installed before pkgver().

Instead bump the pkgver while building then get the new pkgver used for
install. Previously we parsed `makepkg --printsrcinfo` to get the new
version. Insead use `makepkg --packagelist` as it is much faster.
2018-04-16 00:17:56 +01:00