--- Em sáb, 5/1/13, Bruce Dubbs escreveu: > De: Bruce Dubbs > Assunto: Re: [lfs-support] can't compile gcc pass 1 > Para: "LFS Support List" > Data: Sábado, 5 de Janeiro de 2013, 21:24 > Tobias Gasser wrote: > > Am 05.01.2013 18:39, schrieb Bruce Dubbs: > >> The idea of the script was that it should be > short. Generally the > >> problem is that the symlinks are not set and > occasionally makeinfo is > >> not installed. Rarely is the problem an > out-of-date executable. > > > > agree. > > > > > > so why not check just the very important stuff? > > Try this. Note that I want the user to actually check > the versions of > the packages manually, not just rely on a script to do it. > > - -Bruce > > #!/bin/bash > # Simple script to list version numbers of critical > development tools > > function die > { > rm -f dummy.c dummy > echo "Error: $1" > exit 1 > } > > export LC_ALL=C > bash --version | head -n1 | cut -d" " -f2-4 > SH=`readlink -f /bin/sh` > echo "/bin/sh -> $SH" > [ "$SH" == "/bin/bash" ] || die "/bin/sh is not a symlink to > bash" > > echo -n "Binutils: "; ld --version | head -n1 | cut -d" " > -f3- > > bison --version | head -n1 > if [ -e /usr/bin/yacc ]; > then echo "/usr/bin/yacc -> `readlink > -f /usr/bin/yacc`"; > else die "yacc not found"; fi > > bzip2 --version 2>&1 < /dev/null | head -n1 | cut > -d" " -f1,6- > echo -n "Coreutils: "; chown --version | head -n1 | cut > -d")" -f2 > diff --version | head -n1 > find --version | head -n1 > gawk --version | head -n1 > if [ -e /usr/bin/awk ]; > then > AWK=`readlink -f /usr/bin/awk` > echo "/usr/bin/awk -> $AWK" > [ "$AWK" == "/usr/bin/gawk" ] > || die "/usr/bin/awk is not a > symlink to gawk" > else die "awk not found"; fi > > gcc --version | head -n1 > echo 'main(){}' > dummy.c && gcc -o dummy > dummy.c > if [ -x dummy ] > then > echo "gcc compilation OK" > rm -f dummy.c dummy > else > die "gcc compilation failed" > fi > > ldd --version | head -n1 | cut -d" " -f2- # glibc > version > grep --version | head -n1 > gzip --version | head -n1 > cat /proc/version > m4 --version | head -n1 > make --version | head -n1 > patch --version | head -n1 > echo Perl `perl -V:version` > sed --version | head -n1 > tar --version | head -n1 > echo "Texinfo: `makeinfo --version | head -n1`" > xz --version | head -n1 > > echo -e "\n\n*** Review all versions for currency!"
I like this. Output from $ cat /etc/lfs-release SVN-20120311 is: $ ../../lfs/version-check-lfs-support.sh bash, version 4.2.36(2)-release /bin/sh -> /bin/bash Binutils: (GNU Binutils) 2.22 bison (GNU Bison) 2.5.1 /usr/bin/yacc -> /usr/bin/yacc bzip2, Version 1.0.6, 6-Sept-2010. Coreutils: 8.15 diff (GNU diffutils) 3.2 find (GNU findutils) 4.4.2 GNU Awk 4.0.1 /usr/bin/awk -> /usr/bin/gawk gcc (GCC) 4.6.3 gcc compilation OK (GNU libc) 2.14.1 grep (GNU grep) 2.13 gzip 1.5 Linux version 3.7.1 (root@NovoGamerLFS71) (gcc version 4.6.3 (GCC) ) #1 SMP Tue Dec 18 16:26:07 BRT 2012 m4 (GNU M4) 1.4.16 GNU Make 3.82 patch 2.6.1 Perl version='5.16.0'; GNU sed version 4.2.1 tar (GNU tar) 1.26 Texinfo: makeinfo (GNU texinfo) 4.13 xz (XZ Utils) 5.0.4 *** Review all versions for currency! []s, Fernando -- http://linuxfromscratch.org/mailman/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page