Commit 9f23a458 authored by Basil Eljuse's avatar Basil Eljuse
Browse files

Merge branch 'saul-romero-arm-master-patch-06812' into 'master'

Bugfix for translation in merge reports

See merge request !9
parents 83f58224 6c40b24c
......@@ -129,16 +129,17 @@ if options.local_workspace is not None:
info_files_to_merge[i]))
info_lines = info_file.readlines()
info_file.close()
common_prefix = os.path.normpath(
os.path.commonprefix([line[3:] for line in info_lines
if 'SF:' in line]))
temp_file = 'temporary_' + str(i) + '.info'
parts = None
with open(temp_file, "w+") as f:
for line in info_lines:
cf = common_prefix
if os.path.basename(common_prefix) in file_groups[i]["locations"]:
cf = os.path.dirname(common_prefix)
f.write(line.replace(cf, options.local_workspace))
if "SF" in line:
for location in file_groups[i]["locations"]:
if location in line:
parts = line[3:].partition(location)
line = line.replace(parts[0], options.local_workspace + "/")
break
f.write(line)
info_files_to_merge[i] = temp_file # Replace info file to be merged
i += 1
......
......@@ -13,7 +13,7 @@
# files.
#==============================================================================
set -e
set +x
#################################################################
# Function to manipulate json objects.
# The json object properties can be accessed through "." separated
......@@ -127,7 +127,7 @@ try:
except Exception as ex:
print(ex)
EOT
cd -
cd -
}
#################################################################
......@@ -161,7 +161,7 @@ get_file() {
fname="$where.$extension" # Same filename as folder
rm $where/$fname &>/dev/null || true
wget -o error.log $_origin -O $where/$fname || (
cat error.log && exit -1)
cat error.log && exit -1)
cloned_file="$(get_abs_path $where/$fname)"
elif [ "$_type" = '"bundle"' ];then
# Check file exists at origin, i.e. was unbundled before
......@@ -170,10 +170,10 @@ get_file() {
cloned_file="$(get_abs_path $where/$fname)"
fi
elif [ "$_type" = '"file"' ];then
if [[ "$_origin" = http* ]]; then
echo "$_origin looks like 'http' rather than 'file' please check..."
exit -1
fi
if [[ "$_origin" = http* ]]; then
echo "$_origin looks like 'http' rather than 'file' please check..."
exit -1
fi
fname="$where.$extension" # Same filename as folder
cp -f $_origin $where/$fname
cloned_file="$(get_abs_path $where/$fname)"
......@@ -395,8 +395,8 @@ if [ -z "$merge_input_json_file" ]; then
exit -1
fi
if [ -z "$LOCAL_WORKSPACE" ] && [ $CLONE_SOURCES = true ]; then
echo "Need to define a local workspace folder to clone/copy sources!"
exit -1
echo "Need to define a local workspace folder to clone/copy sources!"
exit -1
fi
# Getting the script folder where other script files must reside, i.e
# merge.py, clone_sources.py
......@@ -409,7 +409,7 @@ param_cloned=""
get_info_json_files
merge_files
if [ $CLONE_SOURCES = true ];then
clone_repos $output_json_file
clone_repos $output_json_file
fi
# Generate branch coverage report
genhtml --branch-coverage $output_coverage_file \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment