Commit Graph
70 Commits
Author SHA1 Message Date
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
Jguer d319576303 Use megacheck to lint project
Signed-off-by: Jguer <me@jguer.space>
2018-04-27 01:25:40 +01:00
morganamilo 440004a80c Fix exist sometimes being false for flags 2018-04-17 18:24:39 +01:00
morganamilo 63471b9ede Fix misspellings and typos 2018-04-17 18:01:34 +01:00
morganamilo ef5fda0264 Hanlde double args of mixed short and long types
99% of the time if a user wants to pas an argument twice they would do
`-cc` or `--clean --clean`. Still doing `-c --clean` is still a valid
thing to do. This commits allows getArg() to this properly.
2018-04-17 13:53:37 +01:00
morganamilo 6d876a738c Add --gitflags and --[no]gitclone flags 2018-04-16 13:42:15 +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
morganamilo 8556acdd5f Add flags for sort order and automating menu input
Added:

--sortby <votes|popularity|id|baseid|name|base|submitted|modified>
--answerclean
--answeredit
--answerupgrade
--noanswerclean
--noansweredit
--noanswerupgrade

TODO: docs and completion
2018-04-04 21:53:32 +01:00
Michael Düll fcf0ee34d1 Default action (running yay without any args) is now to -Syu. 2018-03-31 22:55:15 +02:00
morganamilo 0c0cd4f883 Add utils.go 2018-03-22 16:38:21 +00:00
Sergio Correia 9f62663888 Minor cleanups to keep the linter happy
* Unexported:
  - QuestionCallback
  - SliceToStringSet

* Unreachable return in parser.go

* Unneded else in dependencies.go

* Punctuation in error message in install.go
2018-03-19 11:39:47 -04:00
Sergio Correia 32f8396eca Add --gpg' and --gpgflags` flags
`--gpg' is the GnuPG binary, while `--gpgflags' are extra
arguments to be passed to  GnuPG.

Also Update man page and usage regarding GnuPG options.
2018-03-17 19:15:29 -04:00
morganamilo b0961e866d Add full support for reading from stdin
Previosuly when reading from stdin we did not redirect back to the real
stdin afterwards so it was imposible to interact with y/n questions.

Now redirect back to "/dev/tty" just like pacman does.
2018-03-12 00:04:50 +00:00
morganamilo 6988537552 Add parseNumberMenu()
This function is designed to replace the existing number menu
in upcoming commits.
2018-03-10 03:04:44 +00:00
morganamilo 2bb8070213 Add flags for all missing config options
With this The user should never have to manually edit the yay config
file. All options can be set directly through yay using
`yay --<option> <value> --save`
2018-03-08 14:56:53 +00:00