File: patch-to-news

package info (click to toggle)
emacs-non-dfsg 1%3A27.1%2B1-2
  • links: PTS
  • area: non-free
  • in suites: bullseye
  • size: 23,308 kB
  • sloc: makefile: 726; sh: 55
file content (25 lines) | stat: -rwxr-xr-x 502 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

set -eo pipefail

for patch in "$@"; do

  sed '
  # delete everything after the first line starting with "--- " (the diff)
  /^--- [^ ]/,$d' < "$patch" \
| tac \
| sed '
  # delete everything up to the first line containing only "---" (the diffstat)
  1,/^---$/d' \
| tac \
| sed '
  # delete everything before the first blank line (git summary line)
  1,/^$/d' \
| sed '
  # convert to our README.Debian NEWS format
  1 s/^/* /
  2,$ s/^/  /'

  echo "  Patch: $(basename $patch)"

done