diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-03-09 20:38:49 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-03-10 12:09:05 +0100 |
commit | aeb10121af5acfad18e2cb45b51b756dee00d76d (patch) | |
tree | 5a76308516364252b9eb5feda8e961ce483d3b45 | |
parent | 6529d0e8f6a630c20831a18ea87550344bfb85ab (diff) | |
download | ptxdist-aeb10121af5acfad18e2cb45b51b756dee00d76d.tar.gz ptxdist-aeb10121af5acfad18e2cb45b51b756dee00d76d.tar.xz |
scripts: add ptxd_filter_dir
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | scripts/libptxdist.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh index 76c379150..8a379f134 100644 --- a/scripts/libptxdist.sh +++ b/scripts/libptxdist.sh @@ -410,6 +410,42 @@ export -f ptxd_replace_magic # +# +# +ptxd_filter_dir() { + local srcdir="${1}" + local dstdir="${2}" + local src dst + + [ -d "${srcdir}" ] || return + [ -n "${dstdir}" ] || return + + mkdir -p "${dstdir}" && + + tar -C "${srcdir}" -c . \ + --exclude .svn \ + --exclude .pc \ + --exclude .git \ + --exclude "*.in" \ + --exclude "*.in.*" \ + --exclude "*/*~" \ + | tar -C "${dstdir}" -x + check_pipe_status || return + + { + find "${srcdir}" -name "*.in" + find "${srcdir}" -name "*.in${PTXDIST_PLATFORMSUFFIX}" + } | while read src; do + dst="${src/#${srcdir}/${dstdir}/}" + dst="${dst%.in}" + ptxd_replace_magic "${src}" > "${dst}" || return + done +} +export -f ptxd_filter_dir + + + +# # returns the concatination of two variables, # the seperator can be specified, space is default # |