This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Atari FreeMiNT: MiNT does not have .exe for _exe
[metaconfig.git] / U / modified / cf_who.U
CommitLineData
9b04e79a 1?RCS: $Id: cf_who.U 1 2006-08-24 12:32:52Z rmanfredi $
959f3c4c 2?RCS:
9b04e79a 3?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
65a32477
MBT
4?RCS:
5?RCS: You may redistribute only under the terms of the Artistic License,
959f3c4c
JH
6?RCS: as specified in the README file that comes with the distribution.
7?RCS: You may reuse parts of this distribution only within the terms of
65a32477 8?RCS: that same Artistic License; a copy of which may be found at the root
9b04e79a 9?RCS: of the source tree for dist 4.0.
959f3c4c
JH
10?RCS:
11?RCS: $Log: cf_who.U,v $
12?RCS: Revision 3.0.1.2 1997/02/28 15:28:50 ram
13?RCS: patch61: new computation method avoiding use of temporary file
14?RCS:
15?RCS: Revision 3.0.1.1 1994/05/06 14:42:34 ram
16?RCS: patch23: login name now computed the hard way
17?RCS:
18?RCS: Revision 3.0 1993/08/18 12:05:32 ram
19?RCS: Baseline for dist 3.0 netwide release.
20?RCS:
21?X:
22?X: Oldconfig dependency is there to ensure computation occurs after old values
23?X: from config.sh have been loaded, so that we can supersede them.
24?X:
25?MAKE:cf_time cf_by: date Oldconfig
26?MAKE: -pick add $@ %<
27?S:cf_time:
28?S: Holds the output of the "date" command when the configuration file was
29?S: produced. This is used to tag both config.sh and config_h.SH.
30?S:.
31?S:cf_by:
32?S: Login name of the person who ran the Configure script and answered the
33?S: questions. This is used to tag both config.sh and config_h.SH.
34?S:.
9b04e79a 35?LINT:change LC_ALL LANGUAGE
959f3c4c 36: who configured the system
9b04e79a 37?X: Ensure English date -- Jarkko Hietaniemi
959f3c4c
JH
38cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
39?X:
40?X: Leave a white space between first two '(' for ksh. The sub-shell is needed
41?X: on some machines to avoid the error message when logname is not found; e.g.
42?X: on SUN-OS 3.2, (logname || whoami) would not execute whoami if logname was
43?X: not found. Sigh!
44?X:
45?X: Convex had a broken logname executable which returned a non-zero status,
46?X: and that broke the previous:
47?X: cf_by=`( (logname) 2>/dev/null || whoami) 2>&1`
48?X: Switch to emergency mode... -- RAM, 19/04/94
49?X:
65a32477 50?X: Parentheses needed to avoid error message if the program does not exist.
959f3c4c
JH
51?X: Uses case instead of $test so it can be put before $test is defined.
52?X: Don't redirect to a file because on Ultrix (under script?) logname
53?X: outputs a blank line first. This method will apparently work.
959f3c4c
JH
54case "$cf_by" in
55"")
dbf7ebf9 56 cf_by=`(logname) 2>/dev/null`
959f3c4c 57 case "$cf_by" in
dbf7ebf9
GA
58 "")
59 cf_by=`(whoami) 2>/dev/null`
60 case "$cf_by" in
61 "") cf_by=unknown ;;
62 esac ;;
959f3c4c
JH
63 esac ;;
64esac
65