summaryrefslogtreecommitdiff
path: root/tools/list_files.sh
blob: b1125e341192932c9fa34c65adea0c77e2a3d67f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/sh
# Script to list all files, for making tarballs.

set -e
if [ $# -eq 0 ]; then
    echo Usage: list_files.sh '<ccandir>...' >&2
    exit 1
fi

for d; do
    # git ls-files recurses, but we want ignores correct :(
    for f in `git ls-files $d | sed "s,^\($d/[^/]*\)/.*,\1," | uniq`; do
        # Include subdirs, unless it's a separate module.
	if [ -d "$f" ]; then
	    if [ ! -f "$f"/_info ]; then
		$0 "$f"
	    fi
	else
	    echo "$f"
	fi
    done
done