summaryrefslogtreecommitdiff
path: root/utils/svn-testament.pl
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2011-03-15 00:20:18 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2011-03-15 00:20:18 +0000
commitbdf75f07aac9d8d166f9733b71ebb2f0a8a538e1 (patch)
treec600748ac441c537643b29d2e2964ecfd684bf8f /utils/svn-testament.pl
parent40896dd3d94751af98cac4a0551486ca36108938 (diff)
downloadnetsurf-bdf75f07aac9d8d166f9733b71ebb2f0a8a538e1.tar.gz
netsurf-bdf75f07aac9d8d166f9733b71ebb2f0a8a538e1.tar.bz2
Try harder to get useful values if (a) getent is not available or (b) HOSTNAME env-var
does not exist. svn path=/trunk/netsurf/; revision=12055
Diffstat (limited to 'utils/svn-testament.pl')
-rwxr-xr-xutils/svn-testament.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/svn-testament.pl b/utils/svn-testament.pl
index e0f678b66..2412064dd 100755
--- a/utils/svn-testament.pl
+++ b/utils/svn-testament.pl
@@ -58,6 +58,13 @@ my %userinfo; # The information about the current user
$gecos =~ s/,.+//g;
$gecos =~ s/"/'/g;
$userinfo{GECOS} = $gecos;
+
+ if ( $pwdline eq "" ) { # Try whoami if we don't have getent
+ my $pwdline = `whoami`;
+ chomp $pwdline;
+ $userinfo{USERNAME} = $pwdline;
+ $userinfo{GECOS} = $pwdline;
+ }
}
# The current date, in AmigaOS version friendly format (dd.mm.yyyy)
@@ -77,6 +84,11 @@ $qroot =~ s/"/\\"/g;
my $hostname = $ENV{HOSTNAME};
+if ( $hostname eq "" ) { # Try hostname command if env-var empty
+ $hostname = `hostname`;
+ chomp $hostname;
+}
+
$hostname = "unknown-host" unless (defined($hostname) && $hostname ne "");
$hostname =~ s/"/\\"/g;