[oe] [PATCH 1/1] distribute_license: added class to copy license files
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Fri Jul 30 07:57:31 UTC 2010
On Thu, Jul 29, 2010 at 04:46:55PM -0500, Maupin, Chase wrote:
>> >+ set -f
>>
>> hush: set: -f: invalid option
>
>I thought bash was the standard shell for working with OE. Is that wrong?
You're right, it is (and -f is a mandatory flag so disregard this,
sorry)
>> >+ res=`find . -maxdepth ${LICENSE_SEARCH_DEPTH} -name "$lic"`
>> >+ if [ "$res" != "" ]
>>
>> breaks on older test(1) impls that don't handle empty strings properly.
>> Could be that this one is moot by now though.
>
>So did this break for you? I've never seen this issue.
[ -n "$res" ]
>
>>
>> >+ then
>> >+ mkdir -p ${DEPLOY_DIR}/licenses/${PN}
>> >+ cp $res ${DEPLOY_DIR}/licenses/${PN}
>>
>> install -D ${DEPLOY_DIR}/licenses/${PN} ${DEPLOY_DIR}/licenses/${PN}
>
>I'll change this
typo of mine: the first non-option argument should have been $res, of
course.
essentially you mean (if you say it in sh)
set -f
for lic in ${LICENSE_FILES}
do
find ${S} -maxdepth ${LICENSE_SEARCH_DEPTH} -name "$lic" | \
while read f
do
bn=$(basename $f)
if [ -r ${DEPLOY_DIR}/licenses/${PN}/$bn ]; then
# we could have used $d.$bn for per-dir licenses
# d=$(echo $f | sed -e "s|${S}||" -e normalize-and-convert-slashes-to-underscore)
echo "ERROR: possibly conflicting licenses"
exit 1
fi
install -D $f ${DEPLOY_DIR}/licenses/${PN}/$bn
done
done
set +f
This leaves you with just one non-standard hunk: -maxdepth
Given that both findutils as well as busybox support -maxdepth i would
not bother much.
Just a thought.. your initial version may be sufficient for most
practical reasons.
cheers,
More information about the Openembedded-devel
mailing list