Commit Graph

1972 Commits

Author SHA1 Message Date
Jguer
61065dc930
Satisfied linter 2018-01-19 23:51:18 +09:00
Jguer
4218a47ef2
Updated vendored packages 2018-01-19 23:32:07 +09:00
J Guerreiro
51b2f02eb8
Merge pull request #92 from l4foss/fix_query_info
fix query info with -Si
2018-01-19 00:23:44 +09:00
J Guerreiro
7c4aa993f7
Merge pull request #102 from Morganamilo/countfrom0again
Count from 0 on upgrade prompt
2018-01-18 21:13:55 +09:00
morganamilo
91662d7e9d
Count from 0 on upgrade prompt 2018-01-18 12:08:40 +00:00
J Guerreiro
479e2f0ce0
Merge pull request #97 from samosaara/master
Support for ranges when selecting packages
2018-01-18 21:02:35 +09:00
J Guerreiro
abdb1aeca5
Merge pull request #101 from Morganamilo/fixdumbbug
Fix makepkg not behaving correctly
2018-01-18 21:00:44 +09:00
morganamilo
93a861c725
Fix makepkg not behaving correctly
This bug was caused by me not thinking when passing flags to aurInstall.
Currently a bunch of functions take an array of flags but we don't really
use them any more after the argument parsing update. These should be
refactored out eventually but I'm holding off until I'm more sure about
how these functions should look.
2018-01-17 04:14:44 +00:00
J Guerreiro
bb22e8e889
Merge pull request #98 from Morganamilo/fixes
Small fix and manpage update.
2018-01-16 09:45:50 +09:00
l4
8c1d64c06b local repo goes first
remove the old function

local repo goes first

exit on err passToPacman()
2018-01-16 00:09:32 +07:00
l4
b1e01b3af5
Merge branch 'master' into fix_query_info 2018-01-15 21:02:44 +07:00
morganamilo
d21f7ed373
Update manpage 2018-01-14 20:34:08 +00:00
morganamilo
4da65a6a22
Fix error when no vsc_config exists 2018-01-14 20:26:30 +00:00
Samuel Henrique Oliveira da Silva
12641befac Keeping up with master
- Minor linting fixes.
2018-01-14 17:17:15 -02:00
Samuel Henrique Oliveira da Silva
d737c99c81 Excluding from installation
#ItWoksOnMyMachine
2018-01-14 16:53:37 -02:00
Samuel Henrique Oliveira da Silva
0301eb0440 Negation for upgrading 2018-01-14 15:48:16 -02:00
Jguer
41e9f8694e Merge branch 'Morganamilo-fix#71' 2018-01-15 02:23:36 +09:00
Jguer
4abddaab66
Satisfied linter 2018-01-15 02:23:29 +09:00
Jguer
b18724ac7e Merge branch 'fix#71' of https://github.com/Morganamilo/yay into Morganamilo-fix#71 2018-01-15 02:22:41 +09:00
Jguer
92e9eed230
Updated go-alpm vendored version 2018-01-15 02:21:50 +09:00
Jguer
9cbef8d643 Merge branch 'Morganamilo-fix#62' 2018-01-15 02:13:19 +09:00
Jguer
62af87bb0f
Merged argument parsing system 2018-01-15 02:12:51 +09:00
Samuel Henrique Oliveira da Silva
6d2dcad091 Replicates the range functionally to upgrade 2018-01-14 14:04:15 -02:00
Samuel Henrique Oliveira da Silva
29cd864bbe Support for ranges when selecting packages
- Also, minor formatting to cmd.go
2018-01-14 13:15:32 -02:00
J Guerreiro
efbda98094
Merge pull request #94 from Morganamilo/fixnl
Fix formatting on -Si for aur packages
2018-01-14 00:50:58 +09:00
J Guerreiro
45e0b5509f
Merge pull request #93 from Morganamilo/addbottomup
Add missing --bottomup option
2018-01-14 00:48:44 +09:00
J Guerreiro
ed6f05eb19
Merge pull request #84 from Morganamilo/fix#78
Fix crash when package version is "invalid"
2018-01-14 00:47:14 +09:00
morganamilo
0fb4b3bab3
Use go-alpm for ignorepkg/ignoregroup 2018-01-10 00:38:32 +00:00
morganamilo
a3df41368b
Merge branch 'master' into fix#62 2018-01-07 21:59:39 +00:00
morganamilo
92683dc3ed
Fix formatting on -Si for aur packages
Add missing \n
Remove trailing [ and ] on slices
2018-01-07 17:36:31 +00:00
morganamilo
40a881927c
Add missing --bottomup option 2018-01-06 23:28:07 +00:00
l4
ba143bdb36 fix query info with -Si 2018-01-06 20:50:54 +07:00
J Guerreiro
32ecd8b1dd
Merge pull request #83 from Morganamilo/searchfrom1
Count from 1 instead of 0 when searching packages
2018-01-06 22:47:45 +09:00
J Guerreiro
65c0c52a75
Merge pull request #91 from Jguer/revert-82-master
Revert "Add missing --bottomup option"
2018-01-06 22:46:47 +09:00
J Guerreiro
04ebd39b53
Revert "Add missing --bottomup option" 2018-01-06 22:46:07 +09:00
J Guerreiro
82a4b30484
Merge pull request #82 from Morganamilo/master
Add missing --bottomup option
2018-01-06 09:46:34 +09:00
morganamilo
60deeb2ceb
Update manpage 2018-01-05 22:29:49 +00:00
morganamilo
142cb25f95
Fix deps not being passed to pacman properly 2018-01-05 22:15:12 +00:00
morganamilo
c0fc086a07
Pass command line arguments to alpmConf before init
This allows us to use command line options such as '--root' and '-b' when
performing operations that use out alom handle.

