Author: aschnell
Date: Tue Feb 10 13:18:42 2009
New Revision: 55385
URL: http://svn.opensuse.org/viewcvs/yast?rev=55385&view=rev
Log:
- use source/sink as rank for disk/mountpoint
Modified:
trunk/storage/libstorage/src/Graph.cc
Modified: trunk/storage/libstorage/src/Graph.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Graph.cc?rev=55385&r1=55384&r2=55385&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Graph.cc (original)
+++ trunk/storage/libstorage/src/Graph.cc Tue Feb 10 13:18:42 2009
@@ -47,8 +47,20 @@
};
- typedef array Ranks;
- const Ranks ranks = { { NODE_DISK, NODE_PARTITION, NODE_LVMVG, NODE_LVMLV, NODE_MOUNTPOINT } };
+ struct Rank
+ {
+ Rank(NodeType type, const string& name)
+ : type(type), name(name)
+ {}
+
+ NodeType type;
+ string name;
+ };
+
+ typedef array Ranks;
+ const Ranks ranks = { { Rank(NODE_DISK, "source"), Rank(NODE_PARTITION, "same"),
+ Rank(NODE_LVMVG, "same"), Rank(NODE_LVMLV, "same"),
+ Rank(NODE_MOUNTPOINT, "sink") } };
string dotQuote(const string& str)
@@ -260,11 +272,11 @@
{
list<string> ids;
for (list<Node>::const_iterator node = nodes.begin(); node != nodes.end(); ++node)
- if (node->type == *rank)
+ if (node->type == rank->type)
ids.push_back(dotQuote(node->id));
if (!ids.empty())
- out << " { rank=same; " << boost::join(ids, " ") << " };" << endl;
+ out << " { rank=" << rank->name << "; " << boost::join(ids, " ") << " };" << endl;
}
out << endl;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org