This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add the files from dist/meta to perl's repo
[metaconfig.git] / dist / U / cf_who.U
1 ?RCS: $Id: cf_who.U 1 2006-08-24 12:32:52Z rmanfredi $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, 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 4.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:change LC_ALL LANGUAGE
36 : who configured the system
37 ?X: Ensure English date -- Jarkko Hietaniemi
38 cf_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:
50 ?X: Parens needed to avoid error message if the program does not exist.
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.
54 cf_by=`(logname) 2>/dev/null`
55 case "$cf_by" in
56 "")
57         cf_by=`(whoami) 2>/dev/null`
58         case "$cf_by" in
59         "") cf_by=unknown ;;
60         esac ;;
61 esac
62