Merge tag 'for-linus-hmm' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
[linux-2.6-block.git] / scripts / sphinx-pre-install
index a8f0c002a34058f99de455f045f61fa5a6b28b4b..fa3fb05cd54bea8f67f906f150fafcc508a2a769 100755 (executable)
@@ -701,11 +701,26 @@ sub check_needs()
                } else {
                        my $rec_activate = "$virtenv_dir/bin/activate";
                        my $virtualenv = findprog("virtualenv-3");
+                       my $rec_python3 = "";
                        $virtualenv = findprog("virtualenv-3.5") if (!$virtualenv);
                        $virtualenv = findprog("virtualenv") if (!$virtualenv);
                        $virtualenv = "virtualenv" if (!$virtualenv);
 
-                       printf "\t$virtualenv $virtenv_dir\n";
+                       my $rel = "";
+                       if (index($system_release, "Ubuntu") != -1) {
+                               $rel = $1 if ($system_release =~ /Ubuntu\s+(\d+)[.]/);
+                               if ($rel && $rel >= 16) {
+                                       $rec_python3 = " -p python3";
+                               }
+                       }
+                       if (index($system_release, "Debian") != -1) {
+                               $rel = $1 if ($system_release =~ /Debian\s+(\d+)/);
+                               if ($rel && $rel >= 7) {
+                                       $rec_python3 = " -p python3";
+                               }
+                       }
+
+                       printf "\t$virtualenv$rec_python3 $virtenv_dir\n";
                        printf "\t. $rec_activate\n";
                        printf "\tpip install -r $requirement_file\n";
                        deactivate_help();