Replace "<>" with "!=" to be compatible with python3.
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Dpx = GenDepex.DependencyExpression(self.DepexList[ModuleType], ModuleType, True)\r
DpxFile = gAutoGenDepexFileName % {"module_name" : self.Name}\r
\r
- if len(Dpx.PostfixNotation) <> 0:\r
+ if len(Dpx.PostfixNotation) != 0:\r
self.DepexGenerated = True\r
\r
if Dpx.Generate(path.join(self.OutputDir, DpxFile)):\r
self.RuleContent[Index] = Line\r
\r
# find the build_rule_version\r
- if Line and Line[0] == "#" and Line.find(TAB_BUILD_RULE_VERSION) <> -1:\r
- if Line.find("=") <> -1 and Line.find("=") < (len(Line) - 1) and (Line[(Line.find("=") + 1):]).split():\r
+ if Line and Line[0] == "#" and Line.find(TAB_BUILD_RULE_VERSION) != -1:\r
+ if Line.find("=") != -1 and Line.find("=") < (len(Line) - 1) and (Line[(Line.find("=") + 1):]).split():\r
self._FileVersion = (Line[(Line.find("=") + 1):]).split()[0]\r
# skip empty or comment line\r
if Line == "" or Line[0] == "#":\r
\r
# convert source files and binary files to build targets\r
self.ResultFileList = [str(T.Target) for T in self._AutoGenObject.CodaTargetList]\r
- if len(self.ResultFileList) == 0 and len(self._AutoGenObject.SourceFileList) <> 0:\r
+ if len(self.ResultFileList) == 0 and len(self._AutoGenObject.SourceFileList) != 0:\r
EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build",\r
ExtraData="[%s]" % str(self._AutoGenObject))\r
\r
def ParseFieldValue (Value):\r
if type(Value) == type(0):\r
return Value, (Value.bit_length() + 7) / 8\r
- if type(Value) <> type(''):\r
+ if type(Value) != type(''):\r
raise BadExpression('Type %s is %s' %(Value, type(Value)))\r
Value = Value.strip()\r
if Value.startswith(TAB_UINT8) and Value.endswith(')'):\r
EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE, OtherMsg="The Library Class [%s] is not used in any platform" % (Record[1]), BelongsToTable='Inf', BelongsToItem=Record[0])\r
SqlCommand = """\r
select A.ID, A.Value1, A.BelongsToFile, A.StartLine, B.StartLine from Dsc as A left join Dsc as B\r
- where A.Model = %s and B.Model = %s and A.Scope1 = B.Scope1 and A.Scope2 = B.Scope2 and A.ID <> B.ID\r
- and A.Value1 = B.Value1 and A.Value2 <> B.Value2 and A.BelongsToItem = -1 and B.BelongsToItem = -1 and A.StartLine <> B.StartLine and B.BelongsToFile = A.BelongsToFile""" \\r
+ where A.Model = %s and B.Model = %s and A.Scope1 = B.Scope1 and A.Scope2 = B.Scope2 and A.ID != B.ID\r
+ and A.Value1 = B.Value1 and A.Value2 != B.Value2 and A.BelongsToItem = -1 and B.BelongsToItem = -1 and A.StartLine != B.StartLine and B.BelongsToFile = A.BelongsToFile""" \\r
% (MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)\r
RecordSet = EccGlobalData.gDb.TblDsc.Exec(SqlCommand)\r
for Record in RecordSet:\r
and A.Value1 = B.Value1\r
and A.Value2 = B.Value2\r
and A.Scope1 = B.Scope1\r
- and A.ID <> B.ID\r
+ and A.ID != B.ID\r
and A.Model = B.Model\r
and A.Enabled > -1\r
and B.Enabled > -1\r
SqlCommand = """\r
select A.ID, A.Value3, A.BelongsToFile, B.BelongsToFile from %s as A, %s as B\r
where A.Value2 = 'FILE_GUID' and B.Value2 = 'FILE_GUID' and\r
- A.Value3 = B.Value3 and A.ID <> B.ID group by A.ID\r
+ A.Value3 = B.Value3 and A.ID != B.ID group by A.ID\r
""" % (Table.Table, Table.Table)\r
RecordSet = Table.Exec(SqlCommand)\r
for Record in RecordSet:\r
SqlCommand = """\r
select A.ID, A.Value1 from %s as A, %s as B\r
where A.Model = %s and B.Model = %s\r
- and A.Value1 like B.Value1 and A.ID <> B.ID\r
+ and A.Value1 like B.Value1 and A.ID != B.ID\r
and A.Scope1 = B.Scope1\r
and A.Enabled > -1\r
and B.Enabled > -1\r
SqlCommand = """\r
select A.ID, A.Value1, A.Value2 from %s as A, %s as B\r
where A.Model = %s and B.Model = %s\r
- and A.Value2 like B.Value2 and A.ID <> B.ID\r
- and A.Scope1 = B.Scope1 and A.Value1 <> B.Value1\r
+ and A.Value2 like B.Value2 and A.ID != B.ID\r
+ and A.Scope1 = B.Scope1 and A.Value1 != B.Value1\r
group by A.ID\r
""" % (Table.Table, Table.Table, Model, Model)\r
RecordSet = Table.Exec(SqlCommand)\r
sys.exit(1)\r
\r
Version = Process.communicate()\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Open SSL command not available. Please verify PATH or set OPENSSL_PATH')\r
sys.exit(Process.returncode)\r
print(Version[0])\r
#\r
Process = subprocess.Popen('%s smime -sign -binary -signer "%s" -outform DER -md sha256 -certfile "%s"' % (OpenSslCommand, args.SignerPrivateCertFileName, args.OtherPublicCertFileName), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
Signature = Process.communicate(input=FullInputFileBuffer)[0]\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
sys.exit(Process.returncode)\r
\r
#\r
#\r
Process = subprocess.Popen('%s smime -verify -inform DER -content %s -CAfile %s' % (OpenSslCommand, args.OutputFileName, args.TrustedPublicCertFileName), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
Process.communicate(input=args.SignatureBuffer)[0]\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Verification failed')\r
os.remove (args.OutputFileName)\r
sys.exit(Process.returncode)\r
sys.exit(1)\r
\r
Version = Process.communicate()\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Open SSL command not available. Please verify PATH or set OPENSSL_PATH')\r
sys.exit(Process.returncode)\r
print(Version[0])\r
#\r
Process = subprocess.Popen('%s genrsa -out %s 2048' % (OpenSslCommand, Item.name), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
Process.communicate()\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: RSA 2048 key generation failed')\r
sys.exit(Process.returncode)\r
\r
#\r
Process = subprocess.Popen('%s rsa -in %s -modulus -noout' % (OpenSslCommand, Item), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
PublicKeyHexString = Process.communicate()[0].split('=')[1].strip()\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Unable to extract public key from private key')\r
sys.exit(Process.returncode)\r
PublicKey = ''\r
Process = subprocess.Popen('%s dgst -sha256 -binary' % (OpenSslCommand), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
Process.stdin.write (PublicKey)\r
PublicKeyHash = PublicKeyHash + Process.communicate()[0]\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Unable to extract SHA 256 hash of public key')\r
sys.exit(Process.returncode)\r
\r
sys.exit(1)\r
\r
Version = Process.communicate()\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Open SSL command not available. Please verify PATH or set OPENSSL_PATH')\r
sys.exit(Process.returncode)\r
print(Version[0])\r
while len(PublicKeyHexString) > 0:\r
PublicKey = PublicKey + chr(int(PublicKeyHexString[0:2],16))\r
PublicKeyHexString=PublicKeyHexString[2:]\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
sys.exit(Process.returncode)\r
\r
if args.MonotonicCountStr:\r
#\r
Process = subprocess.Popen('%s dgst -sha256 -sign "%s"' % (OpenSslCommand, args.PrivateKeyFileName), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
Signature = Process.communicate(input=FullInputFileBuffer)[0]\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
sys.exit(Process.returncode)\r
\r
#\r
#\r
# Verify that the Hash Type matches the expected SHA256 type\r
#\r
- if uuid.UUID(bytes_le = Header.HashType) <> EFI_HASH_ALGORITHM_SHA256_GUID:\r
+ if uuid.UUID(bytes_le = Header.HashType) != EFI_HASH_ALGORITHM_SHA256_GUID:\r
print('ERROR: unsupport hash GUID')\r
sys.exit(1)\r
\r
#\r
# Verify the public key\r
#\r
- if Header.PublicKey <> PublicKey:\r
+ if Header.PublicKey != PublicKey:\r
print('ERROR: Public key in input file does not match public key from private key file')\r
sys.exit(1)\r
\r
# \r
Process = subprocess.Popen('%s dgst -sha256 -prverify "%s" -signature %s' % (OpenSslCommand, args.PrivateKeyFileName, args.OutputFileName), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)\r
Process.communicate(input=FullInputFileBuffer)\r
- if Process.returncode <> 0:\r
+ if Process.returncode != 0:\r
print('ERROR: Verification failed')\r
os.remove (args.OutputFileName)\r
sys.exit(Process.returncode)\r
if DscBuildData.NeedUpdateOutput(OutputValueFile, PcdValueInitExe ,InputValueFile):\r
Command = PcdValueInitExe + ' -i %s -o %s' % (InputValueFile, OutputValueFile)\r
returncode, StdOut, StdErr = DscBuildData.ExecuteCommand (Command)\r
- if returncode <> 0:\r
+ if returncode != 0:\r
EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collect output from command: %s' % Command)\r
\r
File = open (OutputValueFile, 'r')\r