Commit graph

270 commits

Author SHA1 Message Date
jguer 7a32ffdd37
fix(cmdArgs): deglobal cmd args 2020-07-08 03:22:01 +02:00
jguer 36730a41e3
fix(config): package alpmHandle into runtimeSettings 2020-07-05 16:58:35 +02:00
jguer 0bae6e2f7d
fix(config): move default settings to config 2020-07-05 09:36:27 +02:00
jguer 9b49f76bbd
fix(config): vcs filepath fix 2020-07-05 09:36:27 +02:00
jguer 2dc01d8a3e
fix(init): refactor init to use runtime 2020-07-05 09:36:27 +02:00
jguer fb5b6b74fe
fix(parser): package parser 2020-07-05 09:36:27 +02:00
jguer cb8a988701
fix(news): package news and begin settings 2020-07-05 09:36:27 +02:00
jguer d003e96e07
fix(ci): fix env propagation
fix broken ci artifact download
2020-06-13 19:49:57 +02:00
jguer 87d0dd64c3
fix(locale): add base locale 2020-05-08 18:13:51 +02:00
jguer 732f1a5412
feat(localization): wrap all translatable strings 2020-05-05 19:21:42 +02:00
jguer 9fccdcb30f
fix(ci): implement stricter linting settings 2020-05-02 16:17:20 +02:00
Maxime Houis fe091f7578 Fix typo in usage 2020-03-09 15:00:19 +01:00
Dominik Schrempf 2ffde239c0 Bugfix apostrophe and bracket 2020-02-25 22:53:22 +01:00
Dominik Schrempf fd7945b42b Move note yay --option /= yay -Syu --option. 2020-02-25 22:53:22 +01:00
morganamilo f2959922a7
Remove tar support
tar is slower and harder to diff. I doubt any one still uses it intentially.

