--- fix_libtool_files.sh.orig 2004-11-15 11:25:10.000000000 +0000 +++ fix_libtool_files.sh 2004-11-15 11:32:02.510736568 +0000 @@ -6,24 +6,20 @@ usage() { cat << "USAGE_END" -Usage: fix_libtool_files.sh [--oldarch ] +Usage: fix_libtool_files.sh [--help] [--oldarch ] - Where is the version number of the - previous gcc version. For example, if you updated to - gcc-3.2.1, and you had gcc-3.2 installed, run: + This program will update all the references to a version of + gcc to the curently used one. + For example, if you updated to gcc-3.2.1, and you had gcc-3.2 installed, run: - # fix_libtool_files.sh 3.2 + # fix_libtool_files.sh - If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu - but you now have CHOST as i686-pc-linux-gnu, run: + If also you CHOST has changed, you have to specify the old one. + For example, if you updated to gcc-3.2.3, and the old CHOST was + i586-pc-linux-gnu but you now have CHOST as i686-pc-linux-gnu, run: - # fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu + # fix_libtool_files.sh --oldarch i586-pc-linux-gnu - Note that if only the CHOST and not the version changed, you can run - it with the current version and the '--oldarch ' arguments, - and it will do the expected: - - # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu USAGE_END @@ -31,15 +27,14 @@ exit 1 } -if [ "$2" != "--oldarch" -a "$#" -ne 1 ] || \ - [ "$2" = "--oldarch" -a "$#" -ne 3 ] +if [ "$1" = "--help" ] || \ + [ "$1" = "--oldarch" -a "$#" -ne 2 ] then usage fi ARGV1="$1" ARGV2="$2" -ARGV3="$3" source /etc/profile source /sbin/functions.sh @@ -50,27 +45,25 @@ exit 1 fi -if [ "${ARGV2}" = "--oldarch" -a "x${ARGV3}" != "x" ] +if [ "${ARGV1}" = "--oldarch" -a "x${ARGV2}" != "x" ] then - OLDCHOST="${ARGV3}" + OLDCHOST="${ARGV2}" else OLDCHOST= fi -AWKDIR="/lib/rcscripts/awk" +PORTAGEBINDIR="/usr/lib/portage/bin" -if [ ! -r "${AWKDIR}/fixlafiles.awk" ] +if [ ! -r "${PORTAGEBINDIR}/fixlafiles.py" ] then - eerror "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!" + eerror "${0##*/}: ${PORTAGEBINDIR}/fixlafiles.py does not exist!" exit 1 fi -OLDVER="${ARGV1}" - -export OLDVER OLDCHOST +export OLDCHOST einfo "Scanning libtool files for hardcoded gcc library paths..." -/bin/gawk -f "${AWKDIR}/fixlafiles.awk" +${PORTAGEBINDIR}/fixlafiles.py # vim:ts=4