Files
qt-migration-legatus/qt5-before/dlbo/Lts/Tools/Niklas-Excon-Helper/local.py
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

142 lines
4.9 KiB
Python
Executable File

import subprocess
from sys import stderr
from utils import console, get_error_console
def getConfigParam(lines, config_id):
value = None
for line in lines:
line = line.strip()
if not line or line.startswith('#') or line.startswith(';'):
continue
if '=' in line:
key, val = line.split('=', 1)
key = key.strip()
if key == config_id:
value = val
break
return value
def checkLocalConfig(config_id):
try:
with open('/etc/lts-cc.conf', 'r', encoding="utf-8") as file:
return getConfigParam(file.readlines(), config_id)
except FileNotFoundError:
print("Can not find lts-cc.conf")
def extractDatabases(output):
lines = output.splitlines()
databases = []
capture = False
for line in lines:
line = line.strip()
if line.startswith("Name"):
capture = True
continue
if capture:
if line.startswith("----"):
continue
if line.strip() == "":
continue
name = line.split('|')[0].strip()
if name != "":
databases.append(name)
return databases
def parseDiskUsage(output):
lines = output.split("\n")
disk_usage = []
for line in lines[1:]:
parts = line.split()
if len(parts) < 6:
continue
percent_used = int(parts[4].replace("%", ""))
mountpoint = parts[5]
disk_usage.append({
'percent_used': percent_used, 'mountpoint': mountpoint
})
return disk_usage
def add_branch( svn_url):
branch_name = svn_url.rstrip('/').split('/')[-1]
stderr_source = subprocess.run(['mkdir', f'/shd/CTC/TOOLS/TDS/source-{branch_name}'], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
if stderr_source.returncode:
get_error_console().log(f"Cant create source folder: {stderr_source}")
return False
stderr_build = subprocess.run(['mkdir', f'/shd/CTC/TOOLS/TDS/build-{branch_name}'],stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
if stderr_build.returncode:
get_error_console().log(f"Cant create build folder: {stderr_build}")
return False
stderr_co = subprocess.run(['svn', 'co', f'{svn_url}', f'/shd/CTC/TOOLS/TDS/source-{branch_name}'], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
if stderr_co.returncode:
get_error_console().log(f"Cant checkout branch: {stderr_co}")
return False
return branch_name
def build_branch(branch_name, project_name, guez_mode, build_ws, build_sv, build_hla):
command = ['cmake', '-G', 'Ninja', f'/shd/CTC/TOOLS/TDS/source-{branch_name}']
if guez_mode:
command.append( "-DGUEZ_MODE=ON")
else:
command.append( "-DGUEZ_MODE=OFF")
command.append("-DBUILD_TOOLSSV=ON")
command.append("-DBUILD_WLS=ON")
if build_ws:
command.append("-DBUILD_WS=ON")
else:
command.append("-DBUILD_WS=OFF")
command.append("-DBUILD_AAR=OFF")
if build_hla:
command.append("-DBUILD_SVC_HLA=ON")
else:
command.append("-DBUILD_SVC_HLA=OFF")
if build_sv:
command.append("-DBUILD_SV=ON")
else:
command.append("-DBUILD_SV=OFF")
command.append( f'-D_pname={project_name}')
command.append( "-DCMAKE_BUILD_TYPE=RelWithDebInfo")
command.append("-B")
command.append(f"/shd/CTC/TOOLS/TDS/build-{branch_name}")
stderr_configure = subprocess.run(command, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
if stderr_configure.returncode:
get_error_console().log(f"Cant configure branch: {stderr_configure.stderr}")
return False
stderr_build = subprocess.run(['ninja'], cwd=f'/shd/CTC/TOOLS/TDS/build-{branch_name}', stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
if stderr_build.returncode:
get_error_console().log(f"Cant build branch: {stderr_build}")
return False
return True
def build_test_db(branch_name):
stderr = subprocess.run(['ninja', 'test-db'], cwd=f'/shd/CTC/TOOLS/TDS/build-{branch_name}', stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
if stderr.returncode:
get_error_console().log(f"Cant build test-db: {stderr}")
def check_rpm_package_installed(package_prefix):
try:
result = subprocess.run(['rpm', '-qa', package_prefix], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if result.returncode:
get_error_console().log(f"Package {package_prefix} not installed: {stderr}")
return False
installed_packages = result.stdout.splitlines()
matching_packages = [package for package in installed_packages if package.startswith(package_prefix)]
if matching_packages:
return True
else:
return False
except Exception as e:
return False