This function was already doing most of the work, so we can do this
extra there as well. simplifies the code a little. also fix a regression
in previous change where Pwd.cwd().replace() would rename the directory
(rather than doing a replace on the string value).
This option adds extra packages listed in the specified file to build.
For now, osc does not support automatic buildrequires.
When a package has automatic buildrequires, osc just
returns error code 9 that is returned by build,
but build leaves a list of missing dependencies in
".build.packages/OTHER/_generated_buildreqs" file inside build root.
These extra packages can be added using "--extra-pkgs" ("-x") option,
but this is very inconvenient if there are many of them.
Allowing to add extra dependencies listed in a file makes building
packages with automatic buildrequires much more convenient:
just do a first stage build, resulting in a file with list of
extra dependencies, and then add extra packages from this file
using "--extra-pkgs-from" ("-X") option that is added by this change.
Signed-off-by: Oleg Girko <ol@infoserver.lv>
dot (".") is already used as magic "current project/package" in
other commands like "ls" for example, but in the most useful ones
like copypac and rdelete it was missing. this adds a function that
does the dot expansion and adds it to the respective command expansions.
The original findpacs() was returning either [Package]
or ([Package], [str]) depending on the `fatal` option.
This confused pylint and it was returning false-positives:
E1101: Instance of 'list' has no '...' member (no-member)
A list of strings is expected, but a string was passed.
It was working only by coincidence, because iterating
through ["."] and "." gives the same result.
While for some developers/veteran Linux users this might be obvious,
many people will probably find it hard to know why osc vc is using
editor X instead of Y though.