summaryrefslogtreecommitdiff
path: root/openttd-git/update-patches
blob: 02811856fbd2054766d8061b331ee6f7a934889a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

cd "$(dirname "$0")"
eval "$(
  sed -n '
    /^source=(/,/)/ p
  ' PKGBUILD
)"

git -C openttd-git fetch local
git -C openttd-git fetch --all -p

printf '%s\n' "${source[@]}" \
  | sed '
    s/\.patch$//
    t
    d
  ' \
  | while read -r patch; do
    git -C openttd-git diff master "remotes/local/${patch}" -- \
      > "${patch}.patch"
  done