Size = -1\r
return [VpdOffset, str(Size), Value], IsValid, 2\r
elif PcdType in (MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_HII):\r
+ IsValid = (3 <= len(FieldList) <= 5)\r
HiiString = FieldList[0]\r
Guid = Offset = Value = Attribute = ''\r
if len(FieldList) > 1:\r
Offset = FieldList[2]\r
if len(FieldList) > 3:\r
Value = FieldList[3]\r
+ if not Value:\r
+ IsValid = False\r
if len(FieldList) > 4:\r
Attribute = FieldList[4]\r
- IsValid = (3 <= len(FieldList) <= 5)\r
return [HiiString, Guid, Offset, Value, Attribute], IsValid, 3\r
return [], False, 0\r
\r
'''\r
\r
variablePattern = re.compile(r'[\t\s]*0[xX][a-fA-F0-9]+$')\r
-\r
+SkuIdPattern = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*$')\r
## regular expressions for finding decimal and hex numbers\r
Pattern = re.compile('^[1-9]\d*|0$')\r
HexPattern = re.compile(r'0[xX][0-9a-fA-F]+$')\r
if not Pattern.match(Record[0]) and not HexPattern.match(Record[0]):\r
EdkLogger.error('build', FORMAT_INVALID, "The format of the Sku ID number is invalid. It only support Integer and HexNumber",\r
File=self.MetaFile, Line=Record[-1])\r
- if not IsValidWord(Record[1]):\r
- EdkLogger.error('build', FORMAT_INVALID, "The format of the Sku ID name is invalid. The correct format is '(a-zA-Z0-9_)(a-zA-Z0-9_-.)*'",\r
+ if not SkuIdPattern.match(Record[1]) or (Record[2] and not SkuIdPattern.match(Record[2])):\r
+ EdkLogger.error('build', FORMAT_INVALID, "The format of the Sku ID name is invalid. The correct format is '(a-zA-Z_)(a-zA-Z0-9_)*'",\r
File=self.MetaFile, Line=Record[-1])\r
self._SkuIds[Record[1].upper()] = (str(DscBuildData.ToInt(Record[0])), Record[1].upper(), Record[2].upper())\r
if TAB_DEFAULT not in self._SkuIds:\r