__package_pip: split extra 'all' to a list of all extras

This will fix if a package will be upgraded from some extras to all
extras. Previously, it will not work because some dependencies of 'all'
are already installed, so the feature 'all' is already installed.

Now, it will use a list of all extras to iterate over them separatly. This
will result it will never install all extras via `[all]`, but rather
This commit is contained in:
matze 2021-02-12 09:17:02 +01:00
parent 7398382890
commit a9d7dfb2ed
1 changed files with 8 additions and 1 deletions

View File

@ -34,7 +34,14 @@ then
pip3 freeze > "$pip_freeze"
for extra in $(tr ',' '\n' < "$__object/parameter/extra")
# If all is set, it searches all available extras to separatly check them.
# It would work with just 'all' (cause dependencies are given), but will
# not update if one extra is already present. Side effect is that it will
# not use [all] but instead name all extras seperatly.
for extra in $(if grep -qFx all "$__object/parameter/extra";
then awk -F': ' '$1 == "Provides-Extra" && $2 != "all"{print $2}' "$distinfo_dir/METADATA";
else tr ',' '\n' < "$__object/parameter/extra";
# create a grep BRE pattern to search all packages