Hello community,
here is the log from the commit of package yast2-network
checked in at Fri Aug 31 16:18:11 CEST 2007.
--------
--- yast2-network/yast2-network.changes 2007-08-28 15:22:43.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-network/yast2-network.changes 2007-08-31 15:34:50.000000000 +0200
@@ -1,0 +2,7 @@
+Fri Aug 31 15:38:31 CEST 2007 - mzugec@suse.cz
+
+- autoyast support for udev rules and backport compatibility with
+ old-style network devices names (#303916)
+- 2.15.71
+
+-------------------------------------------------------------------
Old:
----
yast2-network-2.15.70.tar.bz2
New:
----
yast2-network-2.15.71.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.A28907/_old 2007-08-31 16:17:47.000000000 +0200
+++ /var/tmp/diff_new_pack.A28907/_new 2007-08-31 16:17:47.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-network (Version 2.15.70)
+# spec file for package yast2-network (Version 2.15.71)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-network
-Version: 2.15.70
+Version: 2.15.71
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-network-2.15.70.tar.bz2
+Source0: yast2-network-2.15.71.tar.bz2
prefix: /usr
# should be required by devtools
BuildRequires: perl-XML-Writer pkgconfig rpm
@@ -43,12 +43,12 @@
Conflicts: yast2-core < 2.10.6
Summary: YaST2 - Network Configuration
%package devel-doc
-Version: 2.15.70
+Version: 2.15.71
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-network-2.15.70.tar.bz2
+Source0: yast2-network-2.15.71.tar.bz2
prefix: /usr
Requires: yast2-network >= 2.15.53
Summary: YaST2 - Developer documentation for yast2-network
@@ -73,7 +73,7 @@
Michal Svec
%prep
-%setup -n yast2-network-2.15.70
+%setup -n yast2-network-2.15.71
%build
%{prefix}/bin/y2tool y2autoconf
@@ -141,6 +141,10 @@
%exclude %{prefix}/share/doc/packages/yast2-network/README
%changelog
+* Fri Aug 31 2007 - mzugec@suse.cz
+- autoyast support for udev rules and backport compatibility with
+ old-style network devices names (#303916)
+- 2.15.71
* Tue Aug 28 2007 - mzugec@suse.cz
- write NAME in propose - (#301977)
- 2.15.70
++++++ yast2-network-2.15.70.tar.bz2 -> yast2-network-2.15.71.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.70/agents/ag_udev_persistent new/yast2-network-2.15.71/agents/ag_udev_persistent
--- old/yast2-network-2.15.70/agents/ag_udev_persistent 2007-08-27 11:15:57.000000000 +0200
+++ new/yast2-network-2.15.71/agents/ag_udev_persistent 2007-08-31 15:25:50.000000000 +0200
@@ -14,6 +14,12 @@
my @net_comment = ();
my @drivers_comment = ();
+sub set_rules_comment(){
+ my $class = shift;
+ my $pointer = \@_;
+ @net_comment = @{$$pointer[0]};
+}
+
sub parse_net_rules {
my $class = shift;
my %hash_table = ();
@@ -101,6 +107,22 @@
}
+sub write_net_rules(){
+ my $class = shift;
+ my $param = \@_;
+
+ my @output = ();
+ foreach my $row (@net_comment, @{$$param[0]}){
+ push (@output, $row."\n");
+ }
+
+ if( open( FILE, "> $net_file" ) ) {
+ print FILE @output;
+ } else {
+ return $class->SetError(summary => sprintf( _("saving %s failed: %s"),$net_file, $!),
+ code => "OPEN_FAILED");
+ }
+}
sub Execute {
my $class = shift;
@@ -125,8 +147,13 @@
my $class = shift;
my ($path, @args) = @_;
if ($path eq '.drivers'){
- my $hash_pointer = $args[0];
- return $class->write_drivers_rules($hash_pointer);
+ return $class->write_drivers_rules($args[0]);
+ }
+ if ($path eq '.rules'){
+ return $class->write_net_rules($args[0]);
+ }
+ if ($path eq '.rules_comment'){
+ return $class->set_rules_comment($args[0]);
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.70/configure new/yast2-network-2.15.71/configure
--- old/yast2-network-2.15.70/configure 2007-08-28 14:58:48.000000000 +0200
+++ new/yast2-network-2.15.71/configure 2007-08-31 15:27:10.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yast2-network 2.15.69.
+# Generated by GNU Autoconf 2.61 for yast2-network 2.15.70.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -574,8 +574,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-network'
PACKAGE_TARNAME='yast2-network'
-PACKAGE_VERSION='2.15.69'
-PACKAGE_STRING='yast2-network 2.15.69'
+PACKAGE_VERSION='2.15.70'
+PACKAGE_STRING='yast2-network 2.15.70'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1197,7 +1197,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-network 2.15.69 to adapt to many kinds of systems.
+\`configure' configures yast2-network 2.15.70 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1268,7 +1268,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-network 2.15.69:";;
+ short | recursive ) echo "Configuration of yast2-network 2.15.70:";;
esac
cat <<\_ACEOF
@@ -1346,7 +1346,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-network configure 2.15.69
+yast2-network configure 2.15.70
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1360,7 +1360,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-network $as_me 2.15.69, which was
+It was created by yast2-network $as_me 2.15.70, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2181,7 +2181,7 @@
# Define the identity of the package.
PACKAGE='yast2-network'
- VERSION='2.15.69'
+ VERSION='2.15.70'
cat >>confdefs.h <<_ACEOF
@@ -2408,7 +2408,7 @@
-VERSION="2.15.69"
+VERSION="2.15.70"
RPMNAME="yast2-network"
MAINTAINER="Michal Zugec "
@@ -3303,7 +3303,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-network $as_me 2.15.69, which was
+This file was extended by yast2-network $as_me 2.15.70, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3346,7 +3346,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-network config.status 2.15.69
+yast2-network config.status 2.15.70
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.70/configure.in new/yast2-network-2.15.71/configure.in
--- old/yast2-network-2.15.70/configure.in 2007-08-28 14:58:43.000000000 +0200
+++ new/yast2-network-2.15.71/configure.in 2007-08-31 15:27:05.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.15.7 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-network, 2.15.69, http://bugs.opensuse.org/, yast2-network)
+AC_INIT(yast2-network, 2.15.70, http://bugs.opensuse.org/, yast2-network)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,7 +17,7 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.15.69"
+VERSION="2.15.70"
RPMNAME="yast2-network"
MAINTAINER="Michal Zugec "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.70/src/clients/save_network.ycp new/yast2-network-2.15.71/src/clients/save_network.ycp
--- old/yast2-network-2.15.70/src/clients/save_network.ycp 2007-08-27 11:12:53.000000000 +0200
+++ new/yast2-network-2.15.71/src/clients/save_network.ycp 2007-08-31 15:00:04.000000000 +0200
@@ -20,6 +20,7 @@
import "NetworkStorage";
import "Installation";
import "String";
+import "Mode";
include "network/routines.ycp";
include "network/complex.ycp";
@@ -205,11 +206,10 @@
string ifcfg = sformat("ifcfg-%1", InstallInf["netdevice"]:"");
string hw_name = BuildDescription(NetworkDevices::device_type(ifcfg), NetworkDevices::device_num(ifcfg), $["dev_name":InstallInf["netdevice"]:""], hardware);
-y2internal("name %1", hw_name);
if (size(hw_name)>0) network_configuration = sformat("%1NAME='%2'\n", network_configuration, hw_name);
- y2internal("Network Configuration:\n%1\nifcfg file: %2", network_configuration, ifcfg);
+ y2milestone("Network Configuration:\n%1\nifcfg file: %2", network_configuration, ifcfg);
// write only if file doesn't exists
string dev_file=sformat("/etc/sysconfig/network/%1", ifcfg);
@@ -300,6 +300,12 @@
WFM::SCRClose (new_SCR);
WFM::SCRSetDefault (old_SCR);
+ if (Mode::autoinst()){
+ import "LanUdevAuto";
+ LanUdevAuto::Write();
+ }
+
+
if(ReadInstallInf()){
// string hwcfgname = CreateHardwareFile();
// string ifcfg = sformat("ifcfg-%1", InstallInf["netdevice"]:"");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.70/src/modules/LanUdevAuto.ycp new/yast2-network-2.15.71/src/modules/LanUdevAuto.ycp
--- old/yast2-network-2.15.70/src/modules/LanUdevAuto.ycp 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-network-2.15.71/src/modules/LanUdevAuto.ycp 2007-08-31 14:22:55.000000000 +0200
@@ -0,0 +1,85 @@
+/**
+ * File: modules/LanUdevAuto.ycp
+ * Package: Network configuration
+ * Summary: Udev rules for autoinstallation
+ * Authors: Michal Zugec
+ *
+ * $Id: Lan.ycp 40537 2007-08-28 13:22:01Z mzugec $
+ *
+ * Representation of the configuration of network cards.
+ */
+
+{
+ module "LanUdevAuto";
+ textdomain "network";
+
+ list<map> udev_rules=[];
+
+/**
+ * internal function:
+ * check if old-style (ifcfg-eth-id-..., ifcfg-eth-bus-... is used) or new-style (ifcfg-eth0)
+ */
+ boolean oldStyle(map ay){
+ boolean old_style_found = false;
+ foreach(map interface, ay["interfaces"]:[], {
+ if (issubstring(interface["device"]:"", "-id-")) old_style_found=true;
+ if (issubstring(interface["device"]:"", "-bus-")) old_style_found=true;
+ });
+ y2milestone("old-style found:%1", old_style_found);
+ return old_style_found;
+ }
+
+/**
+ * internal function:
+ * for old-slyle create udev rules and rename interface names to new-style
+ */
+ list<map> createUdevFromIfaceName(list<map> interfaces){
+ y2milestone("old-style names for interfaces found - convert into new-style");
+ y2internal("interfaces %1", interfaces);
+ integer pos=0;
+ list<map> tmp_interfaces=[];
+ foreach(map interface, interfaces, {
+ if (issubstring(interface["device"]:"", "-id-")||issubstring(interface["device"]:"", "-bus-")){
+ string value = splitstring(interface["device"]:"", "-")[2]:"";
+ string rule="ATTR{address}";
+ if (splitstring(interface["device"]:"", "-")[1]:"" == "bus") rule = "KERNELS";
+ interface["device"]=sformat("eth%1", pos);
+ udev_rules = add(udev_rules,
+ $[
+ "rule" : rule,
+ "value" : value,
+ "name" : interface["device"]:""
+ ]);
+ tmp_interfaces=add(tmp_interfaces, interface);
+ }
+ pos=pos+1;
+ });
+ y2milestone("converted interfaces: %1", tmp_interfaces);
+ return tmp_interfaces;
+ }
+
+ global define boolean Import(map settings) {
+ if (oldStyle(settings)) settings["interfaces"] = createUdevFromIfaceName(settings["interfaces"]:[]);
+ else udev_rules = settings["net-udev"]:[];
+ y2internal("interfaces: %1", settings["interfaces"]:[]);
+ y2internal("udev rules:%1", udev_rules);
+ return true;
+ }
+
+ global define boolean Write(){
+ list<string> comment = ["# Generated by autoyast",
+ "# program run by the persistent-net-generator.rules rules file.",
+ "#",
+ "# You can modify it, as long as you keep each rule on a single line." ];
+ list<string> rules = [];
+ foreach(map rule, udev_rules, {
+ rules = add(rules, sformat("SUBSYSTEM==\"net\", DRIVERS==\"?*\", %1==\"%2\", NAME=\"%3\"",
+ rule["rule"]:"", rule["value"]:"", rule["name"]:""));
+ });
+ SCR::Write(.udev_persistent.rules_comment, comment);
+ SCR::Write(.udev_persistent.rules, rules);
+ return true;
+ }
+
+
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-network-2.15.70/VERSION new/yast2-network-2.15.71/VERSION
--- old/yast2-network-2.15.70/VERSION 2007-08-28 14:59:35.000000000 +0200
+++ new/yast2-network-2.15.71/VERSION 2007-08-31 15:38:25.000000000 +0200
@@ -1 +1 @@
-2.15.70
+2.15.71
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org