Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installperl stderr/stdout problem #2246

Closed
p5pRT opened this issue Jul 21, 2000 · 5 comments
Closed

installperl stderr/stdout problem #2246

p5pRT opened this issue Jul 21, 2000 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 21, 2000

Migrated from rt.perl.org#3562 (status was 'resolved')

Searchable as RT3562$

@p5pRT
Copy link
Author

p5pRT commented Jul 21, 2000

From eschrich@hcp.med.harvard.edu

Created by eschrich@hcp.med.harvard.edu

When installing perl 5.6.0 using 'make install', we attempted to log the
results to a file using 'make install | tee make.out'.

Line 311 of installperl checks if STDERR is a tty (and STDIN) in case of
non-interactive mode, however tee redirects only STDOUT. STDOUT is
buffered so the question from yn() on line 330 is never displayed
and the install process appears to hang (waiting for y/n from STDIN).

Should the script check -t STDOUT instead of STDERR?

Perl Info

Flags:
    category=install
    severity=low

Site configuration information for perl v5.6.0:

Configured by hutchiso at Fri Jul 21 09:00:45 EDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos elixir 5.6 generic_105181-17 sun4u sparc sunw,ultra-4 '
    config_args='-de'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib -L/usr/apps/SUNWspro/SC4.2/lib '
    libpth=/usr/local/lib /usr/apps/SUNWspro/SC4.2/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt -lsec
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-KPIC', lddlflags='-G -L/usr/local/lib -L/usr/apps/SUNWspro/SC4.2/lib'

Locally applied patches:
    


@INC for perl v5.6.0:
    /usr/local/lib/perl5/5.6.0/sun4-solaris
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .


Environment for perl v5.6.0:
    HOME=/home/eschrich
    LANG (unset)
    LANGUAGE (unset)
    LC_COLLATE=en_AU
    LC_CTYPE=en_AU
    LC_MESSAGES=C
    LC_MONETARY=en_AU
    LC_NUMERIC=en_AU
    LC_TIME=en_AU
    LD_LIBRARY_PATH=/usr/lib:/usr/openwin/lib:/usr/local/lib:/usr/ccs/lib:/usr/ucb/lib:/lib:/usr/dt/lib
    LOGDIR (unset)
    PATH=/usr/bin:.:/bin:/usr/bin:/usr/sbin:/usr/openwin/bin:/usr/local/bin:/usr/lib:/usr/ucb:/usr/ccs/bin:/usr/bin/X11:/usr/local/sbin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


@p5pRT
Copy link
Author

p5pRT commented Jul 22, 2000

From [Unknown Contact. See original ticket]

Steven Eschrich <eschrich@​hcp.med.harvard.edu> wrote

Line 311 of installperl checks if STDERR is a tty (and STDIN) in case of
non-interactive mode, however tee redirects only STDOUT. STDOUT is
buffered so the question from yn() on line 330 is never displayed
and the install process appears to hang (waiting for y/n from STDIN).

Should the script check -t STDOUT instead of STDERR?

It should cretainly be consistent, and write the prompt to the same handle
as it tests.

I personally prefer changing it to send the prompt to STDERR.

Patch for perl-current attached, which also fixes a -w uncleanness.

Mike Guy

Inline Patch
--- ./installperl.orig	Sat Jul 22 13:55:36 2000
+++ ./installperl	Sat Jul 22 13:56:39 2000
@@ -307,7 +307,7 @@
 
 my $mainperl_is_instperl = 0;
 
-if ($Config{installusrbinperl} eq 'define' &&
+if ($Config{installusrbinperl} && $Config{installusrbinperl} eq 'define' &&
     !$versiononly && !$nonono && !$Is_W32 && !$Is_VMS && -t STDIN && -t STDERR
 	&& -w $mainperldir && ! samepath($mainperldir, $installbin)) {
     my($usrbinperl)	= "$mainperldir/$perl$exe_ext";
@@ -465,7 +465,7 @@
     my($prompt) = @_;
     my($answer);
     my($default) = $prompt =~ m/\[([yn])\]\s*$/i;
-    print $prompt;
+    print STDERR $prompt;
     chop($answer = <STDIN>);
     $answer = $default if $answer =~ m/^\s*$/;
     ($answer =~ m/^[yY]/);

End of patch

@p5pRT
Copy link
Author

p5pRT commented Jul 22, 2000

From [Unknown Contact. See original ticket]

When installing perl 5.6.0 using 'make install', we attempted to log the
results to a file using 'make install | tee make.out'.

Doing it that way tends to lose information.
I always use 'make install |& tee make.out'.

@p5pRT
Copy link
Author

p5pRT commented Jul 23, 2000

From @jhi

I personally prefer changing it to send the prompt to STDERR.

Patch for perl-current attached, which also fixes a -w uncleanness.

Thanks!

@p5pRT
Copy link
Author

p5pRT commented May 5, 2003

@iabyn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant