Pierre Gondois
70d53c2df0
BaseTools: UPT/Library: Remove unnecessary code
...
Running the vulture tool on the UPT/Library folder gave the following
report. Remove the unnecessary code.
- UPT/Library/CommentGenerating.py:50:
unused function 'GenGenericComment' (60% confidence)
- UPT/Library/CommentGenerating.py:172:
unused function 'GenInfPcdTailComment' (60% confidence)
- UPT/Library/CommentGenerating.py:185:
unused function 'GenInfProtocolPPITailComment' (60% confidence)
- UPT/Library/CommentGenerating.py:203:
unused function 'GenInfGuidTailComment' (60% confidence)
- UPT/Library/Misc.py:504:
unused class 'MergeCommentDict' (60% confidence)
- UPT/Library/Misc.py:527:
unused function 'GenDummyHelpTextObj' (60% confidence)
- UPT/Library/ParserValidate.py:110:
unused function 'IsValidInfComponentType' (60% confidence)
- UPT/Library/ParserValidate.py:122:
unused function 'IsValidToolFamily' (60% confidence)
- UPT/Library/ParserValidate.py:134:
unused function 'IsValidToolTagName' (60% confidence)
- UPT/Library/ParserValidate.py:465:
unused function 'IsValidBuildNumber' (60% confidence)
- UPT/Library/ParserValidate.py:478:
unused function 'IsValidDepex' (60% confidence)
- UPT/Library/ParserValidate.py:546:
unused function 'IsValidVersionString' (60% confidence)
- UPT/Library/ParserValidate.py:721:
unused function 'CheckUTF16FileHeader' (60% confidence)
- UPT/Library/Parsing.py:52:
unused function 'GetBuildOption' (60% confidence)
- UPT/Library/Parsing.py💯
unused function 'GetLibraryClassOfInf' (60% confidence)
- UPT/Library/Parsing.py:150:
unused function 'GetPcd' (60% confidence)
- UPT/Library/Parsing.py:177:
unused function 'GetFeatureFlagPcd' (60% confidence)
- UPT/Library/Parsing.py:201:
unused function 'GetDynamicDefaultPcd' (60% confidence)
- UPT/Library/Parsing.py:227:
unused function 'GetDynamicHiiPcd' (60% confidence)
- UPT/Library/Parsing.py:254:
unused function 'GetDynamicVpdPcd' (60% confidence)
- UPT/Library/Parsing.py:277:
unused function 'GetComponent' (60% confidence)
- UPT/Library/Parsing.py:392:
unused function 'GetExec' (60% confidence)
- UPT/Library/Parsing.py:416:
unused function 'GetComponents' (60% confidence)
- UPT/Library/Parsing.py:532:
unused function 'GetSource' (60% confidence)
- UPT/Library/Parsing.py:581:
unused function 'GetGuidsProtocolsPpisOfInf' (60% confidence)
- UPT/Library/Parsing.py:595:
unused function 'GetGuidsProtocolsPpisOfDec' (60% confidence)
- UPT/Library/Parsing.py:645:
unused function 'GetPcdOfInf' (60% confidence)
- UPT/Library/Parsing.py:682:
unused function 'GetPcdOfDec' (60% confidence)
- UPT/Library/Parsing.py:739:
unused function 'InsertSectionItems' (60% confidence)
- UPT/Library/Parsing.py:776:
unused function 'GenMetaDatSectionItem' (60% confidence)
- UPT/Library/StringUtils.py:87:
unused function 'GetLibraryClassesWithModuleType' (60% confidence)
- UPT/Library/StringUtils.py:107:
unused function 'GetDynamics' (60% confidence)
- UPT/Library/StringUtils.py:350:
unused function 'GetMultipleValuesOfKeyFromLines' (60% confidence)
- UPT/Library/StringUtils.py:396:
unused function 'GetSingleValueOfKeyFromLines' (60% confidence)
- UPT/Library/StringUtils.py:463:
unused function 'PreCheck' (60% confidence)
- UPT/Library/StringUtils.py:675:
unused function 'StringArrayLength' (60% confidence)
- UPT/Library/StringUtils.py:718:
unused function 'IsHexDigit' (60% confidence)
- UPT/Library/UniClassObject.py:86:
unused function 'UniToStr' (60% confidence)
- UPT/Library/UniClassObject.py:227:
unused attribute 'StringNameByteList' (60% confidence)
- UPT/Library/UniClassObject.py:237:
unused attribute 'StringNameByteList' (60% confidence)
- UPT/Library/UniClassObject.py:377:
unused method 'GetIncludeFile' (60% confidence)
- UPT/Library/UniClassObject.py:947:
unused method 'FindStringValue' (60% confidence)
- UPT/Library/UniClassObject.py:957:
unused method 'FindByToken' (60% confidence)
- UPT/Library/UniClassObject.py:1022:
unused method 'ReadIncludeUNIfile' (60% confidence)
- UPT/Library/StringUtils.py:718:
unused function 'IsHexDigit' (60% confidence)
- UPT/Library/Xml/XmlRoutines.py:176:
unused function 'XmlElementList' (60% confidence)
- UPT/Library/Xml/XmlRoutines.py:202:
unused function 'XmlNodeName' (60% confidence)
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com >
2025-07-01 09:51:38 +08:00
Pierre Gondois
f54fe78d9a
BaseTools: Remove unused import
...
Running the vulture tool gave the following report.
Remove the unused import.
- BPDG/BPDG.py:21:
unused import 'encodings' (90% confidence)
- build/build.py:61:
unused import 'Manager' (90% confidence)
- Ecc/CParser4/CLexer.py:4:
unused import 'TextIO' (90% confidence)
- Ecc/CParser4/CParser.py:5:
unused import 'TextIO' (90% confidence)
- Eot/CParser4/CLexer.py:4:
unused import 'TextIO' (90% confidence)
- Eot/CParser4/CParser.py:5:
unused import 'TextIO' (90% confidence)
- Eot/EotMain.py:28:
unused import 'ConvertGuid' (90% confidence)
- GenFds/FdfParser.py:16:
unused import 'hexdigits' (90% confidence)
- Table/TableEotReport.py:16:
unused import 'EotToolError' (90% confidence)
- UPT/Library/CommentGenerating.py:19:
unused import 'USAGE_ITEM_NOTIFY' (90% confidence)
- UPT/Library/ParserValidate.py:18:
unused import 'COMPONENT_TYPE_LIST' (90% confidence)
- UPT/Library/UniClassObject.py:25:
unused import 'CheckUTF16FileHeader' (90% confidence)
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com >
2025-07-01 09:51:38 +08:00
Michael D Kinney
2e351cbe8e
BaseTools: Replace BSD License with BSD+Patent License
...
https://bugzilla.tianocore.org/show_bug.cgi?id=1373
Replace BSD 2-Clause License with BSD+Patent License. This change is
based on the following emails:
https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html
RFCs with detailed process for the license change:
V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com >
Reviewed-by: Bob Feng <bob.c.feng@intel.com >
2019-04-09 09:10:20 -07:00
Antoine Coeur
fb0b35e05f
BaseTools: Various typo
...
Various typo in BaseTools.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Coeur <coeur@gmx.fr >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2019-02-14 10:02:28 +08:00
Zhijux Fan
174a9d3cc8
BaseTools/UPT:merge UPT Tool use Python2 and Python3
...
In UPT Tool,merge python2 and python3
Cc: Bob Feng <bob.c.feng@intel.com >
Cc: Liming Gao <liming.gao@intel.com >
Cc: Yonghong Zhu <yonghong.zhu@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com >
Tested-by: Laszlo Ersek <lersek@redhat.com >
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org >
Reviewed-by: Liming Gao <liming.gao@intel.com >
Reviewed-by: Bob Feng <bob.c.feng@intel.com >
2019-02-01 11:09:19 +08:00
Liming Gao
1ccc4d895d
Revert BaseTools: PYTHON3 migration
...
This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52..
678f851312 .
Python3 migration is the fundamental change. It requires every developer
to install Python3. Before this migration, the well communication and wide
verification must be done. But now, most people is not aware of this change,
and not try it. So, Python3 migration is reverted and be moved to edk2-staging
Python3 branch for the edk2 user evaluation.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com >
2018-10-15 08:29:14 +08:00
Yonghong Zhu
1b2e077260
BaseTools/UPT: Porting UPT Tool from Python2 to Python3
...
Cc: Liming Gao <liming.gao@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2018-10-13 09:57:16 +08:00
Liming Gao
f7496d7173
BaseTools: Clean up source files
...
1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com >
Cc: Yonghong Zhu <yonghong.zhu@intel.com >
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com >
2018-07-09 10:25:47 +08:00
Gary Lin
0d1f5b2b5d
BaseTools: Fix old python2 idioms
...
Based on "futurize -f lib2to3.fixes.fix_idioms"
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".
* Change both
v = list(EXPR)
v.sort()
foo(v)
and the more general
v = EXPR
v.sort()
foo(v)
into
v = sorted(EXPR)
foo(v)
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 >
2018-06-27 16:33:27 +08:00
Yonghong Zhu
64285f1526
BaseTools/UPT: Update the import statement to use StringUtils
...
The patch 5a57246eab Rename String to StringUtils, but it didn't
update the UPT Tool for the import statement which cause UPT tool
break.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
2018-06-11 15:31:49 +08:00
Carsey, Jaben
4231a8193e
BaseTools: Remove equality operator with None
...
replace "== None" with "is None" and "!= None" with "is not None"
Cc: Yonghong Zhu <yonghong.zhu@intel.com >
Cc: Liming Gao <liming.gao@intel.com >
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com >
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com >
2018-03-30 08:25:13 +08:00
Hess Chen
8145b63e97
BaseTool/UPT: Fix two wrong imports for UPT
...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18600 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-10 05:46:00 +00:00
Hesheng Chen
fb0f8067ea
BaseTools: Update UPT tool to support multiple workspaces
...
Update UPT to refer MultipleWorkspace class to convert
the file path from WORKSPACE and PACKAGES_PATH.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hesheng Chen <hesheng.chen@intel.com >
Reviewed-by: Liming Gao <liming.gao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18580 6f19259b-4bc3-4df7-8a09-765794883524
2015-10-08 09:28:15 +00:00
Hess Chen
fe90f4836a
BaseTools/Upt: Add a BOM check for UNI file and fix some help message error
...
Add a BOM check for UNI file and fix some help message error
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com >
Reviewed-by: YangX Li <yangx.li@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17876 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08 05:43:22 +00:00
Hess Chen
421ccda307
This patch is going to:
...
1. Add a recovery mode for UPT failure
2. Add UNI file support
3. Add binary file header support
4. Add support for PCD error message
5. Add support for replace
6. Format generated INF/DEC files
7. Update dependency check
8. Other minor fixes
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com >
Reviewed-by: Gao, Liming <liming.gao@intel.com >
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15896 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-26 05:58:02 +00:00
lgao4
9508d0fa4f
Sync BaseTool trunk (version r2474) into EDKII BaseTools.
...
Signed-off-by: lgao4
Reviewed-by: gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12883 6f19259b-4bc3-4df7-8a09-765794883524
2011-12-16 08:52:13 +00:00
lgao4
0d2711a693
Sync BaseTools Trunk (version r2387) to EDKII main trunk.
...
Signed-off-by: lgao4
Reviewed-by: gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12602 6f19259b-4bc3-4df7-8a09-765794883524
2011-10-29 06:59:30 +00:00
lgao4
4234283c3a
Sync BaseTools Branch (version r2271) to EDKII main trunk.
...
BaseTool Branch:
https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/branches/Releases/BaseTools_r2100
Signed-off-by: lgao4
Reviewed-by: hchen30
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12214 6f19259b-4bc3-4df7-8a09-765794883524
2011-08-26 07:46:26 +00:00