[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

using apt and aptitude for cross-building

Hi people,

I am trying to script the building of cross-toolchains for debian (as part
of the Embedded Debian project).

Part of this process requires downloading the relevant version of these
packages for the target architecture and suite:
libdb1-compat libc6 libc6-dev linux-kernel-headers

The script builds cross compilers for a range of target architectures (arm,
mips, mipsel, powerpc and m68k currently, armeb and armeabi to be added
soon), and for stable, testing and unstable. Or at least it should, but
building the non-stable packages is causing me a problem due to the way
apt-get and aptitude work.

In order not to mess up the host machine's apt config, and to keep the info
for the vaious arches cached I have set up my own apt config:
Dir "/var/emdebian/tools/apt/"
  Etc "/var/emdebian/tools/apt/"
    SourceList "sources.stable";
  State "stable/";
  Cache "stable/";

There is a corresponding 'testing' version of this file too.
I can then do:
 sudo apt-get -o Apt::Architecture=$arch -c $apt_dir/apt.conf-$suite update
and the appropriate set of files are updated.

However I can't find a way of actually downloading the wanted packages using
apt-get. One would hope this woould work:
cd $native_dir && sudo apt-get -o Apt::Architecture=$arch \
 -c $apt_dir/apt.conf-$suite --download-only install libdb1-compat \
 libc6 libc6-dev linux-kernel-headers

but it just gives me a huge list of missing dependencies for the target arch
(which is correct - the whole system is missing, but I don't need it for
cross-building - I just need these few native packages).

Now aptitude can do what I want with:
cd $native_dir && sudo aptitude -o Apt::Architecture=$arch \
  download  libdb1-compat libc6 libc6-dev linux-kernel-headers

but there seems to be no way to get aptitude to use my alternate apt.conf
file - I would have to give it a great list of -o options, repeating all the
info in the apt.conf file, which just seems terribly inelegant (and prone to
errors with future changes needing to be made in two places).

Is there really no better way of doing this? Some way of specifying a conf
file for aptitude, or some way of getting apt-get to just download the
asked-for binary package and ignore dependencies (i.e. do the binary
equivalent of apt-get source)?

I hope this is sufficiently clear. Advice welcome. 

Aleph One Ltd, Bottisham, CAMBRIDGE, CB5 9BA, UK  Tel +44 (0) 1223 811679
work: http://www.aleph1.co.uk/     play: http://www.chaos.org.uk/~wookey/

Reply to: