From 5daa5e91ad076bee7338beef65b7a371bd195012 Mon Sep 17 00:00:00 2001 From: Lukas Greve Date: Sun, 15 Feb 2026 19:33:42 +0100 Subject: [PATCH] new dumb script --- ingredients/python-update-package-names.py | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ingredients/python-update-package-names.py diff --git a/ingredients/python-update-package-names.py b/ingredients/python-update-package-names.py new file mode 100644 index 0000000..db319ef --- /dev/null +++ b/ingredients/python-update-package-names.py @@ -0,0 +1,42 @@ +import subprocess +import re + +# Get all package names from your config file +packages = [] +with open('core-packages-hardware-support.cfg', 'r') as f: + for line in f: + if line.strip() and not line.startswith('#') and '#' not in line: + # Extract package name (everything before the first space or #) + package = line.strip().split('#')[0].strip() + if package and not package.startswith('%'): + packages.append(package) + +# Get summaries using dnf info +summaries = {} +for package in packages: + try: + result = subprocess.run(['dnf', 'info', package], + capture_output=True, text=True, timeout=30) + if result.returncode == 0: + # Extract summary line + summary_match = re.search(r'Summary\s*:\s*(.+)', result.stdout) + if summary_match: + summaries[package] = summary_match.group(1).strip() + except Exception as e: + print(f"Error getting info for {package}: {e}") + +# Now you can generate your updated package list with summaries +with open('core-packages-hardware-support.cfg', 'r') as f: + lines = f.readlines() + +new_lines = [] +for line in lines: + if line.strip() and not line.startswith('#') and not line.startswith('%'): + package = line.strip().split('#')[0].strip() + if package in summaries: + line = f"{package} # {summaries[package]}\n" + new_lines.append(line) + +# Write back to file (or save as new file) +with open('updated-packages.cfg', 'w') as f: + f.writelines(new_lines)