diff_rpms.sh 705 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # Compares 2 RPMs
  3. set -e
  4. if [ -z $2 ]
  5. then
  6. echo "Usage: $0 RPM1 RPM2"
  7. exit
  8. fi
  9. rpm1=$(realpath $1)
  10. rpm2=$(realpath $2)
  11. TMPDIR=$(mktemp -d)
  12. pushd "$TMPDIR"
  13. mkdir rpm1
  14. cd rpm1
  15. rpm2cpio $rpm1 | cpio -idm
  16. rpm -qp $rpm1 --scripts > scripts.txt
  17. rpm -qp --qf "Name : %{name}
  18. License : %{license}
  19. URL : %{url}
  20. Summary : %{summary}
  21. Description : %{description}
  22. " $rpm1 > info.txt
  23. cd ..
  24. mkdir rpm2
  25. cd rpm2
  26. rpm2cpio $rpm2 | cpio -idm
  27. rpm -qp $rpm2 --scripts > scripts.txt
  28. rpm -qp --qf "Name : %{name}
  29. License : %{license}
  30. URL : %{url}
  31. Summary : %{summary}
  32. Description : %{description}
  33. " $rpm2 > info.txt
  34. cd ..
  35. meld rpm1 rpm2
  36. popd
  37. \rm -rv "$TMPDIR"