[wpkg-users] [Bug 209] Replace variables in package revisions by their value in local wpkg.xml file
bugzilla-daemon at bugzilla.wpkg.org
bugzilla-daemon at bugzilla.wpkg.org
Sat Jul 9 14:17:44 CEST 2011
http://bugzilla.wpkg.org/show_bug.cgi?id=209
--- Comment #9 from Stefan Pendl <pendl2megabit at yahoo.de> ---
How about adding a flag indicating the processing of a variable to the
getHostMatches function?
Proposal:
* @param getAllMatches
* If set to true returns all matches. If set to false just returns
the first matching node from xmlNodes. In this case the return array will
contain only one element (or 0 if no match was found).
* @param isVariable
* If set to true a variable definition is checked.
* @returns Array of XML nodes which match the current host.
*/
function getHostMatches(xmlNodes, getAllMatches, isVariable) {
...
hostAttributes.Add("name", getHostname());
hostAttributes.Add("hostname", getHostname());
hostAttributes.Add("architecture", getArchitecture());
...
switch (xmlNodeAttrName) {
// The name attribute is handled differently
// according to legacy WPKG behavior.
// Name can be matched against exact host name,
// regexp match of hostname and ip-address match.
case "name", "hostname":
// If no host name could be found skip to next
// attribute.
/* skip name attribute for variables */
if (xmlNodeAttrName == "name" && isVariable == true) {
break;
}
...
How about that?
---
Stefan
--
Configure bugmail: http://bugzilla.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the wpkg-users
mailing list