[Koha-patches] [PATCH] added TRUST_ENV that tells to _get_value to *not* ask for a value if allready
Galen Charlton
galen.charlton at liblime.com
Mon May 12 18:59:02 CEST 2008
Hi,
Also, the canonical way to force EU::MM to not prompt is to set the
PERL_MM_USE_DEFAULT environment variable to a true value -- see the
EU::MM documentation.
Regards,
Galen
On Mon, May 12, 2008 at 10:18 AM, <jmf at arwen.metavore.com> wrote:
> Hi Marc,
>
> Are you sure this patch is required? The underlying MM::EU prompt()
> should auto-detect when Makefile.PL is being run interactively or not
> and will plug in the supplied default.
>
> Also, not sure the goto as implemented isn't particularly perlish ;-)
>
> Cheers,
>
> Josh
>
>
>
>
> On Fri, May 02, 2008 at 11:11:51PM +0200, Marc Chantreux wrote:
> > (this permit, for exemple, a wrapper to the install script using dialog).
> > ---
> > Makefile.PL | 13 ++++++++++---
> > 1 files changed, 10 insertions(+), 3 deletions(-)
> >
> > diff --git a/Makefile.PL b/Makefile.PL
> > index bae8dbc..8d4e9fa 100644
> > --- a/Makefile.PL
> > +++ b/Makefile.PL
> > @@ -1143,13 +1143,20 @@ sub _get_value {
> > return $install_log_values{$key};
> > }
> >
> > + my $val;
> > # override default value from environment
> > if (exists $ENV{$key}) {
> > - $default = $ENV{$key};
> > - $msg .= " (default from environment)";
> > + if (exists $ENV{TRUST_ENV}) {
> > + $val = $ENV{$key};
> > + goto VARSET
> > + } else {
> > + $default = $ENV{$key};
> > + $msg .= " (default from environment)";
> > + }
> > }
> > + $val = prompt($msg, $default);
> >
> > - my $val = prompt($msg, $default);
> > + VARSET:
> >
> > while (exists $valid_values->{$key} and
> > $val ne $default and
> > --
> > 1.5.5
> >
> _______________________________________________
> Koha-patches mailing list
> Koha-patches at lists.koha.org
> http://lists.koha.org/mailman/listinfo/koha-patches
>
--
Galen Charlton
Koha Application Developer
LibLime
galen.charlton at liblime.com
p: 1-888-564-2457 x709
More information about the Koha-patches
mailing list