summaryrefslogtreecommitdiff
blob: e183f7086c4c9c936fcd1b045392cc9c2dae301f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash

source /etc/init.d/functions.sh

if [ "`id -u`" -ne 0 ]
then
        eerror "${0##*/}: Must be root."
        exit 1
fi

usage() {
cat << "USAGE_END"
Usage: fix_libtool_files.sh <old-gcc-version>

    Where <old-gcc-version> 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:

      # fix_libtool_files.sh 3.2

USAGE_END

        exit 1
}

if [ "$#" -ne 1 ]
then
	usage
fi

PORTDIR="`/usr/bin/python -c 'import portage; print portage.settings[\"PORTDIR\"];'`"

AWKDIR="${PORTDIR}/sys-devel/gcc/files/awk"

if [ ! -r ${AWKDIR}/getlibdirs.awk ]
then
	eerror "${0##*/}: ${AWKDIR}/getlibdirs.awk does not exist!"
	exit 1
fi

/bin/gawk -v OLDVER="$1" -f ${AWKDIR}/getlibdirs.awk