7 echo "Usage: $0 path/to/recipe.bb"
11 if [ $# -eq 2 ] ; then
15 if [ ! -d ${TMPDIR} ] ; then
16 echo "TMPDIR '${TMPDIR}' does not exist, update TMPDIR in script or use 2nd parameter"
22 if grep PACKAGES_DYNAMIC
${RECIPE} >/dev
/null
; then
23 echo "${RECIPE} already has PACKAGES_DYNAMIC defined, please remove it first"
27 # force old behavior spliting all
28 echo 'PACKAGES_DYNAMIC = "gst-plugin-*"' >> ${RECIPE}
30 echo "Cleaning ${RECIPE}"
31 # don't know better way to get right WORKDIR from shell, we need to clean it anyways
32 WORKDIR
=`bitbake -c clean -v -b ${RECIPE} | grep "NOTE: removing work" | sed 's/NOTE: removing //g'`
34 TMPDIR_PKGS
=${TMPDIR}/${WORKDIR}/packages-split
/
35 echo "Packages are expected in ${TMPDIR_PKGS}"
37 echo "Building ${RECIPE}"
38 # -c build because some people use rm_work
39 bitbake
-c build
-b ${RECIPE}
41 if [ $?
-ne 0 ] ; then
42 echo "${RECIPE} build failed, fix build first"
43 sed -i '/^PACKAGES_DYNAMIC = "gst-plugin-\*"$/d' ${RECIPE}
48 if ls -1d ${TMPDIR_PKGS}/gst-plugin-
*-dev |
grep gst-plugin-.
*-dev >/dev
/null
; then
49 # replace temporary PACKAGES_DYNAMIC spliting all with list of created packages
50 sed -i '/^PACKAGES_DYNAMIC = "gst-plugin-\*"$/d' ${RECIPE}
52 echo 'PACKAGES_DYNAMIC = "\' >> ${RECIPE}
53 ls -1d ${TMPDIR_PKGS}/gst-plugin-*-dev | grep gst-plugin-.*-dev| sed "s#${TMPDIR_PKGS}/\(.*\)-dev#\1* \\\#g" >> ${RECIPE}
55 echo "${RECIPE} PACKAGES_DYNAMIC were hopefully updated
"
57 echo "No directories found
${TMPDIR_PKGS}/gst-plugin-
*-dev"