Commit 8789d515 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Tim Gardner

UBUNTU: [Debian] module-inclusion -- commonise copy code and simplify

Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent c1c60129
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# The includsion list format must be a bash regular expression. # The includsion list format must be a bash regular expression.
# #
# usage: $0 ROOT INCLUSION_LIST # usage: $0 ROOT INCLUSION_LIST
# example: $0 debian/build/build-virtual \ # example: $0 \
# debian/build/build-virtual-ALL debian/build/build-virtual \ # debian/build/build-virtual-ALL debian/build/build-virtual \
# debian.master/control.d/virtual.inclusion-list # debian.master/control.d/virtual.inclusion-list
master=0 master=0
...@@ -23,38 +23,44 @@ ILIST=$3 ...@@ -23,38 +23,44 @@ ILIST=$3
# #
mkdir -p ${NROOT} mkdir -p ${NROOT}
# Copy over the framework... {
if [ "$master" -eq 1 ]; then # Copy over the framework into the master package.
(cd ${ROOT}; find . ! -name "*.ko" -type f) | \ if [ "$master" -eq 1 ]; then
while read f (cd ${ROOT}; find . ! -name "*.ko" -type f)
do fi
mkdir -p ${NROOT}/`dirname $f`
mv ${ROOT}/$f ${NROOT}/$f
done
fi
cat ${ILIST} |while read i # Copy over modules by name or pattern.
do while read i
do
# #
# 'find' blurts a warning if it cannot find any ko files. # 'find' blurts a warning if it cannot find any ko files.
# #
if echo "$i" | grep '\*' > /dev/null case "$i" in
then *\**)
(cd ${ROOT}; eval find "${i}" -name "*.ko") |while read f (cd ${ROOT}; eval find "${i}" -name "*.ko" || true)
do ;;
mkdir -p ${NROOT}/`dirname $f` *)
mv ${ROOT}/$f ${NROOT}/$f echo "$i"
done ;;
else esac
if [ -f "${ROOT}/$i" ] done <"${ILIST}"
then # Copy over the listed modules.
mkdir -p ${NROOT}/`dirname $i` } | \
mv ${ROOT}/$i ${NROOT}/$i while read i
do
# If this is already moved over, all is good.
if [ -f "${NROOT}/$i" ]; then
:
# If present in the source, moved it over.
elif [ -f "${ROOT}/$i" ]; then
mkdir -p "${NROOT}/`dirname $i`"
mv "${ROOT}/$i" "${NROOT}/$i"
# Otherwise, it is missing.
else else
echo Warning: Could not find ${ROOT}/$i echo "Warning: Could not find ${ROOT}/$i" 1>&2
fi
fi fi
done done
exit 0 exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment