View Issue Details

IDProjectCategoryView StatusLast Update
0001034SOGoBackend Generalpublic2011-06-16 15:46
Reporterbuzzdee Assigned Toludovic  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.3.4 
Target Version1.3.8Fixed in Version1.3.8 
Summary0001034: -f parameter to hostname may not be known on some OS
Description

At least on OpenBSD and NetBSD, the hostname(1) command doens't know about the -f parameter. hostname defaults to output the full hostname without any parameter.
This command is used only once to find the hostname of the box building sogo, and is used in the about dialog.

Attached patch checks in configure whether hostname -f works, and sets the varible HOSTNAME to the fqdn, either with hostname -f or just using hostname.

In SoObjects/SOGo/GNUmakefile.preamble, make the HOSTNAME ?= conditional, in case someone doesn't run configure, it will call the existing statement (which still will fail on OpenBSD or NetBSD...)

TagsNo tags attached.

Activities

2010-12-03 08:51

 

patch-fix-hostname-parameter.diff (1,151 bytes)   
$OpenBSD$
--- configure.orig	Tue Nov 30 11:33:51 2010
+++ configure	Tue Nov 30 11:37:07 2010
@@ -37,6 +37,15 @@ else
   MAKE=gmake
 fi
 
+# hostname(1) on some systems may not know the -f parameter
+hostname -f 2>/dev/null >/dev/null
+if [ $? -eq 0 ];then
+  HOSTNAME=`hostname -f`
+else
+  HOSTNAME=`hostname`
+fi
+
+
 NGSTREAMS_DIR="./sope-core/NGStreams"
 LINK_SYSLIBDIRS="-L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/lib"
 
@@ -251,6 +260,7 @@ genConfigMake() {
     cfgwrite "CGS_LIBDIR_NAME:=lib"
   fi
 
+  cfgwrite "HOSTNAME=${HOSTNAME}"
   cfgwrite "SOGO_SYSLIBDIR=\${GNUSTEP_LIBRARIES}"
   cfgwrite "SOGO_LIBDIR=\${GNUSTEP_LIBRARY}/SOGo"
   cfgwrite "SOGO_TEMPLATESDIR=\${SOGO_LIBDIR}/Templates"
--- SoObjects/SOGo/GNUmakefile.preamble.orig	Wed Nov 17 17:30:03 2010
+++ SoObjects/SOGo/GNUmakefile.preamble	Fri Dec  3 09:42:53 2010
@@ -2,7 +2,7 @@
 
 SOGo_INCLUDE_DIRS += -I.. -I../../UI -DSOGO_MAJOR_VERSION="\"$(MAJOR_VERSION)\"" -DSOGO_MINOR_VERSION="\"$(MINOR_VERSION)\""
 
-HOSTNAME = $(shell hostname -f)
+HOSTNAME ?= $(shell hostname -f)
 BUILD_DATE = $(shell echo $$USER@$(HOSTNAME); date +"%Y%m%d%H%M")
 
 ADDITIONAL_CPPFLAGS += \
buzzdee

buzzdee

2011-04-13 11:38

reporter   ~0002377

could this be reviewed and commented, or even included if its fine? Shortly after a release is a good time to add new stuff, since the plenty of time for testing till the next release ;)

ludovic

ludovic

2011-06-16 15:46

administrator   ~0002593

Patch pushed: http://mtn.inverse.ca/revision/diff/698461b7043455867e02dfbd291566ea991bf8a5/with/745ebe569ac5b050683e557f5e5fb7c1699ca7f5

Issue History

Date Modified Username Field Change
2010-12-03 08:51 buzzdee New Issue
2010-12-03 08:51 buzzdee File Added: patch-fix-hostname-parameter.diff
2011-02-15 22:02 ludovic Status new => assigned
2011-02-15 22:02 ludovic Assigned To => ludovic
2011-04-13 11:38 buzzdee Note Added: 0002377
2011-06-15 20:56 ludovic Target Version => 1.3.8
2011-06-16 15:46 ludovic Note Added: 0002593
2011-06-16 15:46 ludovic Status assigned => resolved
2011-06-16 15:46 ludovic Fixed in Version => 1.3.8
2011-06-16 15:46 ludovic Resolution open => fixed