-
- #!/bin/sh
-
- # Can be used to find which recent software install might have caused dependencies to collide.
- # Pass the colliding dependencies names as the first and second argument of the script.
- # Example: ./find_collide_suspects.sh xdg-mime-database shared-mime-info
-
- colliding_dep_a="$1"
- colliding_dep_b="$2"
-
- last_installed_packages="$(guix package -I | awk '{print $1}' | tac)"
-
- is_using_dep() {
- # Arg1: package name
- # Arg2: dependency name
- if guix graph "$1" | grep -q "$2"; then
- echo "Package $1 depends on $2."
- return 0
- else
- return 1
- fi
- }
-
-
- for package in $last_installed_packages; do
- is_using_dep $package $colliding_dep_a
- is_using_dep $package $colliding_dep_b
- done
-
- # Example guix error:
- #
- # guix graph: error: scm_flush: Broken pipe
- # Backtrace:
- # In unknown file:
- # ?: 2 [apply-smob/1 #<catch-closure d66920> quit 1]
- # In ice-9/boot-9.scm:
- # 157: 1 [catch #t #<catch-closure 4123640> ...]
- # In unknown file:
- # ?: 0 [apply-smob/1 #<catch-closure 4123640>]
-
- # ERROR: In procedure apply-smob/1:
- # ERROR: In procedure scm_flush: Broken pipe
-