Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r55056 - in /branches/SuSE-Linux-11_0-Branch/network: ./ package/ src/isdn/ src/modules/ src/routines/
  • From: mzugec@xxxxxxxxxxxxxxxx
  • Date: Mon, 26 Jan 2009 17:54:22 -0000
  • Message-id: <E1LRVfC-00046u-Tb@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Mon Jan 26 18:54:22 2009
New Revision: 55056

URL: http://svn.opensuse.org/viewcvs/yast?rev=55056&view=rev
Log:
- run isdn only when needed (thanks to Karsten Keil) (bnc#104590)
- ISDN: use UNIQUE to match device with configuration (bnc#407683)


Modified:
branches/SuSE-Linux-11_0-Branch/network/VERSION
branches/SuSE-Linux-11_0-Branch/network/package/yast2-network.changes
branches/SuSE-Linux-11_0-Branch/network/src/isdn/config.ycp
branches/SuSE-Linux-11_0-Branch/network/src/modules/ISDN.ycp
branches/SuSE-Linux-11_0-Branch/network/src/routines/complex.ycp
branches/SuSE-Linux-11_0-Branch/network/src/routines/devices.ycp
branches/SuSE-Linux-11_0-Branch/network/src/routines/routines.ycp

Modified: branches/SuSE-Linux-11_0-Branch/network/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/network/VERSION?rev=55056&r1=55055&r2=55056&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/network/VERSION (original)
+++ branches/SuSE-Linux-11_0-Branch/network/VERSION Mon Jan 26 18:54:22 2009
@@ -1 +1 @@
-2.16.48
+2.16.49

Modified: branches/SuSE-Linux-11_0-Branch/network/package/yast2-network.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/network/package/yast2-network.changes?rev=55056&r1=55055&r2=55056&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/network/package/yast2-network.changes
(original)
+++ branches/SuSE-Linux-11_0-Branch/network/package/yast2-network.changes Mon
Jan 26 18:54:22 2009
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Jan 26 18:52:27 CET 2009 - mzugec@xxxxxxx
+
+- run isdn only when needed (thanks to Karsten Keil) (bnc#104590)
+- ISDN: use UNIQUE to match device with configuration (bnc#407683)
+- 2.16.49
+
+-------------------------------------------------------------------
Wed Jun 4 12:48:24 CEST 2008 - mzugec@xxxxxxx

- fixed command-line (bnc#397016)

Modified: branches/SuSE-Linux-11_0-Branch/network/src/isdn/config.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/network/src/isdn/config.ycp?rev=55056&r1=55055&r2=55056&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/network/src/isdn/config.ycp (original)
+++ branches/SuSE-Linux-11_0-Branch/network/src/isdn/config.ycp Mon Jan 26
18:54:22 2009
@@ -46,24 +46,25 @@
if (devtype == nil)
return;
string devnum = regexpsub(d, "^.*/cfg-[a-z]+([0-9]+)", "\\1");
+ string devname = sformat("%1%2", devtype, devnum);
if (devnum == nil)
return;
y2debug("devtype=%1 devnum=%2", devtype, devnum);

map dev = Devices[devtype]:$[];
- if(haskey(dev, devnum)) {
- y2error("device already present: %1", devnum);
+ if(haskey(dev, devname)) {
+ y2error("device already present: %1", devname);
return;
}

- string pth = ".isdn.value.\"" + sysconfig + "/cfg-"+devtype+devnum+"\"";
+ string pth = ".isdn.value.\"" + sysconfig + "/cfg-"+devname+"\"";
list<string> values = (list<string>) SCR::Dir(topath(pth));
map config = listmap(string val, values, ``{
string item = (string) SCR::Read(topath(pth + "." + val));
if(item!=nil) return $[ val : item ];
});

- dev[devnum] = config;
+ dev[devname] = config;
Devices[devtype] = dev;
});

@@ -90,11 +91,10 @@

/* write all devices */
maplist(string typ, map devsmap, Devices, ``{
- maplist(string num, map devmap, (map<string,map>)devsmap, ``{
+ maplist(string dev, map devmap, (map<string,map>)devsmap, ``{
/* write sysconfig */
if (typ != isdntyp)
return;
- string dev = typ + num;
string p = ".isdn.value.\"" + sysconfig + "/cfg-" + dev + "\".";

/* write all keys to config */
@@ -102,9 +102,8 @@
if(k == "module" || k == "options") return;
SCR::Write(topath(p+k), devmap[k]:"");
});
- string unq = devmap["UDI"]:"";
- if(unq != "")
- SCR::Write(.probe.status.configured, unq, `yes);
+// string unq = devmap["UDI"]:"";
+// if(unq != "") SCR::Write(.probe.status.configured, unq, `yes);
});
});


Modified: branches/SuSE-Linux-11_0-Branch/network/src/modules/ISDN.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/network/src/modules/ISDN.ycp?rev=55056&r1=55055&r2=55056&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/network/src/modules/ISDN.ycp (original)
+++ branches/SuSE-Linux-11_0-Branch/network/src/modules/ISDN.ycp Mon Jan 26
18:54:22 2009
@@ -354,6 +354,7 @@
y2debug("Packages returns %1", retp);
}

+ boolean haveISDNDev = ($[] != Devices["contr"]:$[]);
if(!(modified_hw || modified_if || Provider::Modified("isdn"))) return
true;
y2milestone("Writing configuration");

@@ -533,8 +534,15 @@

if(Abort()) return false;
// last step in writing current ISDN setup
- cmd = sformat("/sbin/insserv isdn"); // #104590
- SCR::Execute(.target.bash, cmd);
+ if(haveISDNDev) {
+ cmd = sformat("/sbin/insserv isdn"); // #104590
+ SCR::Execute(.target.bash, cmd);
+ } else {
+ cmd = sformat("/sbin/insserv -r capisuite");
+ SCR::Execute(.target.bash, cmd);
+ cmd = sformat("/sbin/insserv -r isdn");
+ SCR::Execute(.target.bash, cmd);
+ }
ProgressNextStage(_("Finished"));
sleep(sl);

@@ -699,7 +707,7 @@
hw_device["PARA_TYPE"] = sformat("%1", get_i4ltype(hw));
hw_device["PARA_SUBTYPE"] = sformat("%1", get_i4lsubtype(hw));
hw_device["NAME"] = sformat("%1", hw["name"]:"unknown");
- hw_device["UDI"] = hw["unique"]:"";
+ hw_device["UNIQUE"] = hw["unique"]:"";
}

/**
@@ -718,7 +726,7 @@
y2error("Item not found in Hardware: %1 (%2)", which, size(Hardware));

type = "contr";
- device = GetFreeDevice(type);
+ device = sformat("%1%2", type, GetFreeDevice(type));
hw_device = set_cardparameters ($[]);
set_hwparameters (sel);
operation = `add;
@@ -731,7 +739,8 @@
*/
global define boolean Add() ``{
type = "contr";
- device = GetFreeDevice(type);
+ device = sformat("%1%2",type, GetFreeDevice(type));
+y2internal("New Added device %1", device);
hw_device = set_cardparameters ($[]);
operation = `add;
return true;
@@ -744,18 +753,18 @@
*/
global define boolean Edit(string dev) ``{
string typ = NetworkInterfaces::device_type(dev);
- string num = NetworkInterfaces::device_num(dev);
+// string num = NetworkInterfaces::device_num(dev);

map typemap = Devices[typ]:$[];
- if(!haskey(typemap, num)) {
+ if(!haskey(typemap, dev)) {
y2error("Key not found: %1", dev);
return false;
}
- hw_device = typemap[num]:$[];
+ hw_device = typemap[dev]:$[];

y2debug("Hardware: %1", Hardware);

- device = num;
+ device = dev;
type = typ;
hw_device = set_cardparameters (hw_device);
y2debug("devmap=%1", hw_device);
@@ -771,17 +780,17 @@
global define boolean Delete(string item) ``{
operation = nil;
string typ = NetworkInterfaces::device_type(item);
- string num = NetworkInterfaces::device_num(item);
+// string num = NetworkInterfaces::device_num(item);

map typemap = Devices[typ]:$[];
- if(!haskey(typemap, num)) {
+ if(!haskey(typemap, item)) {
y2error("Key not found: %1", item);
return false;
}
if (type == "net")
- interface = typemap[num]:$[];
+ interface = typemap[item]:$[];
type = typ;
- device = num;
+ device = item;
operation = `delete;
return true;
}
@@ -849,8 +858,6 @@
global define boolean Commit() ``{
y2debug("Commit(%1) dev:%2%3",operation,type,device);
y2debug("skip %1", skip);
- string n = sformat("%1", device);
-
if (operation == nil)
return true;

@@ -863,7 +870,7 @@

map typemap = Devices[type]:$[];
y2debug("typemap %1", typemap);
- if(!haskey(typemap, n)) {
+ if(!haskey(typemap, device)) {
y2error("Key not found: %1", device);
return false;
}
@@ -987,7 +994,6 @@
];
});

- //return BuildOverview("contr");
}

