sphinx-pre-install (2834a7412bb1a74722231d7198518f9456279156) | sphinx-pre-install (412b09ddadd34e9be0d9a26e6de252361fafc237) |
---|---|
1#!/usr/bin/perl 2# SPDX-License-Identifier: GPL-2.0-or-later 3use strict; 4 5# Copyright (c) 2017-2020 Mauro Carvalho Chehab <mchehab@kernel.org> 6# 7 8my $prefix = "./"; --- 134 unchanged lines hidden (view full) --- 143 144sub findprog($) 145{ 146 foreach(split(/:/, $ENV{PATH})) { 147 return "$_/$_[0]" if(-x "$_/$_[0]"); 148 } 149} 150 | 1#!/usr/bin/perl 2# SPDX-License-Identifier: GPL-2.0-or-later 3use strict; 4 5# Copyright (c) 2017-2020 Mauro Carvalho Chehab <mchehab@kernel.org> 6# 7 8my $prefix = "./"; --- 134 unchanged lines hidden (view full) --- 143 144sub findprog($) 145{ 146 foreach(split(/:/, $ENV{PATH})) { 147 return "$_/$_[0]" if(-x "$_/$_[0]"); 148 } 149} 150 |
151sub find_python_no_venv() 152{ 153 my $prog = shift; 154 155 my $cur_dir = qx(pwd); 156 $cur_dir =~ s/\s+$//; 157 158 foreach my $dir (split(/:/, $ENV{PATH})) { 159 next if ($dir =~ m,($cur_dir)/sphinx,); 160 return "$dir/python3" if(-x "$dir/python3"); 161 } 162 foreach my $dir (split(/:/, $ENV{PATH})) { 163 next if ($dir =~ m,($cur_dir)/sphinx,); 164 return "$dir/python" if(-x "$dir/python"); 165 } 166 return "python"; 167} 168 |
|
151sub check_program($$) 152{ 153 my $prog = shift; 154 my $is_optional = shift; 155 156 return $prog if findprog($prog); 157 158 add_package($prog, $is_optional); --- 650 unchanged lines hidden (view full) --- 809 printf "\nYou may also use a newer Sphinx (version $ver) with:\n"; 810 printf "\tdeactivate && . $activate\n"; 811 } 812 } else { 813 my $rec_activate = "$virtenv_dir/bin/activate"; 814 815 print "To upgrade Sphinx, use:\n\n" if ($rec_sphinx_upgrade); 816 | 169sub check_program($$) 170{ 171 my $prog = shift; 172 my $is_optional = shift; 173 174 return $prog if findprog($prog); 175 176 add_package($prog, $is_optional); --- 650 unchanged lines hidden (view full) --- 827 printf "\nYou may also use a newer Sphinx (version $ver) with:\n"; 828 printf "\tdeactivate && . $activate\n"; 829 } 830 } else { 831 my $rec_activate = "$virtenv_dir/bin/activate"; 832 833 print "To upgrade Sphinx, use:\n\n" if ($rec_sphinx_upgrade); 834 |
835 $python_cmd = find_python_no_venv(); 836 |
|
817 if ($need_venv) { 818 printf "\t$python_cmd -m venv $virtenv_dir\n"; 819 } else { 820 printf "\t$virtualenv_cmd $virtenv_dir\n"; 821 } 822 printf "\t. $rec_activate\n"; 823 printf "\tpip install -r $requirement_file\n"; 824 deactivate_help(); --- 78 unchanged lines hidden --- | 837 if ($need_venv) { 838 printf "\t$python_cmd -m venv $virtenv_dir\n"; 839 } else { 840 printf "\t$virtualenv_cmd $virtenv_dir\n"; 841 } 842 printf "\t. $rec_activate\n"; 843 printf "\tpip install -r $requirement_file\n"; 844 deactivate_help(); --- 78 unchanged lines hidden --- |