I'm writing a tool for Emdebian that can describe a sequence of cross-building that ensures the availability of all Build-Depends packages before each package is cross-built. i.e. a path from the base_set A to Package B, detailing which packages need to be built at which step but also adapting to changes in the dependencies that result from the actual cross-build. I thought about using Perl (like the other emdebian-tools scripts) but I'm currently using C/C++ because I can copy code directly from the apt source code. It's C and C++ because I prefer to use glib2.0. Starting with just a cross-compiling toolchain based around gcc-4.1, I need to be able to query a single package name and find out whether that package can be cross-built with only the currently available package set. If not, I identify which packages need to be built first and check each of those against the 'base set'. I aim to get a report that basically says: To build foo, you need to build first bar then baz, then foo. Some packages are ignored because they are needed on the cross-building machine but not on the target machine. (In GNU-terminology, the packages that are only required on the HOST are not going to be available on the BUILD). Also, Emdebian is seeking to remove Perl from essential to make the rootfs as small as possible as well as removing tcl, python, replacing bash with dash etc., so certain dependency changes are inevitable. Sample output for sqlite: $ ./src/empath -p sqlite Updating cache . . . Reading cache file . . . Updating cache . . . Reading dependencies.......... Package 'gpm' can be cross-built from the current base set. Package 'sqlite' needs readline5 cross-built first, at level 1 Package 'sqlite' needs tcl8.4 cross-built first, at level 0 Package 'tcl8.4' can be cross-built from the current base set. Package 'ncurses' needs gpm cross-built first, at level 0 Package 'readline5' needs ncurses cross-built first, at level 0 Package 'ncurses' can be cross-built from the current base set. So the path would be, gpm, then ncurses, then readline5, then sqlite (patching sqlite to omit tcl). The next stage is that when gpm and ncurses are uploaded to Emdebian, the program incorporates those into the base_set and filters the output: Package 'readline5' can be cross-built from the current base set. Package 'sqlite' can be cross-built from the current base set. (All packages are the source package name.) tcl disappears because the Emdebian build *changes* the dependencies of the new sqlite packages and the program needs to adapt to these changes by allowing the Emdebian package dependency list to "overrule" the Debian package dependency list. (i.e. if the package exists in the Emdebian repository and cache file, use that Build-Depends; if not, go to the Debian cache file and find out what Debian would normally need.) Current SVN is at: http://buildd.emdebian.org/svn/browser/current/host/trunk/empath/trunk/ Access info: http://www.emdebian.org/docs/svn.html I want to avoid the need for external sources files, it can already avoid all use of sudo (via _config->Set). However, although I can parse a suitable (hard-coded) source, I cannot seem to get libapt-pkg to use that source - I'm missing a step somewhere. I can then setup the priorities as above. Would anyone be interested in helping me with this project? I'm having trouble following the apt source code and working out just how to achieve what I need. (Potentially, this could be useful in situations outside Emdebian too.) -- Neil Williams ============= http://www.data-freedom.org/ http://www.nosoftwarepatents.com/ http://www.linux.codehelp.co.uk/
Attachment:
pgpbkBhOM74wo.pgp
Description: PGP signature