File: patch-to-news

package info (click to toggle)
emacs24-non-dfsg 24.5%2B1-2
  • links: PTS
  • area: non-free
  • in suites: stretch
  • size: 15,768 kB
  • ctags: 32
  • sloc: makefile: 1,293; lisp: 72; sh: 54
file content (23 lines) | stat: -rwxr-xr-x 481 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

set -eo pipefail

patch="$1"

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)"