diff options
Diffstat (limited to 'dts/scripts/index-filter.sh')
-rwxr-xr-x | dts/scripts/index-filter.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dts/scripts/index-filter.sh b/dts/scripts/index-filter.sh new file mode 100755 index 0000000000..e672867ce3 --- /dev/null +++ b/dts/scripts/index-filter.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e +set -o pipefail + +crumbs=/tmp/device-tree-export +git ls-files -s | tee $crumbs-orig | \ + ${SCRIPTS}/flatten-symlinks.sh | tee $crumbs-flattened | \ + sed -n -f ${SCRIPTS}/rewrite-paths.sed | tee $crumbs-rewritten | \ + GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info + +if [ -f "$GIT_INDEX_FILE.new" ] ; then + mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE" +else + rm "$GIT_INDEX_FILE" +fi + +exit 0 |