Re: From emsource -b to emsandbox
On Wednesday 19 March 2008, Neil Williams wrote:
> On Wed, 2008-03-19 at 10:43 +0000, David Goodenough wrote:
> > I looked at the autobuild script that is in the documentation, and I
> > think it is wrong (or at least missing something).
>
> (an update for the changes within emsandbox)
>
> > So I changed it to read:-
> >
> >
> > #!/bin/bash
> > #set -x
> >
> > . /usr/share/debootstrap/functions
> > SCRIPT=/usr/lib/emdebian-tools/emdebian.crossd
> > . $SCRIPT
> > work_out_debs
> > requiredX=$(echo $(echo $required | tr ' ' '\n' | sort | uniq))
> > baseX=$(echo $(echo $base | tr ' ' '\n' | sort | uniq))
> > echo "Trying to automate rebuilds of rootfs packages:"
> > sources=`echo $requiredX $baseX | fold -s`
> > if [ -z "$sources" ]; then
> > echo "$PROG: no source list found in $SCRIPT"
> > fi
> > sourcesX=$(echo $(echo $sources | tr ' ' '\n' | sort | uniq))
>
> Thanks!
>
> $sources no longer exists in the suite scripts, it's too much of a
> maintenance headache. Instead, emsource uses the apt-cross cache to work
> out which source package provides the requested binary. The problem then
> is removing the duplicates where the suite script needs only two of many
> binaries built from one source package to prevent emsource having to
> build the same source twice.
Well you need to set $sources in the script, or the if [ -z $sources }]; does
not work. Should I remove that test too?
>
> > for pkg in $sourcesX; do
> > sources=`apt-cache showsrc $pkg | grep Package | awk "{print \\$2}" |
> > sort | uniq`
>
> You could use the apt-cross cache here, you should certainly not use the
> main system cache. Otherwise you will miss packages where Emdebian makes
> a new package split. e.g. debconf does not provide debconf-shell in the
> main Debian apt cache, only in the Emdebian cache. True, this is only
> because of the bug in cdebconf but still, debconf-shell is needed to
> actually get an emsandbox package set that can be installed as cdebconf
> cannot be used without the Emdebian debconf-shell package (at least
> until the cdebconf bug is fixed).
My intention (at least at first as my two target architectures seem not to be
the ones the emdebian repository is majoring on - i386 and mipsel) was to
build the repository entirely locally. So in that case presumably I need
to
Reading up on apt-cross should I be using that instead of emsource? They
seem to do the same thing. Also how do I get at the local apt-cross cache
rather than the system or emdebian one?
>
> > The location of debbootstrap/functions seems to be different from that
> > given in the documentation, and the original script never builds either
> > $sources or $src. So I assumed that sources is simply requiredX and
> > baseX concatenated, and added some code to extract the source package
> > name from the apt-cache | grep function, and eliminate duplicaets.
>
> You just need to work with the apt cache from the Emdebian repository,
> not the Debian mirrors and get your showsrc from that.
apt-cross seems to have a -show option, but not a -showsrc. Have I missed
something?
>
> > I
> > also put some error checking on the emsource run, so that if any build
> > fails I can see what happened. Obviously the first line in the first
> > for loop has wrapped in the above text.
>
> The example was just that - a beginning. Thanks for working on it.
My next intention is to get it to use the packages.conf file from emsandbox
so that it does all the downloading/building/tar'ing in one go. That way
also the script file would not be hard coded.
>
> > Now I have a trunk tree trunck/<letter>/<package>/trunk/<deb-file> files
> > and I need to convert this into something that emsandbox will use as a
> > proxy. Does anyone have a script that will do this conversion.
>
> man reprepro
>
> Don't generate the tree manually, do it with reprepro and make it easy
> to maintain.
Maybe I need to read more, but I can not see how to add a package into
reprepro. I can see how to update things from an external repository, but
as above my intention is to use a local repository.
>
> > I
> > guess I can use dpkg-scanpackages along the way but I am not sure
> > of what else I need to do along the way.
>
> You need to run edos-debcheck against it too so you'll need Packages.gz,
> Release etc. i.e. a normal apt mirror. reprepro runs the Emdebian
> repositories and the scripts all expect that level of support so it's
> best to use reprepro so that you don't get surprises from debootstrap.
yes, I will use edos-debcheck.
One other thing I may have skipped, is build dependancies. It may be because
I am building everything for i386 on an i386 machine, but when I need a
build dependancy emsource does not seem to fetch it, but rather I simply
apt-get installed it. The emsource stuff talks about a chroot, but that is
obviously not being used here (if nothing else the -p option is not used),
should it be, and what do I need to set up so that it is. I will need this
for cross building mipsel stuff, and if emdebian moves to uclib I will also
need it for i386.
David
Reply to: