libretools.install 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/hint/bash
  2. ## arg 1: the new package version
  3. ## arg 2: the old package version
  4. post_upgrade() {
  5. librefetch-install remove etc/makepkg.conf
  6. # Now that we've reverted the change, automatically resolve
  7. # makepkg.conf.pacnew, if we can.
  8. if [[ -f etc/makepkg.conf && -f etc/makepkg.conf.pacnew ]]; then
  9. # remove a trailing newline--a likely remnant of merging .pacnew with the librefetch bit
  10. sed -i '${/^$/d}' etc/makepkg.conf
  11. local stock_sha256sum stock_sha256sums sha256sum
  12. # Let's go back 1 year (from 2018-08-26)
  13. stock_sha256sums=(
  14. # 5.0.2-2.parabola1 (2017-08-05) -- 5.0.2-2.parabola1.3 (2018-01-25)
  15. 9dd688519366f12a4386fc890f76c48b3f9d6defef4c2ed0b33e813667612f19 # armv7h
  16. 9e18db6242b8eb6ae6285a3ed7d975b3825ec3d25aecb1942c8ad4f98329398f # i686
  17. 166c69b1adafd5374c50fbd2e85b4c1d292fdf7e07b4b0151e2ebfd5bfcb37bd # x86_64
  18. # 5.0.2-2.parabola2 (2018-04-29) -- 5.0.2-3.parabola1 (2018-05-11)
  19. 055e4425b293e505701e8fbe7bde3c9b22797ddcde061e0bafda126d956764c2 # armv7h
  20. 616c87d521368de328e7d1498e819dd9b834601bca6077a99b3f0df73b6a6a7c # i686
  21. 013a073181ef2f958e22b6fb4083744473291e338f0aa18823439efd49052332 # x86_64
  22. # 5.1.0-1.parabola1 (2018-05-29)
  23. 9e41020da19521777fc783123732ffef8e860ca377905896cbefe5a167f37410 # armv7h
  24. 3b46c6a51af00d822892dd8103e2b2657e17ad1e1043b87ca8bed8b965d61fb1 # i686
  25. 0bc5faf94f535504f12853ad5704a464ae80b6e9febd19a08070c66329a55135 # x86_64
  26. # 5.1.0-2.parabola1 (2018-06-23) -- 5.1.1-1.parabola3 (2018-08-07)
  27. 45cf2da36894a71c6054bf4d3b822e3d55816de69b2f4eae6ea2c055d7ac0f29 # armv7h
  28. c3b0d878aeebff2cca9390deb730883c856922035f60b07fc683a06267dee050 # i686
  29. 509568f5d12dd7e82a9e42a7e43b444d72b7cd49b9c8b7cc372025c0fcf3703b # x86_64
  30. # 5.1.1-1.parabola4 (2018-08-26) --
  31. b461585848d187b6bd6fcdc3774d46cf22574a5dc28ccd10421b0e824cd4916f # armv7h
  32. 4bb5d938f7da8e7575bf85804eee4b752fe39ca92a4dd9407fe97d867289082c # i686
  33. 6d94554dab59489ce6d7f60909e6828f0eb63435919f7890aec165965ea3187a # x86_64
  34. )
  35. read sha256sum _ < <(sha256sum etc/makepkg.conf)
  36. for stock_sha256sum in "${stock_sha256sums[@]}"; do
  37. if [[ $sha256sum = "$stock_sha256sum" ]]; then
  38. mv -fTv etc/makepkg.conf.pacnew etc/makepkg.conf
  39. break
  40. fi
  41. done
  42. fi
  43. }