114
114
115
115
# Generate a tarball containing the source code of *GPL* packages (based on yocto dev-manual)
116
116
DEPLOY_SOURCES=" ${DEPLOY_DIR_IMAGE} /source-release"
117
- if [ -d ${DEPLOY_DIR} /sources ]; then
117
+ if [ -d ${DEPLOY_DIR} /sources ] && [ " ${IMAGE_MANIFESTS} " != " " ] ; then
118
118
status " Post-build processing (source release)"
119
119
mkdir -p ${DEPLOY_SOURCES}
120
120
for sarch in ${DEPLOY_DIR} /sources/* ; do
@@ -125,15 +125,23 @@ if [ -d ${DEPLOY_DIR}/sources ]; then
125
125
p=${p% -* }
126
126
127
127
# 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
129
137
130
138
# 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
133
141
mkdir -p ${DEPLOY_SOURCES} /${p} /source
134
142
cp -f ${pkg} /* ${DEPLOY_SOURCES} /${p} /source 2> /dev/null
135
143
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
137
145
fi
138
146
done
139
147
done
0 commit comments