mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
scripts: sphinx-pre-install: fix venv version check logic
The logic which checks if the venv version is good enough but was not activated is broken: it is checking against the wrong val, making it to recommend to re-create a venv every time. Fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> Link: https://lore.kernel.org/r/afe01b7863fd655986d84ace8948f3d7aede796d.1656756450.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
4d627ef12b
commit
7c2d45a347
1 changed files with 7 additions and 3 deletions
|
|
@ -741,7 +741,7 @@ sub recommend_sphinx_upgrade()
|
||||||
|
|
||||||
# Get the highest version from sphinx_*/bin/sphinx-build and the
|
# Get the highest version from sphinx_*/bin/sphinx-build and the
|
||||||
# corresponding command to activate the venv/virtenv
|
# corresponding command to activate the venv/virtenv
|
||||||
$activate_cmd = get_virtenv();
|
($activate_cmd, $venv_ver) = get_virtenv();
|
||||||
|
|
||||||
# Store the highest version from Sphinx existing virtualenvs
|
# Store the highest version from Sphinx existing virtualenvs
|
||||||
if (($activate_cmd ne "") && ($venv_ver gt $cur_version)) {
|
if (($activate_cmd ne "") && ($venv_ver gt $cur_version)) {
|
||||||
|
|
@ -759,10 +759,14 @@ sub recommend_sphinx_upgrade()
|
||||||
# Either there are already a virtual env or a new one should be created
|
# Either there are already a virtual env or a new one should be created
|
||||||
$need_pip = 1;
|
$need_pip = 1;
|
||||||
|
|
||||||
|
return if (!$latest_avail_ver);
|
||||||
|
|
||||||
# Return if the reason is due to an upgrade or not
|
# Return if the reason is due to an upgrade or not
|
||||||
if ($latest_avail_ver lt $rec_version) {
|
if ($latest_avail_ver lt $rec_version) {
|
||||||
$rec_sphinx_upgrade = 1;
|
$rec_sphinx_upgrade = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $latest_avail_ver;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
@ -820,7 +824,7 @@ sub recommend_sphinx_version($)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Suggest newer versions if current ones are too old
|
# Suggest newer versions if current ones are too old
|
||||||
if ($latest_avail_ver && $cur_version ge $min_version) {
|
if ($latest_avail_ver && $latest_avail_ver ge $min_version) {
|
||||||
# If there's a good enough version, ask the user to enable it
|
# If there's a good enough version, ask the user to enable it
|
||||||
if ($latest_avail_ver ge $rec_version) {
|
if ($latest_avail_ver ge $rec_version) {
|
||||||
printf "\nNeed to activate Sphinx (version $latest_avail_ver) on virtualenv with:\n";
|
printf "\nNeed to activate Sphinx (version $latest_avail_ver) on virtualenv with:\n";
|
||||||
|
|
@ -897,7 +901,7 @@ sub check_needs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
recommend_sphinx_upgrade();
|
my $venv_ver = recommend_sphinx_upgrade();
|
||||||
|
|
||||||
my $virtualenv_cmd;
|
my $virtualenv_cmd;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue