Files
qt-migration-legatus/qt5-before/dlbo/Lts/Tools/Niklas-Excon-Helper/initiate.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

177 lines
5.4 KiB
Python
Executable File

import os.path
import shutil
import subprocess
import sys
import stat
from prompt_toolkit import prompt
import settings
from local import check_rpm_package_installed
from network import is_reachable, check_ssh_credentials
def initiate():
root_pass = prompt("Local root password:")
install_self(root_pass)
if autoinit(root_pass):
return
settings_dict = dict()
tds = prompt("Address of TDS (Standard is EXCTDS01):")
if tds == "":
tds = "EXCTDS01"
settings_dict["tds"] = tds
if tds != "localhost":
tds_user = prompt("TDS Username (Standard is ctc):")
if tds_user == "":
tds_user = "ctc"
settings_dict["tds_user"] = tds_user
tds_pass = prompt("TDS Password (Standard is ctc11de):")
if tds_pass == "":
tds_pass = "ctc11de"
settings_dict["tds_pass"] = tds_pass
ws = prompt("Address of WS (Standard is localhost):")
if ws == "":
ws = "localhost"
settings_dict["ws"] = ws
if ws != "localhost":
ws_user = prompt("WS Username (Standard is ctc):")
if ws_user == "":
ws_user = "ctc"
settings_dict["ws_user"] = ws_user
ws_pass = prompt("WS Password (Standard is ctc11de):")
if ws_pass == "":
ws_pass = "ctc11de"
settings_dict["ws_pass"] = ws_pass
dbs = prompt("Address of DBS (Standard is EXCDBS01):")
if dbs == "":
dbs = "EXCDBS01"
settings_dict["dbs"] = dbs
if dbs != "localhost":
dbs_user = prompt("DBS Username (Standard is postgres):")
if dbs_user == "":
dbs_user = "postgres"
settings_dict["dbs_user"] = dbs_user
dbs_pass = prompt("DBS Password (Standard is postgres):")
if dbs_pass == "":
dbs_pass = "postgres"
settings_dict["dbs_pass"] = dbs_pass
avs = prompt("Address of AVS (Standard is EXCDAVS01):")
if avs == "":
avs = "EXCAVS01"
settings_dict["avs"] = avs
if avs != "localhost":
avs_user = prompt("AVS Username (Standard is ctc):")
if avs_user == "":
avs_user = "ctc"
settings_dict["avs_user"] = avs_user
avs_pass = prompt("AVS Password (Standard is ctc11de):")
if avs_pass == "":
avs_pass = "ctc11de"
settings_dict["avs_pass"] = avs_pass
build = prompt("Is the software installed over rpm? (y/n):")
if build == "y":
aws = prompt("Admin Workstation Address (Standard is CCSAWS01):")
if aws == "":
aws = "CCSAWS01"
settings_dict["aws"] = aws
settings_dict["rpm"] = True
else:
settings_dict["rpm"] = False
settings.save_settings(settings_dict, root_pass)
print("Erfolgreich gespeichert!")
def autoinit(root_pass):
settings_dict = dict()
if is_reachable("EXCTDS01", False):
tds = "EXCTDS01"
if check_ssh_credentials(tds, "ctc", "ctc11de"):
tds_user = "ctc"
tds_pass = "ctc11de"
settings_dict["tds_user"] = tds_user
settings_dict["tds_pass"] = tds_pass
else:
print("Auto Init failed. Please enter the credentials manually.")
return False
else:
tds = "localhost"
settings_dict["tds"] = tds
if is_reachable("EXCDBS01", False):
dbs = "EXCDBS01"
if check_ssh_credentials(dbs, "postgres", "postgres"):
settings_dict["dbs_user"] = "postgres"
settings_dict["dbs_pass"] = "postgres"
else:
print("Auto Init failed. Please enter the credentials manually.")
return False
else:
dbs = "localhost"
settings_dict["dbs"] = dbs
settings_dict["ws"] = "localhost"
settings_dict["ws_user"] = "ctc"
settings_dict["ws_pass"] = "ctc11de"
if is_reachable("EXCAVS01", False):
settings_dict["avs"] = "EXCAVS01"
if check_ssh_credentials("EXCAVS01", "ctc", "ctc11de"):
settings_dict["avs_user"] = "ctc"
settings_dict["avs_pass"] = "ctc11de"
else:
print("Auto Init failed. Please enter the credentials manually.")
return False
if check_rpm_package_installed('guez_ws'):
if is_reachable("CCSAWS01", False):
aws = "CCSAWS01"
if check_ssh_credentials(aws, "root", "!Moutde"):
settings_dict["aws"] = aws
settings_dict["aws_user"] = "root"
settings_dict["aws_pass"] = "!Moutde"
settings_dict["rpm"] = True
else:
print("Auto Init failed. Please enter the credentials manually.")
return False
else:
print("Auto Init failed. Please enter the credentials manually.")
return False
else:
settings_dict["rpm"] = False
settings.save_settings(settings_dict, root_pass)
def install_self(root_pass):
target_bin_path = f"/usr/local/bin/excon"
try:
# Kopiere die Datei nach /usr/local/bin mit sudo
subprocess.run(f"echo {root_pass} | sudo -S cp {sys.executable} {target_bin_path}", shell=True, check=True)
# Setze die Ausführberechtigung für die Datei
subprocess.run(f"echo {root_pass} | sudo -S chmod +x {target_bin_path}", shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Fehler beim Kopieren der Datei nach '/usr/local/bin': {e}")
except Exception as e:
print(f"Unbekannter Fehler: {e}")