This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
1d1d3bdbd24043a2900d4809f740a4a458998b0c
[metaconfig.git] / U / modified / cf_who.U
1 ?RCS: $Id: cf_who.U,v 3.0.1.2 1997/02/28 15:28:50 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
4 ?RCS: 
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
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
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
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:.
35 ?LINT:extern LC_ALL
36 ?LINT:change LC_ALL
37 ?LINT:extern LANGUAGE
38 ?LINT:change LANGUAGE
39 : who configured the system
40 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
41 ?X:
42 ?X: Leave a white space between first two '(' for ksh. The sub-shell is needed
43 ?X: on some machines to avoid the error message when logname is not found; e.g.
44 ?X: on SUN-OS 3.2, (logname || whoami) would not execute whoami if logname was
45 ?X: not found. Sigh!
46 ?X:
47 ?X: Convex had a broken logname executable which returned a non-zero status,
48 ?X: and that broke the previous:
49 ?X:   cf_by=`( (logname) 2>/dev/null || whoami) 2>&1`
50 ?X: Switch to emergency mode... -- RAM, 19/04/94
51 ?X:
52 ?X: Parens needed to avoid error message if the program does not exist.
53 ?X: Uses case instead of $test so it can be put before $test is defined.
54 ?X: Don't redirect to a file because on Ultrix (under script?) logname
55 ?X: outputs a blank line first.  This method will apparently work.
56 cf_by=`(logname) 2>/dev/null`
57 case "$cf_by" in
58 "")
59         cf_by=`(whoami) 2>/dev/null`
60         case "$cf_by" in
61         "") cf_by=unknown ;;
62         esac ;;
63 esac
64