FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Development

 
 
LinkBack Thread Tools
 
Old 03-01-2009, 04:52 AM
Allan McRae
 
Default bash 4.0 / readline 6.0 rebuilds

Thomas Bächler wrote:

Aaron Griffin schrieb:

Packages affected, according to the web interface:
* abook
* afterstep
* archboot
* bash
* bc
* cdcd
* clisp
* device-mapper
* freeciv
* fvwm
* fvwm-devel
* gftp
* gnuchess
* gnutls
* gphoto2
* gutenprint
* hugs98
* inetutils
* jack-audio-connection-kit
* lftp
* libxml2
* lua
* maxima
* mysql-clients
* ntp
* pal
* php
* pilot-link
* postgresql-libs
* python24
* r
* ratpoison
* rosegarden
* ruby
* socat
* sqlite3
* sqlite3 (testing)
* swi-prolog
* tunepimp
* uml_utilities
* unixodbc
* wvstreams


Add the new wpa_supplicant to that list (wpa_cli now uses readline).



#! /bin/bash

# Run in minimal chroot to avoid false positives due to dependancies.
# Chroot can be built with:
# sudo mkarchroot <chrootdir>/root glibc coreutils findutils grep
tar gzip


# Copy script to <chrootdir>/root/tmp and packages to
<chrootdir>/root/tmp/pkg

# Usage:
# ./rebuildlist <library>
# <library> does not contain ".so"


library=$1
if [ "x$library" == "x" ]; then
echo "Usage $0 <library>"
exit
fi

for pkg in $(ls pkg); do
echo $pkg
mkdir tmp
cp pkg/$pkg tmp
cd tmp
tar -xf $pkg
rm $pkg
found=$(ldd $(find .) 2>/dev/null | grep "${library}.so" | wc
-l)

if [ $found -ne 0 ]; then
echo $pkg >> ../rebuildlist.txt
fi
cd ..
rm -rf tmp
done


Don't use ldd here, as it also covers indirect dependencies. If libA
depends on libB and libB depends on libC, then only libB needs
updating when libC changes the SOname, as long as libA never calls
libC directly.


You should parse the output of readelf -d, which only shows direct
dependencies and thus allows you to distinguish between direct and
indirect dependencies ... at least as far as I understand it.




That does not matter when done in a very minimal chroot as directed at
the top of the script. If libA depends on libB and libB depends on
libC, and libB is not on the system, then "ldd libC" does not show libA.


Allan
 
Old 03-01-2009, 08:56 AM
Thomas Bächler
 
Default bash 4.0 / readline 6.0 rebuilds

Allan McRae schrieb:
Don't use ldd here, as it also covers indirect dependencies. If libA
depends on libB and libB depends on libC, then only libB needs
updating when libC changes the SOname, as long as libA never calls
libC directly.


You should parse the output of readelf -d, which only shows direct
dependencies and thus allows you to distinguish between direct and
indirect dependencies ... at least as far as I understand it.




That does not matter when done in a very minimal chroot as directed at
the top of the script. If libA depends on libB and libB depends on
libC, and libB is not on the system, then "ldd libC" does not show libA.


You're looking at this the wrong way: You want to know whether libA
needs a rebuild because of the libC SONAME bump. So, you install libA
and all its dependencies (libB and libC). Now ldd libA.so shows that it
depends on libC (but the truth is that only libB requires libC, but libA
does not), while readelf tells you libA does NOT need libC.


Even better, you don't need to install all dependencies! You just need
to extract libA and use readelf on it!
 
Old 03-01-2009, 03:08 PM
Allan McRae
 
Default bash 4.0 / readline 6.0 rebuilds

Thomas Bächler wrote:

Allan McRae schrieb:
Don't use ldd here, as it also covers indirect dependencies. If libA
depends on libB and libB depends on libC, then only libB needs
updating when libC changes the SOname, as long as libA never calls
libC directly.


You should parse the output of readelf -d, which only shows direct
dependencies and thus allows you to distinguish between direct and
indirect dependencies ... at least as far as I understand it.




That does not matter when done in a very minimal chroot as directed
at the top of the script. If libA depends on libB and libB depends
on libC, and libB is not on the system, then "ldd libC" does not show
libA.


You're looking at this the wrong way: You want to know whether libA
needs a rebuild because of the libC SONAME bump. So, you install libA
and all its dependencies (libB and libC). Now ldd libA.so shows that
it depends on libC (but the truth is that only libB requires libC, but
libA does not), while readelf tells you libA does NOT need libC.


Even better, you don't need to install all dependencies!


This is the point of this comment:
# Run in minimal chroot to avoid false positives due to dependencies.
# Chroot can be built with:

# sudo mkarchroot <chrootdir>/root glibc coreutils findutils grep tar gzip

So, in your example, if you are testing if libA needs a rebuild due to
libC, you only extract libA in your chroot, not libB. The ldd can not
chain its way to libC. So ti ends up doing the same thing as readelf.


Allan
 
Old 03-01-2009, 06:19 PM
Thomas Bächler
 
Default bash 4.0 / readline 6.0 rebuilds

Allan McRae schrieb:

This is the point of this comment:
# Run in minimal chroot to avoid false positives due to dependencies. #
Chroot can be built with:

# sudo mkarchroot <chrootdir>/root glibc coreutils findutils grep tar gzip

So, in your example, if you are testing if libA needs a rebuild due to
libC, you only extract libA in your chroot, not libB. The ldd can not
chain its way to libC. So ti ends up doing the same thing as readelf.


Now I understand it.

Still, if you use readelf it does not matter what the environment is,
you could run it on any system which is not even Arch, or is the wrong
architecture or anything.
 
Old 03-02-2009, 05:43 AM
Allan McRae
 
Default bash 4.0 / readline 6.0 rebuilds

Thomas Bächler wrote:

Allan McRae schrieb:

This is the point of this comment:
# Run in minimal chroot to avoid false positives due to dependencies.
# Chroot can be built with:
# sudo mkarchroot <chrootdir>/root glibc coreutils findutils grep tar
gzip


So, in your example, if you are testing if libA needs a rebuild due
to libC, you only extract libA in your chroot, not libB. The ldd can
not chain its way to libC. So ti ends up doing the same thing as
readelf.


Now I understand it.

Still, if you use readelf it does not matter what the environment is,
you could run it on any system which is not even Arch, or is the wrong
architecture or anything.




Well, if that did not convince me, this does. I just noticed that
"readelf --dynamic" appears to be a lot faster than "ldd". On my
/usr/bin/*, readelf takes ~0.2sec while ldd takes ~12sec. I will test
this out with an actual run of the script tomorrow.


Allan
 

Thread Tools




All times are GMT. The time now is 06:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org