summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2002-11-24 01:00:51 +0000
committerMartin Schlemmer <azarah@gentoo.org>2002-11-24 01:00:51 +0000
commit92638cacf50ea203692fdbacd458004e7e4c0f1a (patch)
treeea01f7621c3621accb50b51f9cdd71914fb5bb93 /sys-devel
parentthe new lame release, last in the current stable development, now it goes uns... (diff)
downloadhistorical-92638cacf50ea203692fdbacd458004e7e4c0f1a.tar.gz
historical-92638cacf50ea203692fdbacd458004e7e4c0f1a.tar.bz2
historical-92638cacf50ea203692fdbacd458004e7e4c0f1a.zip
update script
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/gcc/files/awk/getlibdirs.awk104
-rw-r--r--sys-devel/gcc/files/fix_libtool_files.sh42
2 files changed, 146 insertions, 0 deletions
diff --git a/sys-devel/gcc/files/awk/getlibdirs.awk b/sys-devel/gcc/files/awk/getlibdirs.awk
new file mode 100644
index 000000000000..91ea75d4daf7
--- /dev/null
+++ b/sys-devel/gcc/files/awk/getlibdirs.awk
@@ -0,0 +1,104 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# Author: Martin Schlemmer <azarah@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/getlibdirs.awk,v 1.1 2002/11/24 01:00:51 azarah Exp $
+
+function einfo(string)
+{
+ system("echo -e \" \\e[32;01m*\\e[0m " string "\"")
+}
+
+function ewarn(string)
+{
+ system("echo -e \" \\e[33;01m*\\e[0m " string "\"")
+}
+
+function eerror(string)
+{
+ system("echo -e \" \\e[31;01m*\\e[0m " string "\"")
+}
+
+
+BEGIN {
+
+ while((getline ldsoconf_data < ("/etc/ld.so.conf")) > 0) {
+
+ if (ldsoconf_data !~ /[[:space:]]*#/) {
+
+ if (ldsoconf_data == "") continue
+
+ split(ldsoconf_data, nodes, /[:,[:space:]]/)
+
+ DIRLIST[1] = "/lib"
+ DIRLIST[2] = "/usr/lib"
+
+ for (x in nodes) {
+
+ sub(/=.*/, "", nodes[x])
+ sub(/\/$/, "", nodes[x])
+
+ if (nodes[x] == "") continue
+
+ DIRLIST[++i + 2] = nodes[x]
+ }
+ }
+ }
+
+ close("/etc/ld.so.conf")
+
+ pipe = "/usr/bin/python -c 'import portage; print portage.settings[\"CHOST\"];'"
+ (pipe) | getline CHOST
+ close(pipe)
+
+ GCCLIB = "/usr/lib/gcc-lib/" CHOST
+
+ sub(/\/$/, "", GCCLIB)
+
+ pipe = "gcc -dumpversion"
+ (pipe) | getline NEWVER
+ close(pipe)
+
+ for (x in DIRLIST) {
+
+ if (DIRLIST[x] ~ GCCLIB) continue
+
+ einfo("Scanning " DIRLIST[x] "...")
+
+ pipe = "ls -1 " DIRLIST[x] "/*.la 2>/dev/null"
+ while (((pipe) | getline la_files) > 0) {
+
+ CHANGED = 0
+
+ while ((getline la_data < (la_files)) > 0) {
+
+ if (gsub(GCCLIB "/" OLDVER "/", GCCLIB "/" NEWVER "/", la_data) > 0)
+ CHANGED = 1
+
+ if (gsub(GCCLIB "/" OLDVER "[[:space:]]", GCCLIB "/" NEWVER " ", la_data) > 0)
+ CHANGED = 1
+ }
+
+ close(la_files)
+
+ if (CHANGED) {
+
+ ewarn("FIXING: " la_files)
+
+ while ((getline la_data < (la_files)) > 0) {
+
+ gsub(GCCLIB "/" OLDVER "/", GCCLIB "/" NEWVER "/", la_data)
+ gsub(GCCLIB "/" OLDVER "[[:space:]]", GCCLIB "/" NEWVER " ", la_data)
+
+ print la_data >> (la_files ".new")
+ }
+
+ close(la_files)
+
+ system("mv -f " la_files ".new " la_files)
+ }
+ }
+
+ close(pipe)
+ }
+}
+
diff --git a/sys-devel/gcc/files/fix_libtool_files.sh b/sys-devel/gcc/files/fix_libtool_files.sh
new file mode 100644
index 000000000000..e183f7086c4c
--- /dev/null
+++ b/sys-devel/gcc/files/fix_libtool_files.sh
@@ -0,0 +1,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
+