Sadly this does not apply to passToMakepkg which will ignore options
such as '--root' and because we pass '-i' to makepkg it installs for us
using the default options.

Currently I have not planned a solution for this but one which I thought
of but not looked into is. Always call makepkg without arguments (except
from '--noconfirm' and others which might still be needed) and manage
the dependancies and post install outselves.

Another option might be to use makepkg's $PACMAN enviroment variable and
redirect the pacman calls to yay. Although I am unsure about both
stratergys they are just my current thoughts.

Also while editing the flow of cmd.go, I managed to refactor away all
os.Exit calls apart from the very last so it should be more clear as to
where the program exits.
2018-01-04 22:48:54 +00:00
morganamilo
232edc64a6
Further integration for the argument system
Argument parsing now works mostly as expected for repo packages.
AUR packages are a little tricky becauce makepkg cant handle args such
as '--dbpath'.

Also out alpm handle does not read the commandline options so any
arguments relient on alpm will be ignored.

For now though it seems yay has gained back the functionality it once
had. While also having improved argument handling which should also be
expandable and make it easier to handle anything new that might have
been missed.
2018-01-04 08:32:50 +00:00
morganamilo
16b747cb2d
Make the parser aware of global pacman arguments
Allows globals to be tracked more easily so that thay can be seperated
from normal arguments and passed easily while not passing other
arguments.

Also fixed some missing checks and bugs.
2018-01-04 08:32:50 +00:00
morganamilo
44f83e03ea
Move makepkg handling to its own function 2018-01-04 08:32:50 +00:00
morganamilo
96f499ff44
Reimplement all previously existing operations
This reimplemens all operations yay previously supported:
	'-S' 'Syu' 'Si' ect.

Currently the argument objects are not fully implemented with the code.
Theres alot of funky conversion from
	argument object -> pkg, flags -> argument object
This is to just get back to the functionally we had before (almost).

I have not looked into it yet but alot of the time pacman flags get
passed to makepkg. this cases an error for most commands now because the
new system Passes all flags:
	`yay -Syu` -> flags = '-S' '-y' '-u'
while the old system would have done:
	`yay -Syu` -> op = '-Suy', flags = ''

So extra flags are no longer passed at all currently.

This means:
	'yay -S aic94xx-firmware --noconfirm -b /tmp/pacutilesu2q6hw/tmp-pacman -d'
will no longer error and 'aic94xx-firmware' will be installed but the
database path change will not apply and the dep checking will not be
skipped.
2018-01-04 08:32:50 +00:00
morganamilo
3084f91ba7
Reimplement getpkgbuild
Futre todos:
	Add option to fetch deps
	Add option to set download path
