diff --git a/net-tools-1.60-hostname-s.patch b/net-tools-1.60-hostname-s.patch new file mode 100644 index 0000000..406e3b8 --- /dev/null +++ b/net-tools-1.60-hostname-s.patch @@ -0,0 +1,30 @@ +Index: net-tools-1.60/hostname.c +=================================================================== +--- net-tools-1.60.orig/hostname.c ++++ net-tools-1.60/hostname.c +@@ -300,11 +300,6 @@ static void showhname(char *hname, int c + case 'f': + printf("%s\n", res->ai_canonname); + break; +- case 's': +- if (p != NULL) +- *p = '\0'; +- printf("%s\n", res->ai_canonname); +- break; + default: + break; + } +@@ -494,7 +489,12 @@ int main(int argc, char **argv) + fprintf(stderr, _("gethostname()=`%s'\n"), myname); + if (!type) + printf("%s\n", myname); +- else ++ else if (type == 's') { ++ char *p = strchr(myname, '.'); ++ if (p) ++ *p = '\0'; ++ printf("%s\n", myname); ++ } else + showhname(myname, type); + break; + case 3: diff --git a/net-tools.changes b/net-tools.changes index cceb559..5825144 100644 --- a/net-tools.changes +++ b/net-tools.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue May 17 11:36:17 UTC 2016 - pwieczorkiewicz@suse.com + +- Add net-tools-1.60-hostname-s.patch: + This changes the hostname behavior to match other systems and its + own documentation. Namely, that -s just parses the result of the + active gethostname() and does not attempt any network/DNS traffic. + upstream: https://sourceforge.net/p/net-tools/bugs/14/ + commit#452f8e (boo#872264). + ------------------------------------------------------------------- Wed Jun 10 12:57:09 UTC 2015 - gber@opensuse.org diff --git a/net-tools.spec b/net-tools.spec index e9d4aaf..b5cba12 100644 --- a/net-tools.spec +++ b/net-tools.spec @@ -1,7 +1,7 @@ # # spec file for package net-tools # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -83,6 +83,8 @@ Patch49: net-tools-1.60-cs_CZ.bnc715580.diff Patch50: net-tools-1.60-plipconfig-usage.patch Patch51: net-tools-1.60-plipconfig-manpage.patch Patch52: net-tools-1.60-plipconfig-ecode.patch +# PATCH-FIX-UPSTREAM net-tools-1.60-hostname-s.patch boo#872264 ticket#14 commit#452f8e +Patch53: net-tools-1.60-hostname-s.patch %description This package contains essential programs for network administration and @@ -161,6 +163,7 @@ cp %{S:3} lib/ %patch50 -p1 %patch51 -p1 %patch52 -p1 +%patch53 -p1 cp %{S:4} . cp %{S:5} ./man/en_US