Skip to content

Commit 58870aa

Browse files
quaresmajosericardosalveti
authored andcommitted
lmp/build: add support for collecting duplicated sources
On multiconfig machines the sources and the license can be duplicated. We have two places with the source-code and licenses on the ti bsp [1]. If it was the case we will deploy only one package, we will search for the first package license path and use that. We can also escape and jump this source-code collecting step when we not have any IMAGE_MANIFESTS (i.e no image produced). [1] https://github.com/foundriesio/meta-lmp/blob/7657b41046ff745ce5fe61a64f615623ebb098e0/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc#L457-L459 Signed-off-by: Jose Quaresma <[email protected]>
1 parent 00eff72 commit 58870aa

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

lmp/build.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ done
114114

115115
# Generate a tarball containing the source code of *GPL* packages (based on yocto dev-manual)
116116
DEPLOY_SOURCES="${DEPLOY_DIR_IMAGE}/source-release"
117-
if [ -d ${DEPLOY_DIR}/sources ]; then
117+
if [ -d ${DEPLOY_DIR}/sources ] && [ "${IMAGE_MANIFESTS}" != "" ]; then
118118
status "Post-build processing (source release)"
119119
mkdir -p ${DEPLOY_SOURCES}
120120
for sarch in ${DEPLOY_DIR}/sources/*; do
@@ -125,15 +125,23 @@ if [ -d ${DEPLOY_DIR}/sources ]; then
125125
p=${p%-*}
126126

127127
# Check if package is part of any of the produced images
128-
grep -q "NAME: ${p}$" ${DEPLOY_DIR_IMAGE}/*.manifest || continue
128+
if ! grep -q "NAME: ${p}$" ${DEPLOY_DIR_IMAGE}/*.manifest; then
129+
continue
130+
fi
131+
132+
lic=$(find ${DEPLOY_DIR}/licenses -type d -name "${p}" | head -1)
133+
if ! [ -d "${lic}" ]; then
134+
status "License '${lic}' path not found"
135+
exit 1
136+
fi
129137

130138
# Only archive GPL packages (update *GPL* regex for additional licenses)
131-
numfiles=`ls ${DEPLOY_DIR}/licenses/${p}/*GPL* 2> /dev/null | wc -l`
132-
if [ ${numfiles} -gt 0 ]; then
139+
numfiles=$(find ${lic} -name "*GPL*")
140+
if [ "${numfiles}" != "" ]; then
133141
mkdir -p ${DEPLOY_SOURCES}/${p}/source
134142
cp -f ${pkg}/* ${DEPLOY_SOURCES}/${p}/source 2> /dev/null
135143
mkdir -p ${DEPLOY_SOURCES}/${p}/license
136-
cp -f ${DEPLOY_DIR}/licenses/${p}/* ${DEPLOY_SOURCES}/${p}/license 2> /dev/null
144+
cp -f ${lic}/* ${DEPLOY_SOURCES}/${p}/license 2> /dev/null
137145
fi
138146
done
139147
done

0 commit comments

Comments
 (0)