Next Previous Contents

6. AddOns

6.1 Using the tmp/deploy/ipk dir as your local repository

All packages builded for e.g. opie-image will be tranfered into the deploy ipk directory. As this is nt meant to be a repository, you have to recreate the Packages file, if a new package has been added.

The following script does that for you. It is downloadable from here.

#!/bin/sh

TFILE="doit.rc"
rm -f ${TFILE}
rm -f Packages.new

echo -n "finding packages ... "
find *.ipk | \
        awk --traditional '{ printf( "echo -n .;ar -p %s control.tar.gz", $1 );
                             printf( " | tar -xzO ./control >> Packages.new;" );
                             printf( "echo Filename: %s >> Packages.new;", $1 );
                             printf( "echo Size: %s >> Packages.new;", $1 );
                             printf( "echo >> Packages.new\n" ); }' >> ${TFILE}
echo `cat doit.rc | wc -l` found.
/bin/sh ${TFILE}

6.2 Clean Package Dependends

A bitbake -c clean opie-image e.g. does not clean all dependend packages, which leads to problems, when rebuilding with different sources later, if some packages did not change.

For this I wrote a small script, which uses bbread and bitbake to constistent clean all dependend packages.

You can call the script using

do_clean.rc path/to/opie-image.bb.

As the user may not want to clean important packages, as e.g. cross-gcc, if (accidentally) in the DEPENDS, the script shows all packages to be cleaned and asks the user what to do ?

The above mentioned call leads to the following question.

[OE-BOXER]sc@schomep4:~/scdev/oe/build-boxer$ do_clean.rc ../openembedded/packages/meta/opie-image.bb
found 87 dependend packages.
Really clean the following packages ?
=======================================================
ipkg-native ipkg-utils-native fakeroot-native quilt-native virtual/arm-linux-gcc virtual/libc task-bootstrap qte libqtaux2 libopie2 qpf-bitstream-vera qpf-bitstream-vera-sans-mono qpf-unifont opie-pics opie-sounds opie-qcop opie-quicklauncher opie-taskbar opie-aboutapplet opie-clockapplet opie-logoutapplet opie-suspendapplet opie-batteryapplet opie-homeapplet opie-multikeyapplet opie-rotateappletopie-vtapplet opie-cardmon opie-irdaapplet opie-brightnessapplet opie-light-and-power opie-appearance opie-systemtime opie-sysinfo opie-networksettings opie-button-settings opie-packagemanager opie-keytabs opie-console opie-clock opie-citytime opie-backup ipkg ntp bluez-utils-nodbus irda-utils openobex-apps libopieobex0 opie-autorotateapplet opie-alarm opie-drawpad opie-textedit opie-addressbook opie-datebook opie-todo opie-today opie-today opie-today-addressbookplugin opie-today-datebookplugin opie-today-todolistplugin opie-clipboardapplet opie-volumeapplet opie-screenshotapplet opie-language opie-launcher-settings opie-doctab opie-security opie-mediummount opie-networksettings-wlanplugin opie-networksettings-pppplugin opie-advancedfm opie-style-flat opie-style-liquid opie-style-fresh opie-style-metal opie-style-web opie-style-phase opie-deco-flat opie-deco-liquid opie-deco-polished opie-multikey opie-handwriting opie-pickboard konqueror-embedded makedevs-native mtd-utils-native sharp-flash-header-c700
=======================================================
Yes/(N)o/Askme/Grep :

If the user selects "N" (or any other key), the clean process will be stopped. If "Y" (upper case) bitbake -c clean PackageList is called, where PackageList is the list shown above. If the user selects "A" (Ask me), the user is asked for every package. If he selects "G", he can enter a grep pattern to delete packages matching from the list.

The following paragraph shows an example.

Yes/(N)o/Askme/Grep : A
Clean ipkg-native Yes/(N)o/Rest ? : N
Clean ipkg-utils-native Yes/(N)o/Rest ? : N
Clean fakeroot-native Yes/(N)o/Rest ? : N
Clean quilt-native Yes/(N)o/Rest ? : N
Clean virtual/arm-linux-gcc Yes/(N)o/Rest ? : N
Clean virtual/libc Yes/(N)o/Rest ? : N
Clean task-bootstrap Yes/(N)o/Rest ? : N
Clean qte Yes/(N)o/Rest ? : Y
Clean libqtaux2 Yes/(N)o/Rest ? : Y
Clean libopie2 Yes/(N)o/Rest ? : Y
Clean qpf-bitstream-vera Yes/(N)o/Rest ? : R                

The user now has the choice. "Y" will clean, "R" will take the rest of the list to clear. The user is shown the list and asked again, after the selection is done. The selection may be repeated, until happy. Then he may select "Y" to confirm.

After that bitbake is called with the list of selected packages and will clean them all. The script is downloadable from here.


Next Previous Contents