From 514b94b1f4471c41a68fd3ad2a6226840e4e2aef Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 13 Mar 2011 12:17:18 +0000 Subject: Add hostname and path svn path=/trunk/netsurf/; revision=12023 --- content/fetchers/about.c | 8 ++++++++ utils/svn-testament.pl | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/content/fetchers/about.c b/content/fetchers/about.c index b343d2a61..0e703f370 100644 --- a/content/fetchers/about.c +++ b/content/fetchers/about.c @@ -332,6 +332,14 @@ static bool fetch_about_testament_handler(struct fetch_about_context *ctx) FETCH_ERROR_NO_ERROR)) goto fetch_about_testament_handler_aborted; + slen = snprintf(buffer, sizeof buffer, + "Built on %s in %s\n\n", + WT_HOSTNAME, WT_ROOT); + + if (fetch_about_send_callback(FETCH_DATA, ctx, buffer, slen, + FETCH_ERROR_NO_ERROR)) + goto fetch_about_testament_handler_aborted; + if (WT_MODIFIED > 0) { slen = snprintf(buffer, sizeof buffer, "Working tree has %d modification%s\n\n", diff --git a/utils/svn-testament.pl b/utils/svn-testament.pl index f159f00d4..30240e927 100755 --- a/utils/svn-testament.pl +++ b/utils/svn-testament.pl @@ -67,6 +67,17 @@ my $testament = ""; $testament .= "#define USERNAME \"$userinfo{USERNAME}\"\n"; $testament .= "#define GECOS \"$userinfo{GECOS}\"\n"; +my $qroot = $root; +$qroot =~ s/"/\\"/g; + +my $hostname = $ENV{HOSTNAME}; + +$hostname = "unknown-host" unless (defined($hostname) && $hostname ne ""); +$hostname =~ s/"/\\"/g; + +$testament .= "#define WT_ROOT \"$qroot\"\n"; +$testament .= "#define WT_HOSTNAME \"$hostname\"\n"; + my $url = $svninfo{url}; # This only works on 1.3.x and above $url = substr($url, length($svninfo{repositoryroot})); -- cgit v1.2.3