global define list<map<string,any> > UnconfiguredDev () {

Modified: branches/SuSE-Linux-11_0-Branch/network/src/routines/complex.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/network/src/routines/complex.ycp?rev=55056&r1=55055&r2=55056&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/network/src/routines/complex.ycp (original)
+++ branches/SuSE-Linux-11_0-Branch/network/src/routines/complex.ycp Mon Jan 26
18:54:22 2009
@@ -40,7 +40,7 @@
if (descr != "") return descr;
descr = HardwareName (Hardware, devnum);
if (descr != "") return descr;
- descr = HardwareName (Hardware, devmap["UDI"]:"");
+ descr = HardwareName (Hardware, devmap["UNIQUE"]:"");
if (descr != "") return descr;
descr = HardwareName (Hardware, devmap["dev_name"]:"");
if (descr != "") return descr;
@@ -76,7 +76,7 @@

/* main device summary */
string descr = BuildDescription (devtype, devname, devmap,
Hardware);
- string unq = devmap["UDI"]:"";
+ string unq = devmap["UNIQUE"]:"";
string status = DeviceStatus(devtype, devname, devmap);
if (link)
{
@@ -119,7 +119,7 @@
/* build a list of unconfigured devices */
integer id=0;
maplist(map h, Hardware, {
- string unq = h["udi"]:"";
+ string unq = h["unique"]:"";

string busid = "bus-" + h["bus"]:"" + "-" + h["busid"]:"";
string mac = "id-" + h["mac"]:"";
@@ -416,7 +416,7 @@
string conn="";
string mac_dev="";
foreach(map device, Hardware, {
- if (v["udi"]:(v["UDI"]:"")==device["udi"]:"") {
+ if (v["UNIQUE"]:""==device["unique_key"]:"") {
conn = HTML::Bold ( (device["link"]:false ==
true)?"":_("(not connected)") );
if (size(device["mac"]:"")>0) mac_dev= HTML::Bold ("MAC
: ") + device["mac"]:"" + "<br>";
else
@@ -455,8 +455,6 @@
string ip = DeviceProtocol(v);

string descr = BuildDescription (type, devname, v, Hardware);
- // if(size(descr) > 17) descr = substring(descr, 0, 16) + "...";
-
string startmode_descr =
startmode_descrs[v["STARTMODE"]:""]:_("Started manually");

/* Modem and DSL */
@@ -534,7 +532,7 @@
boolean found=false;
foreach(map device, Hardware, {
hw_id=hw_id+1;
- if (v["udi"]:(v["UDI"]:"")==device["udi"]:"") { found=true; break; }
+ if (v["UNIQUE"]:""==device["unique_key"]:"") { found=true; break; }
});

item = `item(`id(devname), descr, ip, rich, (found) ? hw_id :
-1);

Modified: branches/SuSE-Linux-11_0-Branch/network/src/routines/devices.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/network/src/routines/devices.ycp?rev=55056&r1=55055&r2=55056&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/network/src/routines/devices.ycp (original)
+++ branches/SuSE-Linux-11_0-Branch/network/src/routines/devices.ycp Mon Jan 26
18:54:22 2009
@@ -49,7 +49,7 @@
/* Remaining numbered devices */
while(count < num) {
string ii = sformat("%1", i);
- if(!contains(curdevs, ii)) {
+ if(!contains(curdevs, sformat("%1%2", type,ii))) {
ret = add(ret, ii);
count = count + 1;
}
@@ -116,7 +116,7 @@
//remove(devmap, dev);
devmap = remove(devmap, dev);
Devices[type] = devmap;
- DeletedDevices = add(DeletedDevices, type+dev);
+ DeletedDevices = add(DeletedDevices, dev);

y2debug("Devices=%1", Devices);
y2debug("DeletedDevices=%1", DeletedDevices);

Modified: branches/SuSE-Linux-11_0-Branch/network/src/routines/routines.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/network/src/routines/routines.ycp?rev=55056&r1=55055&r2=55056&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/network/src/routines/routines.ycp (original)
+++ branches/SuSE-Linux-11_0-Branch/network/src/routines/routines.ycp Mon Jan
26 18:54:22 2009
@@ -636,6 +636,7 @@
one["dev_name"] = card["dev_name"]:"";
one["requires"] = card["requires"]:[];
one["modalias"] = card["modalias"]:"";
+ one["unique"] = card["unique_key"]:"";
// Each card remembers its position in the list of _all_ cards.
// It is used when selecting the card from the list of _unconfigured_
// ones (which may be smaller). #102945.

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages