__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
`[foo,bar]`.
This commit is contained in:
matze 2021-02-12 09:17:02 +01:00
parent 7398382890
commit a9d7dfb2ed

View file

@ -34,7 +34,14 @@ then
pip_freeze="$__object/files/pip-freeze.tmp"
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";
fi)
do
# create a grep BRE pattern to search all packages
grep_pattern="$(