You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pacnews 428B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. #
  3. # pbrisbin 2013 - find pacnew files and present for processing.
  4. #
  5. ###
  6. if (( UID )); then
  7. printf "You must be root.\n" >&2
  8. exit 1
  9. fi
  10. shopt -s globstar nullglob
  11. set -- "${1:-/etc}"/**/*.pacnew
  12. (( $# )) || exit 1
  13. for file; do
  14. current="${file/.pacnew/}"
  15. ${DIFFTOOL:-vimdiff} "$current" "$file"
  16. rm -iv "$file" # -i gets us prompting for free
  17. [[ -f "$file" ]] && mv -iv "$file" "$current"
  18. done