fixed where image description doesn't match

This commit is contained in:
Adrian Cole 2010-03-15 13:32:18 -07:00
parent 983801ceb0
commit 1429edf69e

View File

@ -128,8 +128,11 @@ public class TemplateBuilderImpl implements TemplateBuilder {
if (input.getOsDescription() == null) if (input.getOsDescription() == null)
returnVal = false; returnVal = false;
else else
returnVal = input.getOsDescription().contains(osDescription) || returnVal = input.getOsDescription().contains(osDescription)
input.getOsDescription().matches(osDescription); /* note: matches() expects a regex!*/ || input.getOsDescription().matches(osDescription); /*
* note: matches()
* expects a regex!
*/
} }
return returnVal; return returnVal;
} }
@ -142,8 +145,11 @@ public class TemplateBuilderImpl implements TemplateBuilder {
if (input.getVersion() == null) if (input.getVersion() == null)
returnVal = false; returnVal = false;
else else
returnVal = input.getVersion().contains(imageVersion) || returnVal = input.getVersion().contains(imageVersion)
input.getVersion().matches(imageVersion); /* note: matches() expects a regex!*/ || input.getVersion().matches(imageVersion); /*
* note: matches() expects a
* regex!
*/
} }
return returnVal; return returnVal;
} }
@ -156,8 +162,8 @@ public class TemplateBuilderImpl implements TemplateBuilder {
if (input.getName() == null) if (input.getName() == null)
returnVal = false; returnVal = false;
else else
returnVal = input.getName().contains(imageName) || returnVal = input.getName().contains(imageName)
input.getName().matches(imageName); /* note: matches() expects a regex!*/ || input.getName().matches(imageName); /* note: matches() expects a regex! */
} }
return returnVal; return returnVal;
} }
@ -170,8 +176,12 @@ public class TemplateBuilderImpl implements TemplateBuilder {
if (input.getName() == null) if (input.getName() == null)
returnVal = false; returnVal = false;
else else
returnVal = input.getName().contains(imageDescription) || returnVal = input.getDescription().equals(imageDescription)
input.getName().matches(imageDescription); /* note: matches() expects a regex!*/ || input.getDescription().contains(imageDescription)
|| input.getDescription().matches(imageDescription); /*
* note: matches()
* expects a regex!
*/
} }
return returnVal; return returnVal;
} }