Re: "stdin" interactivity plugin?

Nathan Stratton Treadway <[email protected]> Wed, 14 Mar 2018 02:19:10 -0400
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
On Thu, Apr 06, 2017 at 08:46:07 -0400, Jean-Louis Martineau wrote:
> For stdin, It's a long time ago. I think it can be removed.
> If I remember, stdin do not works with amdump because the taper stdin in 
> connection to the driver process, that's why I rewrote it using /dev/tty
> It should works with some program, amtape, amlabel, but there is no 
> advantage to using it instead of /dev/tty

I was looking in the source for "amtape" and happened to notice that it
contains the line
  $interactivity = Amanda::Interactivity->new(name => 'stdin');

It had only one other reference to Interactivity->new()... and that one
uses 'tty' instead.

Searching the full Amanda source tree for both "'stdin'" and
"name.*=>.*stdin", it looks like the only other use of the 'stdin'
Interactivty is within the POD at the top of Interactivity.pm.

So here's a quick patch to replace those two references with 'tty'.

								Nathan


----------------------------------------------------------------------------
Nathan Stratton Treadway  -  [email protected]  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239
amanda_remove_stdin_interactivity_references_20180314.patch (text/x-diff, 1003 B)
diff --git a/perl/Amanda/Interactivity.pm b/perl/Amanda/Interactivity.pm
index 3a94a90..17b21f6 100644
--- a/perl/Amanda/Interactivity.pm
+++ b/perl/Amanda/Interactivity.pm
@@ -28,7 +28,7 @@ Amanda::Interactivity -- Parent class for user interactivity modules
 
     use Amanda::Interactivity;
 
-    my $inter = Amanda::Interactivity->new(name => 'stdin');
+    my $inter = Amanda::Interactivity->new(name => 'tty');
     $inter->user_request(
 	message => "Insert Volume labelled 'MY_LABEL-001' in changer DLT",
 	label => 'MY_LABEL-001',
diff --git a/server-src/amtape.pl b/server-src/amtape.pl
index 3b8bee8..f59be33 100644
--- a/server-src/amtape.pl
+++ b/server-src/amtape.pl
@@ -495,7 +495,7 @@ sub {
 	    }
 	};
 
-	$interactivity = Amanda::Interactivity->new(name => 'stdin');
+	$interactivity = Amanda::Interactivity->new(name => 'tty');
 	($storage, $chg) = load_changer($finished_cb) or return;
 	$scan = Amanda::Recovery::Scan->new(chg => $chg,
 					    interactivity => $interactivity);