linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] scripts: sphinx-pre-install: Add --interactive flag
@ 2025-06-25 16:22 Sai Vishnu M
  2025-06-25 16:22 ` [PATCH 2/4] scripts: sphinx-pre-install: add a helper subroutine Sai Vishnu M
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sai Vishnu M @ 2025-06-25 16:22 UTC (permalink / raw)
  To: corbet, mchehab; +Cc: linux-doc, linux-kernel, shuah, Sai Vishnu M

From: Sai Vishnu M <saivishnu725@gmail.com>

Introduce the --interactive flag to enable prompting for package
installation commands. Add $interactive variable and update the usage
message to include the new flag. Check for terminal input (-t STDIN) to
skip interactive feature in a non-interactive session.

Signed-off-by: Sai Vishnu M <saivishnu725@gmail.com>
---
The RFC proposes 4 patches that will integrate the interactive feature
into the sphinx-pre-install script.
Link: https://lore.kernel.org/linux-doc/CAFttn56VFPjikxjhgds6LjphinStm_cN+7ZhAzsieT0gnBqBDQ@mail.gmail.com/

 scripts/sphinx-pre-install | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
index ad9945ccb0cf..6e6e5bda6186 100755
--- a/scripts/sphinx-pre-install
+++ b/scripts/sphinx-pre-install
@@ -42,6 +42,7 @@ my $latest_avail_ver;
 my $pdf = 1;
 my $virtualenv = 1;
 my $version_check = 0;
+my $interactive = 0;
 
 #
 # List of required texlive packages on Fedora and OpenSuse
@@ -1002,12 +1003,18 @@ while (@ARGV) {
 		$pdf = 0;
 	} elsif ($arg eq "--version-check"){
 		$version_check = 1;
+	} elsif ($arg eq "--interactive") {
+		# check if the user can interact with the script
+		if (-t STDIN) {
+			$interactive = 1;
+		}
 	} else {
-		print "Usage:\n\t$0 <--no-virtualenv> <--no-pdf> <--version-check>\n\n";
+		print "Usage:\n\t$0 <--no-virtualenv> <--no-pdf> <--version-check> <--interactive>\n\n";
 		print "Where:\n";
 		print "\t--no-virtualenv\t- Recommend installing Sphinx instead of using a virtualenv\n";
 		print "\t--version-check\t- if version is compatible, don't check for missing dependencies\n";
-		print "\t--no-pdf\t- don't check for dependencies required to build PDF docs\n\n";
+		print "\t--no-pdf\t- don't check for dependencies required to build PDF docs\n";
+		print "\t--interactive\t- ask to install missing dependencies\n\n";
 		exit -1;
 	}
 }
-- 
2.49.0


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

end of thread, other threads:[~2025-06-25 20:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 16:22 [PATCH 1/4] scripts: sphinx-pre-install: Add --interactive flag Sai Vishnu M
2025-06-25 16:22 ` [PATCH 2/4] scripts: sphinx-pre-install: add a helper subroutine Sai Vishnu M
2025-06-25 16:22 ` [PATCH 3/4] scripts: sphinx-pre-install: add fallback to distro detection Sai Vishnu M
2025-06-25 16:22 ` [PATCH 4/4] scripts: sphinx-pre-install: Integrate interactive mode Sai Vishnu M
2025-06-25 20:32 ` [PATCH 1/4] scripts: sphinx-pre-install: Add --interactive flag 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;
as well as URLs for NNTP newsgroup(s).