spacepaste

  1.  
  2. #!/bin/sh
  3. # Can be used to find which recent software install might have caused dependencies to collide.
  4. # Pass the colliding dependencies names as the first and second argument of the script.
  5. # Example: ./find_collide_suspects.sh xdg-mime-database shared-mime-info
  6. colliding_dep_a="$1"
  7. colliding_dep_b="$2"
  8. last_installed_packages="$(guix package -I | awk '{print $1}' | tac)"
  9. is_using_dep() {
  10. # Arg1: package name
  11. # Arg2: dependency name
  12. if guix graph "$1" | grep -q "$2"; then
  13. echo "Package $1 depends on $2."
  14. return 0
  15. else
  16. return 1
  17. fi
  18. }
  19. for package in $last_installed_packages; do
  20. is_using_dep $package $colliding_dep_a
  21. is_using_dep $package $colliding_dep_b
  22. done
  23. # Example guix error:
  24. #
  25. # guix graph: error: scm_flush: Broken pipe
  26. # Backtrace:
  27. # In unknown file:
  28. # ?: 2 [apply-smob/1 #<catch-closure d66920> quit 1]
  29. # In ice-9/boot-9.scm:
  30. # 157: 1 [catch #t #<catch-closure 4123640> ...]
  31. # In unknown file:
  32. # ?: 0 [apply-smob/1 #<catch-closure 4123640>]
  33. # ERROR: In procedure apply-smob/1:
  34. # ERROR: In procedure scm_flush: Broken pipe
  35.