From 1be2ed90a20618d71ddf34b8a07d038da0b36854 Mon Sep 17 00:00:00 2001 From: Hess Chen Date: Fri, 15 Aug 2014 03:06:48 +0000 Subject: =?UTF-8?q?There=20is=20a=20limitation=20on=20WINDOWS=20OS=20for?= =?UTF-8?q?=20the=20length=20of=20entire=20file=20path=20can=E2=80=99t=20b?= =?UTF-8?q?e=20larger=20than=20255.=20There=20is=20an=20OS=20API=20provide?= =?UTF-8?q?d=20by=20Microsoft=20to=20add=20=E2=80=9C\\=3F\=E2=80=9D=20befo?= =?UTF-8?q?re=20the=20path=20header=20to=20support=20the=20long=20file=20p?= =?UTF-8?q?ath.=20Enable=20this=20feature=20on=20basetools.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen Reviewed-by: Yingke Liu git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15809 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 3 ++- BaseTools/Source/Python/AutoGen/BuildEngine.py | 5 +++-- BaseTools/Source/Python/AutoGen/GenDepex.py | 6 +++--- BaseTools/Source/Python/AutoGen/GenMake.py | 5 +++-- BaseTools/Source/Python/AutoGen/StrGather.py | 3 ++- BaseTools/Source/Python/AutoGen/UniClassObject.py | 10 +++++----- 6 files changed, 18 insertions(+), 14 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen') diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 11cf8b2f18..c4662572a0 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -13,7 +13,7 @@ ## Import Modules # -import os +import Common.LongFilePathOs as os import re import os.path as path import copy @@ -26,6 +26,7 @@ from StringIO import StringIO from StrGather import * from BuildEngine import BuildRule +from Common.LongFilePathSupport import CopyLongFilePath from Common.BuildToolError import * from Common.DataType import * from Common.Misc import * diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py index b3083d0395..d15ccc06d5 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -1,7 +1,7 @@ ## @file # The engine for building files # -# Copyright (c) 2007, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -14,10 +14,11 @@ ## # Import Modules # -import os +import Common.LongFilePathOs as os import re import copy import string +from Common.LongFilePathSupport import OpenLongFilePath as open from Common.GlobalData import * from Common.BuildToolError import * diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source/Python/AutoGen/GenDepex.py index 37ba7bc72c..a390d560fc 100644 --- a/BaseTools/Source/Python/AutoGen/GenDepex.py +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py @@ -1,7 +1,7 @@ ## @file # This file is used to generate DEPEX file for module's dependency expression # -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -13,10 +13,10 @@ ## Import Modules # import sys -import os +import Common.LongFilePathOs as os import re import traceback - +from Common.LongFilePathSupport import OpenLongFilePath as open from StringIO import StringIO from struct import pack from Common.BuildToolError import * diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 00d0af0cb7..64eedfaa12 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -1,7 +1,7 @@ ## @file # Create makefile for MS nmake and GNU make # -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -13,11 +13,12 @@ ## Import Modules # -import os +import Common.LongFilePathOs as os import sys import string import re import os.path as path +from Common.LongFilePathSupport import OpenLongFilePath as open from Common.BuildToolError import * from Common.Misc import * diff --git a/BaseTools/Source/Python/AutoGen/StrGather.py b/BaseTools/Source/Python/AutoGen/StrGather.py index b84d9f90aa..20af015bcf 100644 --- a/BaseTools/Source/Python/AutoGen/StrGather.py +++ b/BaseTools/Source/Python/AutoGen/StrGather.py @@ -1,4 +1,4 @@ -# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -20,6 +20,7 @@ from Common.BuildToolError import * from UniClassObject import * from StringIO import StringIO from struct import pack +from Common.LongFilePathSupport import OpenLongFilePath as open ## # Static definitions diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py index 7b1ce72ea7..e676ad6ec8 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -1,4 +1,4 @@ -# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -14,13 +14,13 @@ ## # Import Modules # -import os, codecs, re +import Common.LongFilePathOs as os, codecs, re import distutils.util import Common.EdkLogger as EdkLogger from Common.BuildToolError import * from Common.String import GetLineNo from Common.Misc import PathClass - +from Common.LongFilePathSupport import LongFilePath ## # Static definitions # @@ -210,7 +210,7 @@ class UniFileClassObject(object): Lang = distutils.util.split_quoted((Line.split(u"//")[0])) if len(Lang) != 3: try: - FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').read() + FileIn = codecs.open(LongFilePath(File.Path), mode='rb', encoding='utf-16').read() except UnicodeError, X: EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File); except: @@ -292,7 +292,7 @@ class UniFileClassObject(object): EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraData=File.Path) try: - FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').readlines() + FileIn = codecs.open(LongFilePath(File.Path), mode='rb', encoding='utf-16').readlines() except UnicodeError, X: EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File.Path); except: -- cgit v1.2.3