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

Re: starnge behaviour of apt-cross in bash script



On Mon, 17 Aug 2009 21:58:56 +0800
debuser <debuser@yandex.ru> wrote:

> There is a chroot (debootstrap lenny crush-lenny/). I installed there
> emdebian-tools emdebian-rootfs as well.
> 
> I wrote a simple bash script which parses a dsc file, gets necessary
> depends from it, installs it using apt-cross and tries to build crush
> arm package.

Why?? emdebuild --build-dep does that for you and the build-depends
that you get from the .dsc are the wrong packages! You need to isolate
the Build-Tools-Depends from the Build-Depends.

> For tests I use acl source files from crush repository.
> There is a build dir in chroot env containing these sources.

Use emsource so that the ../$package.old directory is handled properly
- that's why you've got messages about not creating empty files.

> DEPENDS="autoconf debhelper gettext libtool libattr1-dev"

WRONG. The only build-dependency there for a cross-build is
libattr1-dev. That is the only package that needs to be handled via
apt-cross. The tools need to be installed natively. Ideally,
libattr1-dev would *only* be installed by apt-cross, it should not need
to be installed natively.

> 
> echo "====START===="
> cd $TARG
> LANG=C chroot $TARG apt-cross -i $DEPENDS
> LANG=C chroot $TARG apt-cross -l
> LANG=C chroot $TARG /bin/bash <<EOF
> cd /build
> dpkg-source -x acl_2.2.47-2em1.dsc 

Use emsource instead.

> I opened two terminals. I run 'tail -f log.txt' in the first window and
> I run script.sh in the second one.
> 
> 1. I run 'script.sh 2>&1>>./log.txt'

You cannot append AND redirect all output in a single operation. Shell
expansion fails. 

> In the terminal window:
> The strange thing is that I see some lines even I sent all messages to
> log file.
> 
> # ./script.sh 2>&1>>./log.txt
> Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The
> COLUMNS and LINES environment variables didn't work. The resize program
> didn't work. at /usr/lib/perl5/Term/ReadKey.pm line 362.
> guessing terminal width 50

That's the progress bar trying to work. Use --quiet

> Cannot create empty xcontrol file : No such file or directory
>  at /usr/bin/emdebuild line 265

no ../acl.old/debian/ directory - emsource would create this.

> 2. The second way. I run './script.sh 2>&1>>./log.txt & exit 0' (run the
> process in the background. In this way I can close the remote console,
> but the process keeps on working)

Use a script run via cron instead - there is already a working one for
the Crush autobuilder. Why are you constantly reinventing the wheel?

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgptVyQxR2VGq.pgp
Description: PGP signature


Reply to: