pacman: implement universal transactions
This allows using -S, -U and -R in one command: pacman -S foo -R bar To make this work some breaking changes have made. Targets have to come after the operation: pacman -S foo //works pacman -Syu //works pacman -yuS //works pacman foo -S //doesn't work This could be supported with some code to copy all targets before the first operation into the first operation's target list. And -u as a short for --unneeded has been removed as it conflicts with --sysupgrade. However has -u/--sysupgrade is bound to -S, accidently doing `pacman -Ru` will not accidently cause a system upgrade. Another quirk with the ui is that -S has many non transaction related flags, -Sc -Sg -Sl -Si. These have been split off as "sync only" flags. Meaning they show up with `pacman -Si foo` but will be invalid on `pacman -R bar -Si foo`. Also when -R'ing and -S'ing the same package in come command it's treated as a full uninstall then reinstall. The backup files are .pacsave'd and the install reason is set to explicit. I feel like this behavious is good. This also allows you to wipe config files which what --nokeep was intending to solve. Other flags just have to have the op they belong to to be used for them to be valid. For example: pacman -Rn foo //works pacman -S -Rn //works pacman -Sn //doesn't work pacman -Sn -R //works We could posibly drop these flags belonging to each operation and just make them generic transaction flags. Implements FS#9694
Showing
- src/pacman/conf.c 9 additions, 1 deletionsrc/pacman/conf.c
- src/pacman/conf.h 21 additions, 8 deletionssrc/pacman/conf.h
- src/pacman/meson.build 1 addition, 0 deletionssrc/pacman/meson.build
- src/pacman/pacman.c 280 additions, 188 deletionssrc/pacman/pacman.c
- src/pacman/pacman.h 8 additions, 4 deletionssrc/pacman/pacman.h
- src/pacman/remove.c 3 additions, 96 deletionssrc/pacman/remove.c
- src/pacman/sync.c 3 additions, 400 deletionssrc/pacman/sync.c
- src/pacman/trans.c 478 additions, 0 deletionssrc/pacman/trans.c
- src/pacman/upgrade.c 2 additions, 24 deletionssrc/pacman/upgrade.c
- src/pacman/util.c 8 additions, 7 deletionssrc/pacman/util.c
- test/pacman/tests/remove049.py 2 additions, 2 deletionstest/pacman/tests/remove049.py
Loading
Please register or sign in to comment