[infiniband-diags] Fix usage of HOSTNAME

Doug Ledford dledford at fedoraproject.org
Sun Mar 10 21:12:48 UTC 2013


commit db878855a606336ef6e523f7628602acb03c26c0
Author: Doug Ledford <dledford at redhat.com>
Date:   Sun Mar 10 17:11:11 2013 -0400

    Fix usage of HOSTNAME
    
    The $HOSTNAME environment variable is a bashism.  Replace with
    proper reliance on the hostname command instead.
    
    Resolves: bz919901
    
    Signed-off-by: Doug Ledford <dledford at redhat.com>

 .gitignore                            |    1 +
 infiniband-diags-1.6.1-hostname.patch |   21 +++++++++++++++++++++
 infiniband-diags.spec                 |    7 ++++++-
 3 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index af6b4d4..19315e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ noarch/
 /infiniband-diags-1.5.12/
 /infiniband-diags-1.5.12.tar.gz
 /infiniband-diags-1.6.1.tar.gz
+/infiniband-diags-1.6.1/
diff --git a/infiniband-diags-1.6.1-hostname.patch b/infiniband-diags-1.6.1-hostname.patch
new file mode 100644
index 0000000..7706956
--- /dev/null
+++ b/infiniband-diags-1.6.1-hostname.patch
@@ -0,0 +1,21 @@
+diff -up infiniband-diags-1.6.1/scripts/set_nodedesc.sh.hostname infiniband-diags-1.6.1/scripts/set_nodedesc.sh
+--- infiniband-diags-1.6.1/scripts/set_nodedesc.sh.hostname	2013-03-10 16:56:07.646569871 -0400
++++ infiniband-diags-1.6.1/scripts/set_nodedesc.sh	2013-03-10 16:57:13.805967981 -0400
+@@ -5,7 +5,7 @@ if [ -f /etc/sysconfig/network ]; then
+ fi
+ 
+ ib_sysfs="/sys/class/infiniband"
+-newname="$HOSTNAME"
++newname=`hostname -s`
+ 
+ echo ""
+ echo "*** WARNING ***: this command is deprecated."
+@@ -18,7 +18,7 @@ function usage
+ 	echo "   -h this help"
+ 	echo "   -v view all node descriptors"
+ 	echo "   [<name>] set name to name specified."
+-	echo "      Default is to use the hostname: \"$HOSTNAME\""
++	echo "      Default is to use the hostname: \"$newname\""
+ 	exit 2
+ }
+ 
diff --git a/infiniband-diags.spec b/infiniband-diags.spec
index 599bbe9..d832ff1 100644
--- a/infiniband-diags.spec
+++ b/infiniband-diags.spec
@@ -1,13 +1,14 @@
 Summary: OpenFabrics Alliance InfiniBand Diagnostic Tools
 Name: infiniband-diags 
 Version: 1.6.1
-Release: 3%{?dist}
+Release: 4%{?dist}
 # Upstream allows either license to be used
 License: GPLv2 or BSD
 Group: System Environment/Libraries
 Url: http://openfabrics.org/
 Source0: http://www.openfabrics.org/downloads/management/%{name}-%{version}.tar.gz
 #Patch0: infiniband-diags-1.5.8-all_hcas.patch
+Patch1: infiniband-diags-1.6.1-hostname.patch
 
 BuildRequires: opensm-devel > 3.3.8, libibumad-devel, libibmad-devel, perl
 Provides: perl(IBswcountlimits)
@@ -40,6 +41,7 @@ Static libraries for the infiniband-diags library.
 %prep
 %setup -q
 #%patch0 -p1 -b .hcas
+%patch1 -p1 -b .hostname
 
 %build
 %configure --with-perl-installdir=%{_perldir}
@@ -72,6 +74,9 @@ rm -f $RPM_BUILD_ROOT%{_sbindir}/*.{pl,sh}
 %{_libdir}/*.a
 
 %changelog
+* Sun Mar 10 2013 Doug Ledford <dledford at redhat.com> - 1.6.1-4
+- Fix hostname usage in set_nodedesc.sh
+
 * Sat Mar  2 2013 Peter Robinson <pbrobinson at fedoraproject.org> 1.6.1-3
 - Build on ARM
 - Cleanup and modernise spec


More information about the scm-commits mailing list