diff options
author | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-07-02 12:11:26 +0200 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2022-07-07 20:47:10 +0200 |
commit | ed2133b7b5859bc1de86ed44d5cd93096cadc446 (patch) | |
tree | 5e9aaea4359e02e9aaefb39d8cca6a9785b71fe8 /scripts/sphinx-pre-install | |
parent | scripts: sphinx-pre-install: fix venv version check logic (diff) | |
download | linux-ed2133b7b5859bc1de86ed44d5cd93096cadc446.tar.xz linux-ed2133b7b5859bc1de86ed44d5cd93096cadc446.zip |
scripts: sphinx-pre-install: report broken venv
After distro upgrades, the directory names for python may change.
On such case, the previously-created venv will be broken, and
sphinx-build won't run.
Add a logic to report it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lore.kernel.org/r/f117f03555b0636d2be0b68f3a23b1d3f03ccf1d.1656756450.git.mchehab@kernel.org
[jc: fixed typo in warning message]
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/sphinx-pre-install')
-rwxr-xr-x | scripts/sphinx-pre-install | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index ae8c49734899..cfb82c548fb3 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install @@ -720,6 +720,12 @@ sub get_virtenv() next if (! -f $sphinx_cmd); my $ver = get_sphinx_version($sphinx_cmd); + + if (!$ver) { + $f =~ s#/bin/activate##; + print("Warning: virtual environment $f is not working.\nPython version upgrade? Remove it with:\n\n\trm -rf $f\n\n"); + } + if ($need_sphinx && ($ver ge $min_version)) { return ($f, $ver); } elsif ($ver gt $cur_version) { |