Commit graph

55 commits

Author SHA1 Message Date
jguer
e47c9584c1
fix(format): gofumt files 2020-07-08 03:40:50 +02:00
jguer
a0cff2b622
fix(cmdArgs): reorder args 2020-07-08 03:31:35 +02:00
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
968b61ac57
fix(config): pack pacmanConf into runtime 2020-07-05 15:34:27 +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
d0450179f9
fix(usecolor): usecolor belongs to text. remove deprecated 2020-06-26 09:03:45 +02:00
jguer
d003e96e07
fix(ci): fix env propagation
fix broken ci artifact download
2020-06-13 19:49:57 +02:00
jguer
0c45a390a2
fix(locale): make install with locale 2020-05-30 00:43:18 +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
morganamilo
35b2297f1e
Support AURDEST
the AURDEST environment variable can now be used to configure the build
dir.
2019-10-17 23:54:20 +01:00
Jguer
a591b33262
Add errguards throughout the code to enable golangci-lint 2019-10-13 20:56:27 +01:00
Jguer
16fddae8b6 Fix linting error breaking docker release 2019-06-17 13:22:30 +01:00
morganamilo
112046853b
Use correct case on go-alpm import 2019-04-23 16:53:20 +01:00
Motkov Kirill
0878b485ae remove suspicious err reassigns 2019-03-05 23:10:04 +03:00
Motkov.Kirill
50a99c1e54 remove yoda condition 2019-03-05 11:08:37 +03:00
Motkov.Kirill
7b8e45d4e2 rewrite if-else to switch statement 2019-03-04 19:07:04 +03:00
morganamilo
5ce4a49687
Update go-alpm 2019-02-04 16:56:02 +00:00
Jguer
5acee2706f
Fix typo in cache dir. References #840 2018-12-19 21:13: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
e78070ebbe
Support color = auto
This is done using the test command as the stdlib lacks any way to
do this without using syscalls directly
2018-09-27 16:52:22 +01:00
morganamilo
7f064db676
Fix build when go module is enabled 2018-09-15 18:47:46 +01:00
morganamilo
b2f636d93b
Use go-pacmanconf for config parsing
This moves the config parsing from out of alpm and into the
go-pacmanconf libary plus some boilerplate code to get it into our alpm
config.

This makes sense as many config options such as UseColor and CleanMethod
have nothing to do with alpm and only relate to pacman.

pacman-conf is used instead of direct config parsing. This tool resolves
defaults and includes for us, so we don't need to handle it.

It is now safe to drop all the config parsing from go-alpm.
2018-09-10 23:07:34 +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
2f545c7fdc
Correctly set config.AURURL after parsing flags
And also honour aururl during -Pc
2018-08-19 05:53:32 +01:00
morganamilo
0454e8918b
Add --aururl 2018-08-19 05:10:24 +01:00
morganamilo
339a014614
Go back to using os.Getenv
Most programs seem to take an empty string as being the same as unset.
Even if they are technically different. This makes it easier to unset
variables via `VARIABLE= yay --foo`.
2018-08-12 05:09:56 +01:00
morganamilo
febccaef3a
Reorder main
Split functions out into smaller, more simple chunks. Ensure the correct
order of things.

Before, initConfig() would also create config.BuildDirbefore
the command line flags have been applied, so yay would
try to mkdir what was in the config, ignoring the flag.
2018-08-12 05:09:53 +01:00
morganamilo
2fac9c036f
Refactor main.go to use one liner if err checks 2018-08-12 03:53:42 +01:00
morganamilo
1739a88be2
Refactor main function
Move cleanup and error checking to their own functions.
2018-08-12 03:53:42 +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
42a74c41c5
Show alpm warnings 2018-07-31 22:00:41 +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
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
Alan Jenkins
c3a94edd20 Fix failing tests
There were several calls to fmt.Errorf in setPaths where the returned error was not
being used. This was indicated by ```make test``` as shown here:

```
make test
gofmt -l *.go
go vet
./main.go:16: result of fmt.Errorf call not used
./main.go:21: result of fmt.Errorf call not used
./main.go:25: result of fmt.Errorf call not used
./main.go:30: result of fmt.Errorf call not used
./main.go:35: result of fmt.Errorf call not used
./main.go:39: result of fmt.Errorf call not used
make: *** [Makefile:43: test] Error 2
```

With these changes the tests now all pass with no errors.
2018-06-09 15:40:30 +01:00
morganamilo
7fdb5c2007
Make sure enviroment paths are not empty 2018-06-05 14:17:07 +01:00
morganamilo
e5d7cce49c
Fix file paths 2018-06-05 14:14:49 +01:00
morganamilo
3aea877ab9
Tweek config and cache dir initialization
Check if enviroment variables are set instead if they are empty strings.
Don't care if the dir exists just take the path at face value.
Error if $HOME and the respective $XDG.. variables are not set.
2018-06-04 23:31:50 +01:00
morganamilo
c399996cab
Fix typos 2018-05-12 17:16:48 +01:00
Jguer
ba4ef4f51c Use more filepath.Join, standardize separators 2018-04-28 12:15:18 +01:00
Jguer
58772c871b Fixes #373
Signed-off-by: Jguer <me@jguer.space>
2018-04-28 11:53:10 +01:00
Jguer
84569ef6d9 Fix completions from using wrong path. Regression introduced in filepath join
Signed-off-by: Jguer <me@jguer.space>
2018-04-21 16:43:12 +01:00