Skip to content
Permalink
Browse files

make usage of `--ask=4` optional and non default

  • Loading branch information
polygamma committed Jun 12, 2018
1 parent 5c7998b commit 088c09f0b57633db65973b396fc482d0d590c030
Showing with 28 additions and 3 deletions.
  1. +23 −0 README.md
  2. +5 −3 src/aurman/main.py
@@ -258,6 +258,29 @@ Example:
sudo_timeout=120
```
#### Make use of the undocumented `--ask` flag of `pacman`
create a key called `use_ask` in the section `[miscellaneous]` to do that.
Example:
```ini
[miscellaneous]
use_ask
```
Explanation: see - https://git.archlinux.org/pacman.git/commit/?id=90e3e026d1236ad89c142b427d7eeb842bbb7ff4
`aurman` is going to use `--ask=4`, if this config option is set.
That means, that the user does not have to confirm e.g. the installation of packages, or the removal of conflicting packages, again.
"Again" - meaning again for `pacman`.
The user still sees the overview of `aurman`, predicting what is going to happen, which the user has to confirm,
unless using `--noconfirm`.
To make it very clear: `aurman` is only predicting what is going to happen, in every case.
When using `--ask=4`, it is possible, that an upcoming conflict is not detected by `aurman`, hence using `--ask=4` leading
to the removal of a package, the user did not want to get removed.
All in all it comes down to: "Redundant" confirmations of actions, which is less sensitive to errors, but requires more user interactions,
or not confirming multiple times, which is more sensitive to errors.
## Features
- threaded sudo loop in the background so you only have to enter your password once
@@ -319,6 +319,8 @@ def process(args):
clean_force = clean and not isinstance(clean, bool) # if --clean --clean
aur = pacman_args.aur # do only aur things
repo = pacman_args.repo # do only repo things
use_ask = 'miscellaneous' in AurmanConfig.aurman_config \
and 'use_ask' in AurmanConfig.aurman_config['miscellaneous'] # if to use --ask=4

# if the default for showing changes of pkgbuilds etc. should be yes instead of no
default_show_changes = 'miscellaneous' in AurmanConfig.aurman_config \
@@ -693,7 +695,7 @@ def process(args):
pacman_args_copy.asdeps = True
pacman_args_copy.asexplicit = False
try:
pacman(str(pacman_args_copy), False, use_ask=True)
pacman(str(pacman_args_copy), False, use_ask=use_ask)
except InvalidInput:
sys.exit(1)

@@ -714,9 +716,9 @@ def process(args):
and installed_system.all_packages_dict[replaces_dict[package.name]].install_reason
== 'explicit'):

package.install(args_for_explicit, use_ask=True)
package.install(args_for_explicit, use_ask=use_ask)
else:
package.install(args_for_dependency, use_ask=True)
package.install(args_for_dependency, use_ask=use_ask)
except InvalidInput:
sys.exit(1)

0 comments on commit 088c09f

Please sign in to comment.
You can’t perform that action at this time.