From: Peter Prymmer Date: Tue, 3 Oct 2000 12:05:59 +0000 (-0700) Subject: It is possible to have no hosts database at all. Pointed out in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f08cbdd1c4c30753f0b3b06d9c4ae199518e065a;p=p5sagit%2Fp5-mst-13.2.git It is possible to have no hosts database at all. Pointed out in Subject: [PATCH: 7131] PWPASSWD problem for passwd less pwd's Message-ID: p4raw-id: //depot/perl@7139 --- diff --git a/Configure b/Configure index ae6712f..dadb98a 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Tue Oct 3 05:18:15 EET DST 2000 [metaconfig 3.0 PL70] +# Generated on Wed Oct 4 01:09:27 EET DST 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >/tmp/c1$$ < hosts } tmp_re="[ . ]" - $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } + if $test -f hosts; then + $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ } END { print sum }" hosts` = x1 || tmp_re="[ ]" - dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ - hosts | $sort | $uniq | \ - $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` - case `$echo X$dflt` in - X*\ *) echo "(Several hosts in /etc/hosts matched hostname)" + dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \ + hosts | $sort | $uniq | \ + $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"` + case `$echo X$dflt` in + X*\ *) echo "(Several hosts in the database matched hostname)" + dflt=. + ;; + X.) echo "(You do not have fully-qualified names in the hosts database)" + ;; + esac + else + echo "(I cannot locate a hosts database anywhere)" dflt=. - ;; - X.) echo "(You do not have fully-qualified names in /etc/hosts)" - ;; - esac + fi case "$dflt" in .) tans=`./loc resolv.conf X /etc /usr/etc`