2018-01-04 08:32:50 +00:00
morganamilo
68a9771327
Move passToPackman from config.go to cmd.go 2018-01-04 08:32:50 +00:00
morganamilo
df27396fa0
Teach passToPacman how to use argParsers
passToPacman now takes and argParser as a paramater. And is implemented
for the simple cases in cmd.go. Although passToPacman is now left non
working in places which still try to usr the old call format and will
need to be reimplemented.
2018-01-04 08:32:50 +00:00
morganamilo
2b47a4d9f0
Refactor away os.Exit
Try to minimise the useage of os.Exit

Apart from init, os.Exit is only used once as the final function call.
Now we can ensure there are no random exits hidding in the code. We can
also allow part of the code to error and continue on while also
remembering that we did error and return non 0 when we finally do reach
the os.Exit. This comes in very handy for trying to save the vcs info
after an error and ensuring that alpmHandle.Release is always called.
2018-01-04 08:32:50 +00:00
morganamilo
765b767333
Rework some of the yay specific operations
Some of the yay specific operations such as:
	'-Qstats' '-Cd'
Break the standard pacamn has set.

Most yay specific specific options have been moved into their own
operator:
	'-Y' '--yay'
	'-Qstats' -> '-Y --stats'
	'--Cd' -> '-Y --cleandeps'
	'--gendb' -> '-Y --gendb'
Although:
	'-G'
has been kepts and and alias has been added for is:
	'--getpkgbuild'

This shouldnt feel too different for most people given that yay will
default to:
	'-Y'
when no operator has been specified. So calls like:
	'yay --gendb'
will still work as they did.

Internally handleConfig has been partially refactored. Now all that
remians in setters for config. All flags that did anything beond setting
config have been moved to handleYay(). This means less nasty
os.Exit()'s and nicer flow control.

The usage has also been updated. The options changes have been added but
the layout has also been tweaked a bit.

Lastly on the things not done:
	Man page has not been updated
	Shell completion has not been updated

This will be done in further commits as the usage is not guaranteed
to stay the same between now the completion of the argument system.
2018-01-04 08:32:44 +00:00
morganamilo
19efb1f121
Foundation for re writing the argument parsing system
Currently the foundation for a new fuller argument parsing has been implemented in
parser.go. Most of the parsing is now done through the argParser object
instead of seperate arrays for options and packages. The rest of the
code still expects the old system so I have left most of the operations
unimplemented for now until I redo it with the new system. Currently
only '-S' and number menu have any functionality for testing purposes.

This new system parses arguments fully instead of just looking for
predefined strings such as:
	'-Sqi' '-Siq'.
This allows:
	'-Syu', '-S -y -u', '--sync -y -u'
to all be parsed as the same.

This system tries to be as similar to pacman as possible, eventually
aming to fully wrap pacman, allowing yay to be used instead of pacman in
all instances.

The current implementation is not as strict as pacman when checking
arguments.  If you pass
--someinvalidflag to yay then yay will simply ignore it. The flag should
still be passed to pacman which should then cause an error.

Although operations '-S' '-R' '-U' ect. are checked to make sure you can not
try to use two operations at once.

conflicting flags such as:
	'--quiet' and '--info'
will not raise an error and which options gains precedence is depend on
the implementation.

Another minor issue which is worth noting is. Due to the way double
arguments are parsed:
	'-dd' '-cc' '--deps --deps'
if you pass the long version and the short version:
	'-d --deps'
yay will not realize its a double argument. Meanwhile pacman will
reconise it when yay calls pacman.

Currently there are a few things that need to be done before this new
system can be fuly released:
	Reimplement all operations to use to new parsing system so that
		the new system is at least as functional as the old one
	Strip yay specific flags before passing them to pacman
	Move parts of config into the argument system and only use
		config for options that are meant to be saved to disk
	Move yay specific operations into its own operator '-Y'
	Update documentation to show the altered syntax
2018-01-04 01:14:25 +00:00
morganamilo
952d95273a
Fix crash when package version is "invalid" 2017-12-30 22:52:33 +00:00