public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/sphinx-pre-install: add how to exit virtualenv usage message
@ 2019-09-17 22:48 Shuah Khan
  2019-09-18  9:29 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2019-09-17 22:48 UTC (permalink / raw)
  To: mchehab+samsung, corbet, rppt, rfontana, kstewart, bhelgaas, tglx
  Cc: Shuah Khan, linux-kernel

Add usage message on how to exit the virtualenv after documentation
work is done.

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
 scripts/sphinx-pre-install | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
index 3b638c0e1a4f..932547791e3c 100755
--- a/scripts/sphinx-pre-install
+++ b/scripts/sphinx-pre-install
@@ -645,6 +645,12 @@ sub check_distros()
 # Common dependencies
 #
 
+sub deactivate_help()
+{
+	printf "\tWhen work is done exit the virtualenv:\n";
+	printf "\tdeactivate\n";
+}
+
 sub check_needs()
 {
 	# Check for needed programs/tools
@@ -686,6 +692,7 @@ sub check_needs()
 		if ($need_sphinx && scalar @activates > 0 && $activates[0] ge $min_activate) {
 			printf "\nNeed to activate a compatible Sphinx version on virtualenv with:\n";
 			printf "\t. $activates[0]\n";
+			deactivate_help();
 			exit (1);
 		} else {
 			my $rec_activate = "$virtenv_dir/bin/activate";
@@ -697,6 +704,7 @@ sub check_needs()
 			printf "\t$virtualenv $virtenv_dir\n";
 			printf "\t. $rec_activate\n";
 			printf "\tpip install -r $requirement_file\n";
+			deactivate_help();
 
 			$need++ if (!$rec_sphinx_upgrade);
 		}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/sphinx-pre-install: add how to exit virtualenv usage message
  2019-09-17 22:48 [PATCH] scripts/sphinx-pre-install: add how to exit virtualenv usage message Shuah Khan
@ 2019-09-18  9:29 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2019-09-18  9:29 UTC (permalink / raw)
  To: Shuah Khan; +Cc: corbet, rppt, rfontana, kstewart, bhelgaas, tglx, linux-kernel

Hi Shuah,

Em Tue, 17 Sep 2019 16:48:05 -0600
Shuah Khan <skhan@linuxfoundation.org> escreveu:

> Add usage message on how to exit the virtualenv after documentation
> work is done.

Good idea.

> 
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> ---
>  scripts/sphinx-pre-install | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
> index 3b638c0e1a4f..932547791e3c 100755
> --- a/scripts/sphinx-pre-install
> +++ b/scripts/sphinx-pre-install
> @@ -645,6 +645,12 @@ sub check_distros()
>  # Common dependencies
>  #
>  
> +sub deactivate_help()
> +{
> +	printf "\tWhen work is done exit the virtualenv:\n";
> +	printf "\tdeactivate\n";

I would change the message to something like:

	If you want to exit the virtualenv, you can use:

		deactivate

Btw, at least here, I recently noticed a conflict between the
virtenv and scripts/spdxcheck.py. Running deactivate solves it.

Regards,
Mauro



> +}
> +
>  sub check_needs()
>  {
>  	# Check for needed programs/tools
> @@ -686,6 +692,7 @@ sub check_needs()
>  		if ($need_sphinx && scalar @activates > 0 && $activates[0] ge $min_activate) {
>  			printf "\nNeed to activate a compatible Sphinx version on virtualenv with:\n";
>  			printf "\t. $activates[0]\n";
> +			deactivate_help();
>  			exit (1);
>  		} else {
>  			my $rec_activate = "$virtenv_dir/bin/activate";
> @@ -697,6 +704,7 @@ sub check_needs()
>  			printf "\t$virtualenv $virtenv_dir\n";
>  			printf "\t. $rec_activate\n";
>  			printf "\tpip install -r $requirement_file\n";
> +			deactivate_help();
>  
>  			$need++ if (!$rec_sphinx_upgrade);
>  		}



Thanks,
Mauro

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-18  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-17 22:48 [PATCH] scripts/sphinx-pre-install: add how to exit virtualenv usage message Shuah Khan
2019-09-18  9:29 ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox