Script 'mail_helper' called by mrueckert Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: mrueckert. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /work/src/done/SLE12/yast2-network -> sle12 ## BNC# 858908 : "/etc/hostname vs. /etc/HOSTNAME confusion" (RESOLVED/FIXED) Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-network/yast2-network.changes 2014-06-02 09:32:54.000000000 +0200 +++ /work/src/done/SLE12/yast2-network/yast2-network.changes 2014-06-04 10:59:06.000000000 +0200 @@ -1,0 +2,8 @@ +Tue Jun 3 20:37:11 UTC 2014 - mfilka@suse.com + +- bnc#858908 + - write hostname into cross platform /etc/hostname instead of + SUSE specific /etc/HOSTNAME +- 3.1.62 + +------------------------------------------------------------------- calling whatdependson for sle12-i586 Packages directly triggered for rebuild: - yast2-network - at least 15 other packages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/SUSE:SLE-12:GA/yast2-network (Old) and /work/src/done/SLE12/yast2-network (BS:build ID:38983 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-network", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-network-3.1.61.tar.bz2 New: ---- yast2-network-3.1.62.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.EdkRQj/_old 2014-06-06 17:21:32.000000000 +0200 +++ /var/tmp/diff_new_pack.EdkRQj/_new 2014-06-06 17:21:32.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.61 +Version: 3.1.62 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-network-3.1.61.tar.bz2 -> yast2-network-3.1.62.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.61/package/yast2-network.changes new/yast2-network-3.1.62/package/yast2-network.changes --- old/yast2-network-3.1.61/package/yast2-network.changes 2014-05-30 16:55:23.000000000 +0200 +++ new/yast2-network-3.1.62/package/yast2-network.changes 2014-06-04 10:56:27.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Tue Jun 3 20:37:11 UTC 2014 - mfilka@suse.com + +- bnc#858908 + - write hostname into cross platform /etc/hostname instead of + SUSE specific /etc/HOSTNAME +- 3.1.62 + +------------------------------------------------------------------- Fri May 30 14:41:29 UTC 2014 - mfilka@suse.com - bnc#880754 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.61/package/yast2-network.spec new/yast2-network-3.1.62/package/yast2-network.spec --- old/yast2-network-3.1.61/package/yast2-network.spec 2014-05-30 16:55:23.000000000 +0200 +++ new/yast2-network-3.1.62/package/yast2-network.spec 2014-06-04 10:56:27.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.61 +Version: 3.1.62 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.61/src/clients/save_network.rb new/yast2-network-3.1.62/src/clients/save_network.rb --- old/yast2-network-3.1.61/src/clients/save_network.rb 2014-05-30 16:55:23.000000000 +0200 +++ new/yast2-network-3.1.62/src/clients/save_network.rb 2014-06-04 10:56:27.000000000 +0200 @@ -39,13 +39,9 @@ textdomain "network" - Yast.import "Hostname" - Yast.import "IP" - Yast.import "NetworkInterfaces" + Yast.import "DNS" Yast.import "FileUtils" - Yast.import "Netmask" Yast.import "NetworkStorage" - Yast.import "Proxy" Yast.import "Installation" Yast.import "String" Yast.import "Mode" @@ -103,7 +99,7 @@ { dir: SYSCONFIG, file: "ifcfg-*" }, { dir: SYSCONFIG, file: "ifroute-*" }, { dir: SYSCONFIG, file: "routes" }, - { dir: ETC, file: "HOSTNAME" } + { dir: ETC, file: DNSClass::HOSTNAME_FILE } ] # just copy files @@ -266,6 +262,8 @@ LanUdevAuto.Write if Mode.autoinst + DNS.create_hostname_link + SCR.Execute(path(".target.bash"), "chkconfig network on") # if portmap running - start it after reboot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.61/src/lib/network/install_inf_convertor.rb new/yast2-network-3.1.62/src/lib/network/install_inf_convertor.rb --- old/yast2-network-3.1.61/src/lib/network/install_inf_convertor.rb 2014-05-30 16:55:23.000000000 +0200 +++ new/yast2-network-3.1.62/src/lib/network/install_inf_convertor.rb 2014-06-04 10:56:27.000000000 +0200 @@ -23,6 +23,7 @@ def initialize Yast.import "Hostname" + Yast.import "DNS" Yast.import "IP" Yast.import "NetworkInterfaces" Yast.import "FileUtils" @@ -186,7 +187,7 @@ return false if hostname.empty? log.info("Write HOSTNAME: #{hostname}") - SCR.Write(path(".target.string"), "/etc/HOSTNAME", hostname) + SCR.Write(path(".target.string"), DNSClass::HOSTNAME_PATH, hostname) end def write_dns diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.61/src/modules/DNS.rb new/yast2-network-3.1.62/src/modules/DNS.rb --- old/yast2-network-3.1.61/src/modules/DNS.rb 2014-05-30 16:55:23.000000000 +0200 +++ new/yast2-network-3.1.62/src/modules/DNS.rb 2014-06-04 10:56:27.000000000 +0200 @@ -33,6 +33,12 @@ module Yast class DNSClass < Module + + include Logger + + HOSTNAME_FILE = "hostname" + HOSTNAME_PATH = "/etc/" + HOSTNAME_FILE + def main Yast.import "UI" textdomain "network" @@ -45,6 +51,7 @@ Yast.import "Progress" Yast.import "Service" Yast.import "String" + Yast.import "FileUtils" Yast.include self, "network/routines.rb" Yast.include self, "network/runtime.rb" @@ -225,51 +232,17 @@ fqhostname = "" # In installation (standard, or AutoYaST one), prefer /etc/install.inf # (because HOSTNAME comes with netcfg.rpm already, #144687) - if (Mode.installation || Mode.autoinst) && - Ops.greater_than( - SCR.Read(path(".target.size"), "/etc/install.inf"), - 0 - ) - install_inf_hostname = Convert.to_string( - SCR.Read(path(".etc.install_inf.Hostname")) - ) - Builtins.y2milestone("Got %1 from install.inf", install_inf_hostname) - - if Ops.greater_than(Builtins.size(install_inf_hostname), 0) - #if the name is actually IP, try to resolve it (bnc#556613, bnc#435649) - if IP.Check(install_inf_hostname) - fqhostname = ResolveIP(install_inf_hostname) - Builtins.y2milestone( - "Got %1 after resolving IP from install.inf", - fqhostname - ) - else - fqhostname = install_inf_hostname - end - end + if (Mode.installation || Mode.autoinst) && FileUtils.Exists("/etc/install.inf") + fqhostname = read_hostname_from_install_inf end - # We have non-empty hostname by now => we must set DNS modified flag - # in order to get the setting actually written (bnc#588938) - @modified = true if Ops.greater_than(Builtins.size(fqhostname), 0) - - - # /etc/HOSTNAME - # the usual location - if fqhostname == "" - if Ops.greater_than(SCR.Read(path(".target.size"), "/etc/HOSTNAME"), 0) - fqhostname = Convert.to_string( - SCR.Read(path(".target.string"), "/etc/HOSTNAME") - ) - #avoid passing nil argument when we get non-\n-terminated string (#445531) - fqhostname = String.FirstChunk(fqhostname, "\n") - Builtins.y2milestone("Got %1 from /etc/HOSTNAME", fqhostname) - end + if fqhostname.empty? + fqhostname = read_hostname_from_etc end split = Hostname.SplitFQ(fqhostname) - @hostname = Ops.get(split, 0, "") - @domain = Ops.get(split, 1, "") + @hostname = split[0] || "" + @domain = split[1] || "" # last resort if @hostname == "" @@ -420,9 +393,12 @@ # write hostname SCR.Write( path(".target.string"), - "/etc/HOSTNAME", + HOSTNAME_PATH, Ops.add(fqhostname, "\n") ) + + create_hostname_link + Builtins.sleep(sl) # Progress step 2/3 @@ -671,6 +647,61 @@ false end + # Creates symlink /etc/HOSTNAME -> /etc/hostname to gurantee backward compatibility + # after changes in bnc#858908 + def create_hostname_link + link_name = "/etc/HOSTNAME" + return if FileUtils.IsLink(link_name) + + log.info "Creating #{link_name} symlink" + + SCR.Execute(path(".target.bash"), "rm #{link_name}") if FileUtils.Exists(link_name) + SCR.Execute(path(".target.bash"), "ln -s #{DNSClass::HOSTNAME_PATH} #{link_name}") + + nil + end + + private + def read_hostname_from_install_inf + install_inf_hostname = SCR.Read(path(".etc.install_inf.Hostname")) || "" + log.info("Got #{install_inf_hostname} from install.inf") + + return "" if install_inf_hostname.empty? + + #if the name is actually IP, try to resolve it (bnc#556613, bnc#435649) + if IP.Check(install_inf_hostname) + fqhostname = ResolveIP(install_inf_hostname) + log.info("Got #{fqhostname} after resolving IP from install.inf") + else + fqhostname = install_inf_hostname + end + + # We have non-empty hostname by now => we must set DNS modified flag + # in order to get the setting actually written (bnc#588938) + @modified = true if !fqhostname.empty? + + return fqhostname + end + + def read_hostname_from_etc + if FileUtils.Exists(HOSTNAME_PATH) + hostname_path = HOSTNAME_PATH + elsif FileUtils.Exists("/etc/HOSTNAME") + # backward compatibility due to changes done in bnc#858908 + hostname_path = "/etc/HOSTNAME" + else + return "" + end + + fqhostname = SCR.Read(path(".target.string"), hostname_path) || "" + + #avoid passing nil argument when we get non-\n-terminated string (#445531) + fqhostname = String.FirstChunk(fqhostname, "\n") + log.info("Read #{fqhostname} from '/etc/'") + + return fqhostname + end + publish :variable => :proposal_valid, :type => "boolean" publish :variable => :hostname, :type => "string" publish :variable => :domain, :type => "string" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.61/testsuite/tests/Network_YaPI.out new/yast2-network-3.1.62/testsuite/tests/Network_YaPI.out --- old/yast2-network-3.1.61/testsuite/tests/Network_YaPI.out 2014-05-30 16:55:23.000000000 +0200 +++ new/yast2-network-3.1.62/testsuite/tests/Network_YaPI.out 2014-06-04 10:56:27.000000000 +0200 @@ -6,8 +6,8 @@ Read .sysconfig.network.config.NETCONFIG_DNS_POLICY nil Read .sysconfig.network.config.NETCONFIG_DNS_STATIC_SERVERS "208.67.222.222 208.67.220.220" Read .sysconfig.network.config.NETCONFIG_DNS_STATIC_SEARCHLIST "suse.cz suse.de" -Read .target.size "/etc/HOSTNAME" 27 -Read .target.string "/etc/HOSTNAME" "laptop.suse.cz" +Read .target.stat "/etc/hostname" $["exists":true] +Read .target.string "/etc/hostname" "laptop.suse.cz" Read .target.size "/etc/sysconfig/network/routes" 27 Read .routes [$["destination":"default", "gateway":"10.20.30.40"]] Execute .target.bash "rpm -q --whatprovides SuSEfirewall2" 0 continue with "q"... Checked in at Fri Jun 6 17:21:52 CEST 2014 by mrueckert Remember to have fun... -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org