summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-04-08 16:16:27 -0400
committerJoey Hess <joey@gnu.kitenet.net>2010-04-08 16:16:27 -0400
commit615c25dcab8e1af4525fe5bf4d10f0ad761741c4 (patch)
tree42a945030f5d8a9b7a71ba347e06ae5a1bbb3c94
parented156b8c366a56c8eacfa920c1e930e6af6d29a5 (diff)
Avoid using hostname -f, since on Solaris that sets the hostname to -f. Yay, Unix portability! (Instead, use dnsdomainname if available, and otherwise, fall back to the unqualified hostname.)
-rwxr-xr-xcommit.d/50vcs-commit6
-rw-r--r--debian/changelog3
2 files changed, 8 insertions, 1 deletions
diff --git a/commit.d/50vcs-commit b/commit.d/50vcs-commit
index c726167..da99d14 100755
--- a/commit.d/50vcs-commit
+++ b/commit.d/50vcs-commit
@@ -2,7 +2,11 @@
set -e
message="$1"
-hostname=`hostname -f 2>/dev/null || hostname`
+hostname=`hostname`
+dnsdomainname=`dnsdomainname 2>/dev/null || true`
+if [ -n "$dnsdomainname" ]; then
+ hostname="$hostname.$dnsdomainname"
+fi
USER=
if [ -n "$SUDO_USER" ]; then
diff --git a/debian/changelog b/debian/changelog
index 3d1cd9b..c3987a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,9 @@ etckeeper (0.44) UNRELEASED; urgency=low
* Use darcs record -m to specify commit message, instead of using a logfile.
* Closes: #519228
* Update depends for git-core to git transition.
+ * Avoid using hostname -f, since on Solaris that sets the hostname to -f.
+ Yay, Unix portability! (Instead, use dnsdomainname if available, and
+ otherwise, fall back to the unqualified hostname.)
-- Joey Hess <joeyh@debian.org> Sun, 21 Feb 2010 13:30:33 -0500