16 lines
270 B
Bash
Executable File
16 lines
270 B
Bash
Executable File
#! /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 '- *'
|