patch-to-news 471 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. set -e
  3. patch="$1"
  4. sed '
  5. # delete everything after the first line starting with "--- " (the diff)
  6. /^--- [^ ]/,$d' < "$patch" \
  7. | tac \
  8. | sed '
  9. # delete everything up to the first line containing only "---" (the diffstat)
  10. 1,/^---$/d' \
  11. | tac \
  12. | sed '
  13. # delete everything before the first blank line (git summary line)
  14. 1,/^$/d' \
  15. | sed '
  16. # convert to our README.Debian NEWS format
  17. 1 s/^/* /
  18. 2,$ s/^/ /'
  19. echo " Patch: $(basename $patch)"