Re: "stdin" interactivity plugin?
Nathan Stratton Treadway <[email protected]> Fri, 24 May 2019 14:02:29 -0400
| Newsgroups | gmane.comp.archivers.amanda.devel |
|---|---|
| Message-ID | <[email protected]> |
Chris, here's another simple patch that never made it into the upstream repo last year (the tail end of a discussion with Jean-Louis dating back to 2017). I assume it would be appropriate for the 3_5 branch, but at least if you could get it into the master branch you'd be a step closer to being able to completely get rid of the "stdin" Interactivity someday. Nathan On Wed, Mar 14, 2018 at 02:19:10 -0400, Nathan Stratton Treadway wrote: > 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 > 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); ---------------------------------------------------------------------------- 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