There's a chance some people have not cleared their cache in two years
and still have tar based packages around. But forcing them to clear
their cache is not a big deal at all.
2019-11-11 02:57:14 +00:00
Pierre-Alain TORET 6dd65a2df2
Add SudoBin and SudoFlags 2019-10-28 18:35:36 +00:00
morganamilo 3baf2e1ff1
Update documentation 2019-10-21 15:30: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 4d91acc749
Re-add --batchinstall and fix dep issues 2019-10-16 20:59:52 +01:00
J Guerreiro 6e2a4def99
Merge pull request #1048 from Jguer/module-types
Module types
2019-10-07 12:10:40 +01:00
cominixo01 a7619cce2b Only remove VCS if the package was removed successfully (#1041)
* Only remove VCS if the package was removed successfully

* Use := instead of var

* Fix formatting
2019-10-05 20:20:20 +01:00
Jguer bf89b3383c
Move IntRange definition to types package 2019-10-05 19:23:13 +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 5ac36ad97e
Ensure global pacman arguments are always used 2019-06-17 13:03:57 +01:00
morganamilo 112046853b
Use correct case on go-alpm import 2019-04-23 16:53:20 +01:00
Jguer cf12fc6ff2
Fix #919, require explicit sort mode defined 2019-04-04 21:47:44 +01:00
J Guerreiro 888a289a1b
Revert "Add SudoBin" 2019-03-29 22:09:27 +00:00
Pierre-Alain TORET 877c794bc2 Add SudoBin and SudoFlags 2019-03-27 15:16:39 +01: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
Dan Minkevitch eab94628ec Fix typos in help menu 2019-02-02 17:36:46 -08:00
morganamilo 4f01418769
Support -Sl
Adds (mostly) complete -Sl support. While pacman will also print the
version number for the package, packages.gz does not give version
numbers. Using -Si to fetch all that data would also be unthinkable.

Instead of just missing out the version number yay will print
"unknown-version". This is so that tools that expect a version number do
not break.
2019-01-26 23:31: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
morganamilo 4cc57dd970
Rename afterclean to cleanafter
This makes more sense and falls in line with the structs value which has
always been cleanafter. afterclean is still useable for compatibility
but is undocumented.
2018-09-27 16:12:43 +01:00
morganamilo b0aaba7848
Fix misleading word in man page and missing \n 2018-09-20 00:46:10 +01:00
morganamilo 0e695468b8
Expand env before making builddir 2018-09-04 23:07:26 +01:00
morganamilo 8c1658df0b
Expand environment variables in config 2018-08-31 21:20:40 +01:00
morganamilo 29642d181f
Document -f for -G and --print -> --show 2018-08-30 16:09:00 +01:00
morganamilo 92ff640a65
Document --aururl 2018-08-29 21:18:37 +01:00
morganamilo 5ef38c12bd
Update usage and man page 2018-08-05 15:24:39 +01:00
morganamilo 2d6fe95903
Add yay specific args, drop conflicting args
Replace -P/--print with -P/--show
Replace --config with --currentconfig
2018-08-05 15:22:04 +01:00
morganamilo 4e67c1e886
Simlify huge case statments
Instead of having true in every case, rely on the lack of fallthrough
causing the default not to trigger.

Moved handleConfig to parser.go
2018-08-02 14:50:56 +01:00
Anna 0746d2828b
Merge pull request #601 from xyproto/minor
Only minor changes
2018-08-02 14:10:50 +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 06a45bad59
Don't return length with queryRepo 2018-07-31 22:01:14 +01:00
Alexander F. Rødseth e9d0b8bee6 Refactor a named return
Ref: 29f3e011ec (diff-0cf3d18277fde705f1a4eb69fddfefc1L407)
2018-07-31 13:11:26 +02:00
Alexander F. Rødseth 29f3e011ec Only minor changes 2018-07-31 11:15:17 +02:00
Anna 5f107ad7ad
Merge pull request #599 from Morganamilo/unused
Remove unneeded variables
2018-07-30 14:29:54 +01:00
morganamilo 2a60dd7052
Remove unneeded variables 2018-07-30 14:14:16 +01:00
morganamilo 6fe17ad0c1
Update usage 2018-07-30 05:01:03 +01:00
morganamilo 5ce740068e
Always pass PacmanConf to pacman
Normaly we only pass --config to pacman if the user specifies it on the
command line. Otherwise we let pacman use it's default config location.

If the user has changed pacmanconf in Yay's config file then this could
cause a miss match between the config we use to init alpm and the config
pacman is using.
2018-07-28 19:54:41 +01:00
morganamilo a54b949670
Show alpm version with -V 2018-07-28 03:45:04 +01:00
Anna 74f4a44da6
Merge pull request #584 from Morganamilo/completion-slow
Rework completion
2018-07-26 13:56:06 +01:00
morganamilo bc6028348b
Make the completion refresh time configurable
The default setting is 7 days. The user can specify a different time in
days. -1 can be set to never refresh while 0 can be used to always
refresh.
2018-07-26 13:54:13 +01:00
morganamilo 9c882614a3
Rework completion
Bash seperates on whitespace, so the fish completion file
actually works for bash and zsh. So remove the concept of shells
entirley and just use the singular aur_sh.cache file.

If for some reason output without the repository data is needed, the
user could always just pipe it into awk like so
`yay -Pc | awk '{print $1}'`. Or perhaps a --quiet option could be added
where yay will strip the output itself.

The completion cache now updates when installing AUR packages. This is
done as a goroutine with no wait groups. This ensures the program will
never hang if there is a problem.

The completion is stil updated during -Pc but as long as an AUR package
has been installed recently it should not need to update.

The cache will now also wait 7 days instead of 2 before refreshing.
A refresh can be forced using -Pcc.
2018-07-26 13:54:10 +01:00
morganamilo c4fec3dad0
Wrap -Sp
Currently we do not handle -Sp, this leads to yay trying a proper
install and failing. So instead pass it to pacman and exit. Ideally we
would extend -Sp to include AUR packages but for now don't bother.
2018-07-25 11:16:30 +01:00
Anna 96532c0b27
Merge pull request #562 from Morganamilo/#560
Add --makepkgconf
2018-07-24 13:08:21 +01:00
morganamilo 4af671afac
Add --[no]makepkgconf 2018-07-24 13:07:17 +01:00
morganamilo 253d162b5b
Remove unused code, fix typo for -g flag
As it turns out, the times you need root also tend to be the time you
need to manipulate the database. So the needWait() function can be
removed and repllaced by needRoot()
2018-07-21 17:40:32 +01:00
morganamilo ec48698f35
Add --{no,ask}removemake 2018-07-21 14:20:00 +01:00
morganamilo 257653047b
Move sudoloop code to exec.go 2018-07-19 18:58:04 +01:00
morganamilo 8427dc3804
Move passToFoo() functions to their own file 2018-07-19 18:48:46 +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 686e1baaf4
Update readme, depreciate -Pu and -Pn 2018-07-17 22:01:52 +01:00
morganamilo 4f1a46eed8
Add bash and zsh completion for new flags 2018-07-01 17:21:54 +01:00
Jguer 89b5a1b798
Fix invalid uppercasing in flags
Signed-off-by: Jguer <me@jguer.space>
2018-07-01 14:53:48 +01:00
morganamilo a91dc9e557
Document --[no]useask and --[no]combinedupgrade 2018-07-01 14:35:01 +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
Anna 77a5cf5c69
Merge pull request #504 from Morganamilo/noask
Remove default usage of --ask
2018-06-24 16:30:28 +01:00
morganamilo 67817e2a19
Return when no packages are to be installed. 2018-06-23 16:19:25 +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 1952f88c34
Remove a space 2018-06-12 21:10:41 +01:00
morganamilo 4bfa5f6128
Document --[no]upgrademenu 2018-06-11 20:12:17 +01:00
morganamilo 42f0508625
Add upgrademenu to match {clean,diff,edit}menu 2018-06-11 20:12:17 +01:00
morganamilo d0bc1d70d9
Document new flags 2018-06-11 20:11:38 +01:00
morganamilo 01fa34093f
Support answerdiff to match answer{clean,edit} 2018-06-11 20:11:38 +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 ced35af515
Support --aur/--repo for -Ss and -Y 2018-06-04 20:36:10 +01:00
morganamilo a71784684c
Add new options to usage 2018-06-04 19:16:43 +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
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 c464af6b9b
Implement config option for provider searching 2018-05-29 17:40:35 +01:00
Jonas Thiem 976876961b Add completions for --news 2018-05-06 03:31:09 +02:00
Jonas Thiem 8dd08327b1 Add --news to --print 2018-05-06 02:26:03 +02:00
morganamilo 99c7b5bb44
Update man page and tweak usage 2018-04-23 02:24:23 +01:00
morganamilo 63471b9ede
Fix misspellings and typos 2018-04-17 18:01:34 +01:00
morganamilo 86bfacd253
Remove unneeded vars and fix missing err check 2018-04-17 17:57:02 +01:00
morganamilo 683890c1b8
Add support for -Sc
-Sc will delete cached AUR data from Yay's build dir according to
the `CleanMethod` specified in the Pacman config file.

-Scc will delete all cached AUR data.

Additionally -Sc will also delete all untracked files in the AUR cache.
This will delete things such as downloaded sources and built packages
but will leave directories behind.

This is very usefull because the only reason a directoiry should exist
in the cache is because of downloaded VCS sources. Non VCS sources are
redownloaded every update because when a new version is released a new
tarball has to be downloaded. But VCS sources are never redownloaded,
updates are simply pulled. For this reason the user probably wants to
keep this data as it is still usefull even after building and installing
a package.
2018-04-17 13:53:37 +01:00
Jguer cfd244f377 Add missing entries
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 6d876a738c Add --gitflags and --[no]gitclone flags 2018-04-16 13:42:15 +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
morganamilo f1e98e45a6
Support flags when using the editor
Added --editorflags alongside --editor
$VISUAL and $EDITOR are split on whitespace
2018-04-09 20:50:18 +01:00
Morgana 13ef6f66ab
Merge pull request #275 from ratorx/master
Recursively remove dependencies when using yay -Yc
2018-04-09 17:01:00 +01:00
morganamilo e05d86b31b
Document fcf0ee34d1 2018-04-08 15:49:56 +01:00