[Gllug] Pipe question

Nix nix at esperi.org.uk
Sun Jan 22 20:29:10 UTC 2006


On Sun, 22 Jan 2006, Adrian McMenamin wrote:
> I am mucking about with buildroot - a set of scripts to automate cross
> compiling - which has a bug in it (which the maintainers say they don't
> have the time to fix) which means that configuration changes don't
> always result in proper rebuilds.

In your position, I'd say `sod *that' and fix the scripts myself :)

(It's not as though such scripts are exactly rocket science.)

> So I am doing things like this...
> 
> adrian at bossclass:~/buildroot$ locate libpthread.so
> /lib/tls/libpthread.so.0
[...]
> /home/adrian/buildroot/build_sh4/staging_dir/lib/libpthread.so.0
> /home/adrian/buildroot/build_sh4/staging_dir/lib/libpthread.so
> /home/adrian/buildroot/build_sh4/root/lib/libpthread.so.0
> /home/adrian/buildroot/toolchain_build_sh4/uClibc/lib/libpthread.so.0
> /home/adrian/buildroot/toolchain_build_sh4/uClibc/lib/libpthread.so
> /tftpboot/192.168.61.55/lib/libpthread.so.0
> /tftpboot/192.168.61.55/lib/usr/libpthread.so
> /lib64/libpthread.so.0
> 
> followed by
> 
> adrian at bossclass:~/buildroot$ ls
> -lia /home/adrian/buildroot/build_sh4/staging_dir/lib/libpthread.so.0
> 13816042 lrwxrwxrwx  1 adrian adrian 20 2006-01-22
> 17:08 /home/adrian/buildroot/build_sh4/staging_dir/lib/libpthread.so.0
> -> libpthread-0.9.28.so
> 
> To check whether a file has been rebuilt. How can I join the two up with
> a pipe? I cannot seem to find a way to do it, and I admit my shell
> knowledge is poor.

locate -e libpthread.so | grep ^/home/adrian/buildroot | xargs ls -li

although personally I'd not use locate: it'd only pick up stuff updated
since last updatedb was run. I'd overgeneralize and do something like
this, to get info on *all* the executables:

find /home/adrian/buildroot -perm +a+x -type f | xargs file |\
    grep executable | cut -d: -f1 | xargs ls -li

(it would be nicer if we knew the dependencies of the various
executables so we could check them automatically, but that's what make
is for and it really is probably faster to fix the uClibc build bug than
to try to reimplement make(1) in the shell!)

-- 
`Everyone has skeletons in the closet.  The US has the skeletons
 driving living folks into the closet.' --- Rebecca Ore
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list