Re: [lfs-dev] Build method revisions

2012-03-20 Thread Pierre Labastie
Le 20/03/2012 05:24, Bryan Kadzban a écrit :
> That's weird.  There are no differences in the strip binaries (when you
> do strip the libraries), right?  Or in libbfd.so.whatever-it-is?
Actually, in the book, the binaries in {,/usr}{/bin,/sbin} are stripped, 
and the
libraries in {,/usr}lib from debug symbols. Then, the easiest thing is 
that I give you the script I use.
It is short enough, and I prefer to have it checked:
-
#!/bin/bash

# Adapted from Greg's Schaffer ICA code reproduced in jhalfs
: << inline_doc
Compare two system directories, in the following way:
- Remove all non-relevant directories
- Remove symlinks
- Gunzip all the .gz files (gzip puts a time stamp)
- Extract library archives (.a files) in directories with the same names
- Then find all the files which exit only on one system
- Second, for files which appear in both system dirs:
   - if ascii, diff them
   - if elf, diff the result of objdump -x -s
   - other files: diff them and report if different

INPUT: $1 and $2 are directories (no trailing /)
OUPUT: the results of the above described operations in binarydiff and 
asciidiff
inline_doc

MYDIR=$(pwd)
cd $1
rm -rf dev home jhalfs media mnt opt proc sources root srv sys tmp tools 
usr/local usr/src
echo Removing symlinks in $1>&2
find . -type l | xargs rm -f
echo unzipping files in $1>&2
find . -name \*.gz | xargs gunzip
echo extracting archives in $1>&2
L=$(find . -name \*.a ! -name \*libieee.a ! -name \*libmcheck.a ! -type d)
for archive in $L; do
   mv $archive $archive.XX
   mkdir $archive
   BA=$(basename $archive)
   pushd $archive > /dev/null
   ar x ../$BA.XX
   popd > /dev/null
   rm $archive.XX
done
find . -print | sed 's@^\./@@' > $MYDIR/content1
cd $MYDIR
cd $2
rm -rf dev home jhalfs media mnt opt proc sources root srv sys tmp tools 
usr/loc
al usr/src
echo Removing symlinks in $2>&2
find . -type l | xargs rm -f
echo unzipping files in $2>&2
find . -name \*.gz | xargs gunzip
echo extracting archives in $2>&2
L=$(find . -name \*.a ! -name \*libieee.a ! -name \*libmcheck.a ! -type d)
for archive in $L; do
   mv $archive $archive.XX
   mkdir $archive
   BA=$(basename $archive)
   pushd $archive > /dev/null
   ar x ../$BA.XX
   popd > /dev/null
   rm $archive.XX
done
find . -print | sed 's@^\./@@' > $MYDIR/content2
cd $MYDIR
echo "Files only in $1 (<) or $2 (>)"
diff content1 content2
echo Diffing directories
LC_ALL=POSIX diff -ur $1 $2 > rawdiff
echo Reading info in executables
for file in $(cat rawdiff | grep differ | cut -d" " -f3); do
   file1=$(echo $file | sed "s@^$1\/@@")
   file2=$(basename $file)
   case $(file -b $file) in
 *ELF*)
   objdump -x -s $1/$file1 > $file2.1
   objdump -x -s $2/$file1 > $file2.2
   diff -u $file2.1 $file2.2;;
 *) diff -u $1/$file1 $2/$file1;;
   esac
done > binarydiff
echo Reading info in ascii files
cat rawdiff | grep -v differ > asciidiff
---
There are very little differences, besides libgmpxx.so
and libgmpxx.la, ans time stamps.

Pierre
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Re: [lfs-dev] Build method revisions

2012-03-20 Thread g . esp


- Mail original -
> De: "Pierre Labastie" 
> À: "LFS Developers Mailinglist" 
> Envoyé: Mardi 20 Mars 2012 22:26:32
> Objet: Re: [lfs-dev] Build method revisions
> 
> - Gunzip all the .gz files (gzip puts a time stamp)

Would not using something like
export GZIP='-n'
solve the include timestamp issue?

Gilles
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page