Commit Graph
84 Commits
Author SHA1 Message Date
Jguer a591b33262 Add errguards throughout the code to enable golangci-lint 2019-10-13 20:56:27 +01: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 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 5ac36ad97e Ensure global pacman arguments are always used 2019-06-17 13:03:57 +01:00
Harry Arakkal 48e1d65539 Updated sudo check for -Rp 2019-05-17 21:26:22 -07: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
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
Jguer 2ed7df4f5a Unexport consts. Make default a literal
Signed-off-by: Jguer <me@jguer.space>
2018-10-22 21:00:16 +01:00
morganamilo 8c44da374c Add ask to accepted flags
Again, the list was generated via the manpage and as this is
undocumented it was forgotten.
2018-10-13 01:31:16 +01:00
morganamilo 0f4768b4fe Allow --print again
Comit 2d6fe95903 renamed the Yay specific
flag -P/--print to -P/--show. The rename caused --print to stop being
accepted as it was no longer in the list of accepted args.
2018-10-09 16:15:46 +01:00
morganamilo 73deae94cf Fix missing '-' in flags
isArg() was generated from pacman's manpage using a script. All dashes
were stripped out. Some flags used '-' as a seperator and were stripped
out by mistake.
2018-10-09 16:06:14 +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 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 60cf21f445 Accept --assume-installed 2018-09-23 22:10:22 +01:00
morganamilo 004595a396 Dont rm directories with -G unless using -f 2018-08-30 15:30:52 +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 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 16d4a2ca88 Support = on long opts, not short opts 2018-08-08 16:21:33 +01:00
morganamilo 6b35f9ee2f Revert "Support -r=foo syntax"
This reverts commit 97006ade19. But keepts
the usr of k+1 and len(arg)-1
2018-08-08 16:20:38 +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 db9ff186d6 Accept - and -- options 2018-08-02 16:51:33 +01:00
morganamilo 97006ade19 Support -r=foo syntax 2018-08-02 14:50:56 +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
morganamilo d9823e4230 Error on unkown args
This is simply implemented by looking up against all the args. No
conflicts are checked such as using -Ss and -Si at the same time or using
-u with -D.
2018-08-02 14:50:51 +01:00
morganamilo b4c102a17a Split stdin on new line
Pacman 5.1 changed the stdin seperation from whitespace to newline. To
maintain corectness we should also do this.
2018-07-30 01:16:36 +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
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 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 562a21fb4d Support --aur/--repo with -Sc 2018-07-24 02:49:45 +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
J Guerreiro f9972da763 Wait for db.lck to become available before starting a db operation (#573)
* Wait for db.lck to become available before starting a db operation

* Fix err!=nil issues and avoid spamming users

* Remove redundant cases

* Remove return
2018-07-21 16:18:19 +01:00
J Guerreiro a97034fc8b Merge pull request #524 from AlexWayfer/support_commas_in_parse_number_menu
Support commas in parserNumberMenu
2018-07-02 16:40:05 +01:00
Alexander Popov 6eded7c4a3 Support commas in parserNumberMenu 2018-07-02 18:21:00 +03:00
Daniel Wendler (@cassandra) fef91ab371 run pacman -Qk(k) as root
fixes #525
2018-07-02 14:15:57 +02:00
morganamilo 01fa34093f Support answerdiff to match answer{clean,edit} 2018-06-11 20:11:38 +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 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
morganamilo c399996cab Fix typos 2018-05-12 17:16:48 +01:00
morganamilo 38818757c8 Lint 2018-05-10 20:18:16 +01:00
morganamilo 21b7899083 Use built in html escaping 2018-05-07 06:26:29 +01:00
morganamilo a10241f7ab Print descriptions of news
Print the full descriptions of each news item.

The description is formatted as html, basic parsing is done to display
it properly. -q/--quiet can be used to diplay title only.
2018-05-07 01:46:08 +01:00
morganamilo debe19278a Fix warning by megacheck in parser 2018-04-27 02:43:10 +01:00