diff options
author | John Rigby <john.rigby@linaro.org> | 2010-09-03 00:03:56 -0600 |
---|---|---|
committer | John Fredriksson <john.xj.fredriksson@stericsson.com> | 2011-10-19 15:16:44 +0200 |
commit | 416cf007581a06a08e7b4c2f9100fbc2437b48d8 (patch) | |
tree | 3ba3970c9f2500a47ee899d9385ca6711b1fe46a /debian/scripts/module-inclusion | |
parent | 4bfaf5b8b51ceb9168dd9014fd9fbae0b97b7eeb (diff) |
LINARO: Add generic linaro packaging
Signed-off-by: John Rigby <john.rigby@linaro.org>
Diffstat (limited to 'debian/scripts/module-inclusion')
-rwxr-xr-x | debian/scripts/module-inclusion | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/debian/scripts/module-inclusion b/debian/scripts/module-inclusion new file mode 100755 index 00000000000..310b1a7adde --- /dev/null +++ b/debian/scripts/module-inclusion @@ -0,0 +1,50 @@ +#!/bin/bash + +# +# Build a new directory of modules based on an inclusion list. +# The includsion list format must be a bash regular expression. +# +# usage: $0 ROOT INCLUSION_LIST +# example: $0 debian/build/build-virtual debian.linaro/control.d/virtual.inclusion-list +ROOT=$1 +ILIST=$2 + +NROOT=${ROOT}.new + +# +# Prep a destination directory. +# +mkdir -p ${NROOT} +rsync -a --exclude="*.ko" ${ROOT}/ ${NROOT} + +cat ${ILIST} |while read i +do + # + # 'find' blurts a warning if it cannot find any ko files. + # + if echo "$i" | grep '\*' > /dev/null + then + (cd ${ROOT}; eval find "${i}" -name "*.ko") |while read f + do + mkdir -p ${NROOT}/`dirname $f` + cp ${ROOT}/$f ${NROOT}/$f + done + else + if [ -f "${ROOT}/$i" ] + then + mkdir -p ${NROOT}/`dirname $i` + cp ${ROOT}/$i ${NROOT}/$i + else + echo Warning: Could not find ${ROOT}/$i + fi + fi + +done + +# +# Cleanup +# +rm -rf ${ROOT} +mv ${NROOT} ${ROOT} + +exit 0 |