[DEBUG] package copy subDirectory
This commit is contained in:
parent
dd03e46832
commit
288207e4e1
@ -428,7 +428,7 @@ class Module:
|
|||||||
##
|
##
|
||||||
def folders_to_staging(self, binaryName, target):
|
def folders_to_staging(self, binaryName, target):
|
||||||
for source, destination in self.folders:
|
for source, destination in self.folders:
|
||||||
debug.verbose("Might copy folder : " + source + "==>" + destination)
|
debug.debug("Might copy folder : " + source + "==>" + destination)
|
||||||
lutinTools.copy_anything_target(target, self.originFolder + "/" + source, destination)
|
lutinTools.copy_anything_target(target, self.originFolder + "/" + source, destination)
|
||||||
|
|
||||||
# call here to build the module
|
# call here to build the module
|
||||||
|
@ -105,25 +105,34 @@ def copy_anything(src, dst):
|
|||||||
tmpPath = os.path.dirname(os.path.realpath(src))
|
tmpPath = os.path.dirname(os.path.realpath(src))
|
||||||
tmpRule = os.path.basename(src)
|
tmpRule = os.path.basename(src)
|
||||||
for root, dirnames, filenames in os.walk(tmpPath):
|
for root, dirnames, filenames in os.walk(tmpPath):
|
||||||
|
debug.verbose(" root='" + str(root) + "' dir='" + str(dirnames) + "' filenames=" + str(filenames))
|
||||||
tmpList = filenames
|
tmpList = filenames
|
||||||
if len(tmpRule)>0:
|
if len(tmpRule)>0:
|
||||||
tmpList = fnmatch.filter(filenames, tmpRule)
|
tmpList = fnmatch.filter(filenames, tmpRule)
|
||||||
# Import the module :
|
# Import the module :
|
||||||
for cycleFile in tmpList:
|
for cycleFile in tmpList:
|
||||||
#for cycleFile in filenames:
|
#for cycleFile in filenames:
|
||||||
#debug.info("Might copy : '" + tmpPath+cycleFile + "' ==> '" + dst + "'")
|
debug.verbose("Might copy : '" + tmpPath+cycleFile + "' ==> '" + dst + "'")
|
||||||
copy_file(tmpPath+"/"+cycleFile,dst+"/"+cycleFile)
|
copy_file(tmpPath+"/"+cycleFile, dst+"/"+cycleFile)
|
||||||
|
|
||||||
|
|
||||||
def copy_anything_target(target, src, dst):
|
def copy_anything_target(target, src, dst):
|
||||||
tmpPath = os.path.dirname(os.path.realpath(src))
|
tmpPath = os.path.dirname(os.path.realpath(src))
|
||||||
tmpRule = os.path.basename(src)
|
tmpRule = os.path.basename(src)
|
||||||
for root, dirnames, filenames in os.walk(tmpPath):
|
for root, dirnames, filenames in os.walk(tmpPath):
|
||||||
|
debug.verbose(" root='" + str(root) + "' dir='" + str(dirnames) + "' filenames=" + str(filenames))
|
||||||
tmpList = filenames
|
tmpList = filenames
|
||||||
if len(tmpRule)>0:
|
if len(tmpRule)>0:
|
||||||
tmpList = fnmatch.filter(filenames, tmpRule)
|
tmpList = fnmatch.filter(filenames, tmpRule)
|
||||||
# Import the module :
|
# Import the module :
|
||||||
for cycleFile in tmpList:
|
for cycleFile in tmpList:
|
||||||
#for cycleFile in filenames:
|
#for cycleFile in filenames:
|
||||||
#debug.info("Might copy : '" + tmpPath+cycleFile + "' ==> '" + dst + "'")
|
newDst = dst
|
||||||
target.add_file_staging(tmpPath+"/"+cycleFile,dst+"/"+cycleFile)
|
if len(newDst) != 0 and newDst[-1] != "/":
|
||||||
|
newDst += "/"
|
||||||
|
if root[len(src)-1:] != "":
|
||||||
|
newDst += root[len(src)-1:]
|
||||||
|
if len(newDst) != 0 and newDst[-1] != "/":
|
||||||
|
newDst += "/"
|
||||||
|
debug.verbose("Might copy : '" + root+"/"+cycleFile + "' ==> '" + newDst+cycleFile + "'" )
|
||||||
|
target.add_file_staging(root+"/"+cycleFile, newDst+cycleFile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user