Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion asu/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ def check_package_errors(stderr: str) -> str:
APK-CONFLICT-2:
conflicts: APK-CONFLICT-1[nftables=1.1.6-r1]
satisfies: world[nftables-nojson]

Case apk-3
ERROR: APK-CONFLICT-3: trying to overwrite somefile owned by APK-CONFLICT-4.
"""

# Grab the missing ones first, as that's easy.
Expand All @@ -423,11 +426,13 @@ def check_package_errors(stderr: str) -> str:
conflicts = findall(r"\n +([^:\n]+):\n +conflicts: ([^[]+)", stderr, DOTALL)
conflicts = set(item for pair in conflicts for item in pair)

# Case opkg-2 and opkg-3
# Case opkg-2, opkg-3, apk-3
conflicts.update(
findall(r"check_data_file_clashes: Package ([^ ]+) wants to", stderr)
+ findall(r"is already provided by package \* ([^ ]+)$", stderr, MULTILINE)
+ findall(r"\* check_conflicts_for:.+ ([^ ]+)(?: \*|:)$", stderr, MULTILINE)
+ findall(r"ERROR: ([^ ]+): trying to overwrite", stderr)
+ findall(r"trying to overwrite .* owned by ([^ ]+)\.", stderr)
)

# opkg reports missing and conflicts with same message, so clean that up.
Expand Down
5 changes: 3 additions & 2 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,9 @@ def test_check_package_errors():
check_package_errors(check_package_errors.__doc__)
== "Impossible package selection:"
" missing (APK-MISSING, OPKG-MISSING)"
" conflicts (APK-CONFLICT-1, APK-CONFLICT-2, OPKG-CONFLICT-1,"
" OPKG-CONFLICT-2, OPKG-CONFLICT-3, OPKG-CONFLICT-4)"
" conflicts"
" (APK-CONFLICT-1, APK-CONFLICT-2, APK-CONFLICT-3, APK-CONFLICT-4,"
" OPKG-CONFLICT-1, OPKG-CONFLICT-2, OPKG-CONFLICT-3, OPKG-CONFLICT-4)"
)


Expand Down
Loading