Files
RedBear-OS/recipes/dev/python312/source/Tools/c-analyzer/c_common/strutil.py
T
vasilito ff4ff35918 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

43 lines
1.3 KiB
Python

import logging
logger = logging.getLogger(__name__)
def unrepr(value):
raise NotImplementedError
def parse_entries(entries, *, ignoresep=None):
for entry in entries:
if ignoresep and ignoresep in entry:
subentries = [entry]
else:
subentries = entry.strip().replace(',', ' ').split()
for item in subentries:
if item.startswith('+'):
filename = item[1:]
try:
infile = open(filename)
except FileNotFoundError:
logger.debug(f'ignored in parse_entries(): +{filename}')
return
with infile:
# We read the entire file here to ensure the file
# gets closed sooner rather than later. Note that
# the file would stay open if this iterator is never
# exhausted.
lines = infile.read().splitlines()
for line in _iter_significant_lines(lines):
yield line, filename
else:
yield item, None
def _iter_significant_lines(lines):
for line in lines:
line = line.partition('#')[0]
if not line.strip():
continue
yield line