summaryrefslogtreecommitdiffstats
path: root/bin/make-rsync-whitelist
blob: a1b09c8010d41c19cf7f421046a409427a68113c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /bin/sh
# make-rsync-whitelist : lines relpath |> liens rsync-filter
set -euf

set -- "$(cat)"

# include all files in stdin and their directories
{
  echo "$1"
  echo "$1" | make-parent-dirs | sort | uniq
} \
  | sed 's|^|+ /|'

# exclude everything else
echo '- *'