[DEBUG] some correction after installing archlinux

This commit is contained in:
Edouard DUPIN 2015-09-06 22:37:58 +02:00
parent d70b82683b
commit 836dee5cf8
6 changed files with 47 additions and 48 deletions

View File

@ -20,7 +20,7 @@ import subprocess
import shlex
# Local import
from . import debug
import tools
from . import tools
from . import env
queueLock = threading.Lock()
@ -42,44 +42,6 @@ isinit = False # the thread are initialized
errorOccured = False # a thread have an error
processorAvaillable = 1 # number of CPU core availlable
def store_command(cmd_line, file):
# write cmd line only after to prevent errors ...
if file == "" \
or file == None:
return;
debug.verbose("create cmd file: " + file)
# Create directory:
tools.create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write(cmd_line)
file2.flush()
file2.close()
def store_warning(file, output, err):
# write warning line only after to prevent errors ...
if file == "" \
or file == None:
return;
if env.get_warning_mode() == False:
debug.verbose("remove warning file: " + file)
# remove file if exist...
tools.remove_file(file);
return;
debug.verbose("create warning file: " + file)
# Create directory:
tools.create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write("===== output =====\n")
file2.write(output)
file2.write("\n\n")
file2.write("===== error =====\n")
file2.write(err)
file2.write("\n\n")
file2.flush()
file2.close()
##
## @brief Execute the command and ruturn generate data
##
@ -128,7 +90,7 @@ def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_
output = output.decode("utf-8")
err = err.decode("utf-8")
# store error if needed:
store_warning(store_output_file, output, err)
tools.store_warning(store_output_file, output, err)
# Check error :
if p.returncode == 0:
debug.debug(env.print_pretty(cmd_line))
@ -171,7 +133,7 @@ def run_command(cmd_line, store_cmd_line="", build_id=-1, file="", store_output_
return
debug.verbose("done 3")
# write cmd line only after to prevent errors ...
store_command(cmd_line, store_cmd_line)
tools.store_command(cmd_line, store_cmd_line)

View File

@ -14,7 +14,7 @@ import fnmatch
# Local import
from . import debug
from . import depend
import multiprocess
from . import env
"""
@ -106,7 +106,7 @@ def copy_file(src, dst, cmd_file=None, force=False):
debug.print_element("copy file", src, "==>", dst)
create_directory_of_file(dst)
shutil.copyfile(src, dst)
multiprocess.store_command(cmd_line, cmd_file)
store_command(cmd_line, cmd_file)
def copy_anything(src, dst):
@ -176,5 +176,42 @@ def move_if_needed(src, dst):
file_write_data(dst, src_data)
remove_file(src)
def store_command(cmd_line, file):
# write cmd line only after to prevent errors ...
if file == "" \
or file == None:
return;
debug.verbose("create cmd file: " + file)
# Create directory:
create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write(cmd_line)
file2.flush()
file2.close()
def store_warning(file, output, err):
# write warning line only after to prevent errors ...
if file == "" \
or file == None:
return;
if env.get_warning_mode() == False:
debug.verbose("remove warning file: " + file)
# remove file if exist...
remove_file(file);
return;
debug.verbose("create warning file: " + file)
# Create directory:
create_directory_of_file(file)
# Store the command Line:
file2 = open(file, "w")
file2.write("===== output =====\n")
file2.write(output)
file2.write("\n\n")
file2.write("===== error =====\n")
file2.write(err)
file2.write("\n\n")
file2.flush()
file2.close()

View File

@ -104,5 +104,5 @@ def link(file, binary, target, depancy, name, basic_folder):
stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)

View File

@ -65,7 +65,7 @@ def link(file, binary, target, depancy, name, basic_folder):
debug.print_element("jar", name, "==>", file_dst)
multiprocess.run_command(cmdLine, store_output_file=file_warning)
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)
#debug.print_element("SharedLib", self.name, "==>", tmpList[1])
return file_dst

View File

@ -97,6 +97,6 @@ def link(file, binary, target, depancy, name, basic_folder):
stripSize = tools.file_size(file_dst)
debug.debug("file reduce size : " + str(originSize/1024) + "ko ==> " + str(stripSize/1024) + "ko")
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)
#debug.print_element("SharedLib", self.name, "==>", tmpList[1])
return file_dst

View File

@ -78,5 +78,5 @@ def link(file, binary, target, depancy, name, basic_folder):
file_dst ])
multiprocess.run_command(cmdLineRanLib, store_output_file=file_warning)
# write cmd line only after to prevent errors ...
multiprocess.store_command(cmdLine, file_cmd)
tools.store_command(cmdLine, file_cmd)
return file_dst