Files
tqma6-yocto-mirror/sources/poky/meta/lib/oeqa/utils/ftools.py
Siggi (OpenClaw Agent) 16accb6b24 Complete Yocto mirror with license table for TQMa6UL (2038-compliance)
- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
2026-03-01 21:14:11 +00:00

53 lines
1.1 KiB
Python

#
# Copyright OpenEmbedded Contributors
#
# SPDX-License-Identifier: MIT
#
import os
import re
import errno
def write_file(path, data):
# In case data is None, return immediately
if data is None:
return
wdata = data.rstrip() + "\n"
with open(path, "w") as f:
f.write(wdata)
def append_file(path, data):
# In case data is None, return immediately
if data is None:
return
wdata = data.rstrip() + "\n"
with open(path, "a") as f:
f.write(wdata)
def read_file(path):
data = None
with open(path) as f:
data = f.read()
return data
def remove_from_file(path, data):
# In case data is None, return immediately
if data is None:
return
try:
rdata = read_file(path)
except IOError as e:
# if file does not exit, just quit, otherwise raise an exception
if e.errno == errno.ENOENT:
return
else:
raise
contents = rdata.strip().splitlines()
for r in data.strip().splitlines():
try:
contents.remove(r)
except ValueError:
pass
write_file(path, "\n".join(contents))