diff options
author | Hess Chen <hesheng.chen@intel.com> | 2016-07-29 15:58:23 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-08-03 10:47:52 +0800 |
commit | 6cf9903481f07859cb0013598d2d13309d4e4644 (patch) | |
tree | aed86525be0cd991073e28889eca83c15185ae10 /BaseTools/Source/Python/UPT/UPT.py | |
parent | 17f3e942bc527fbd75068d2d5752b6af54917487 (diff) | |
download | edk2-platforms-6cf9903481f07859cb0013598d2d13309d4e4644.tar.xz |
BaseTool/UPT: Add Test Install
Add a new function to test if a DIST file list
one by one to see if they can meet the requirement
of Dependency.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/UPT.py')
-rw-r--r-- | BaseTools/Source/Python/UPT/UPT.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/UPT/UPT.py b/BaseTools/Source/Python/UPT/UPT.py index 59c4a88f8e..8dd949ae90 100644 --- a/BaseTools/Source/Python/UPT/UPT.py +++ b/BaseTools/Source/Python/UPT/UPT.py @@ -46,6 +46,7 @@ import InstallPkg import RmPkg
import InventoryWs
import ReplacePkg
+import TestInstall
from Library.Misc import GetWorkspace
from Library import GlobalData
from Core.IpiDb import IpiDatabase
@@ -69,6 +70,9 @@ def CheckConflictOption(Opt): Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_I_R_EXCLUSIVE)
elif Opt.PackFileToCreate and Opt.PackFileToRemove:
Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_C_R_EXCLUSIVE)
+ elif Opt.TestDistFiles and (Opt.PackFileToCreate or Opt.PackFileToInstall \
+ or Opt.PackFileToRemove or Opt.PackFileToReplace):
+ Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_C_R_EXCLUSIVE)
if Opt.CustomPath and Opt.UseGuidedPkgPath:
Logger.Warn("UPT", ST.WARN_CUSTOMPATH_OVERRIDE_USEGUIDEDPATH)
@@ -146,6 +150,9 @@ def Main(): Parser.add_option("--use-guided-paths", action="store_true", dest="Use_Guided_Paths", help=ST.HLP_USE_GUIDED_PATHS)
+ Parser.add_option("-j", "--test-install", action="append", type="string",
+ dest="Test_Install_Distribution_Package_Files", help=ST.HLP_TEST_INSTALL)
+
Opt = Parser.parse_args()[0]
Var2Var = [
@@ -159,6 +166,7 @@ def Main(): ("PackFileToReplace", Opt.Replace_Distribution_Package_File),
("PackFileToBeReplaced", Opt.Original_Distribution_Package_File),
("UseGuidedPkgPath", Opt.Use_Guided_Paths),
+ ("TestDistFiles", Opt.Test_Install_Distribution_Package_Files)
]
for Var in Var2Var:
@@ -265,6 +273,14 @@ def Main(): Opt.PackFileToReplace = AbsPath
RunModule = ReplacePkg.Main
+ elif Opt.Test_Install_Distribution_Package_Files:
+ for Dist in Opt.Test_Install_Distribution_Package_Files:
+ if not Dist.endswith('.dist'):
+ Logger.Error("TestInstall", FILE_TYPE_MISMATCH, ExtraData=ST.ERR_DIST_EXT_ERROR % Dist)
+
+ setattr(Opt, 'DistFiles', Opt.Test_Install_Distribution_Package_Files)
+ RunModule = TestInstall.Main
+
else:
Parser.print_usage()
return OPTION_MISSING
|