Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 178424 Details for
Bug 254655
sys-devel/gcc: libstdc++.so.6: version `GLIBCXX_3.4.9' not found error after downgrading 4.2.2->4.1.2
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
This script should help to find such packages
fix_glibcxx_3.4.9.sh (text/plain), 5.95 KB, created by
Nao Nakashima
on 2009-01-13 22:27:30 UTC
(
hide
)
Description:
This script should help to find such packages
Filename:
MIME Type:
Creator:
Nao Nakashima
Created:
2009-01-13 22:27:30 UTC
Size:
5.95 KB
patch
obsolete
>#!/bin/bash > ># fix_glibcxx_3.4.9.sh: Fix broken packages after gcc downgrade. ># Original Author: Nao Nakashima > >. /etc/init.d/functions.sh > ># You need to adjust this if you have another error than "libstdc++.so.6: version `GLIBCXX_3.4.9' not found". ># See Bug #254655 for details >QUERY='GLIBCXX_3\.4\.9' > >EXCLUDE_PACKAGES="sys-devel/gcc" >COMMAND="emerge -1" >#COMMAND=echo > ># temp files >TMP_DIR=/tmp >ALL_LIBS_FILE="${TMP_DIR}/01_all-libs.fixglibcxx" >ALL_BINS_FILE="${TMP_DIR}/01_all-bins.fixglibcxx" >BROKEN_FILE="${TMP_DIR}/02_broken.fixglibcxx" >PACKAGES_FILE="${TMP_DIR}/03_packages.fixglibcxx" >EBUILDS_FILE="${TMP_DIR}/04_ebuilds.fixglibcxx" > ># paths. change this if you have something else, autodetect currently not implemented:( >BIN_DIR="/bin /sbin /usr/bin /usr/sbin" >LIB_DIR="/lib* /usr/lib*" > ># if you don`t have qfile, simply ignore this line or emerge app-portage/portage-utils >QFILE_COMMAND="/usr/bin/qfile" >SCAN_CMD="/usr/bin/readelf -V" >THIS_NAME="$(basename $0)" >#############End of environment configuration########### > >print_usage() { >cat << EOF >Usage: $THIS_NAME [--help] [--keep-old] [--pretend] [--] [EMERGE_OPTIONS] > >Fix packages after switching to another gcc version. > > --help, -h Display help > --keep-old Do not delete temporary files from previous run (if any) > --pretend, -p Do a trial run without actually emerging anything > (also passed to emerge command) >EOF >} > > ># copypast from revdep-rebuild >get_file_owner() { > local IFS=$'\n' > # ${*/%/ } adds a space to the end of each object name to prevent false > # matches, for example /usr/bin/dia matching /usr/bin/dialog (bug #196460). > find -L /var/db/pkg -name CONTENTS -print0 | > xargs -0 grep -Fl "${*/%/ }" | > sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:' >} > ># qfile is faster, but may not be present on the target system >get_file_owner_from_file() { > local package > > if [ -x $QFILE_COMMAND ]; then > qfile -Cqef "$1" | uniq > else > ewarn "Using slow revdep-rebuild method, emerge app-portage/portage-utils to go faster" > while read package; do > get_file_owner $package > done < "$1" | sort | uniq > fi >} > ># copypast from revdep-rebuild >assign_packages_to_ebuilds() { > local EXACT_PKG > local PKG > local SLOT > einfo 'Assigning packages to ebuilds...' > if [ "$KEEPOLD" = "1" -a -r "$EBUILDS_FILE" ]; then > einfo "Using cached $EBUILDS_FILE" > cat "$EBUILDS_FILE" > else > while read EXACT_PKG; do > # Get the slot > PKG="${EXACT_PKG%%-r[[:digit:]]*}" > PKG="${PKG%-*}" > SLOT=$(</var/db/pkg/$EXACT_PKG/SLOT) > echo "$PKG:$SLOT" > done < "$PACKAGES_FILE" | tee "$EBUILDS_FILE" > einfo "Generated new $EBUILDS_FILE" > fi > echo >} > >cleanup() { > rm -f $ALL_LIBS_FILE $ALL_BINS_FILE $BROKEN_FILE $PACKAGES_FILE 2>/dev/null >} > ># Parsing options >while true; do > case "$1" in > --keep-old) KEEPOLD=1 ; shift;; > --pretend|-p) PRETEND=1 ; shift;; > --help|-h) print_usage ; exit ;; > --) shift; break;; > *) break;; > esac >done > >EMERGE_ARGS="$*" > ># If the user is not super, add --pretend >if [ "$PRETEND" \!= "1" -a $UID -ne 0 ]; then > ewarn "You are not superuser. Adding --pretend to emerge options." > PRETEND=1 >fi > >if [ "$PRETEND" = "1" ]; then EMERGE_ARGS="--pretend $EMERGE_ARGS"; fi > >if [ "$KEEPOLD" \!= "1" ]; then > cleanup >fi > ># Step 1: libraries and binaries >einfo "Collecting libraries..." >if [ "$KEEPOLD" = "1" -a -r "$ALL_LIBS_FILE" ]; then > einfo "Using cached $ALL_LIBS_FILE" >else > if [ "$KEEPOLD" = "1" -a \! -r "$ALL_LIBS_FILE" ]; then > KEEPOLD=0 > fi > find $LIB_DIR -regex '.*\.so\(\.[0-9]+\)*' -type f > $ALL_LIBS_FILE 2>/dev/null > einfo "Generated new $ALL_LIBS_FILE" >fi >echo > >einfo "Collecting binaries..." >if [ "$KEEPOLD" = "1" -a -r "$ALL_BINS_FILE" ]; then > einfo "Using cached $ALL_BINS_FILE" >&2 >else > if [ "$KEEPOLD" = "1" -a \! -r "$ALL_BINS_FILE" ]; then > KEEPOLD=0 > fi > find $BIN_DIR -type f > $ALL_BINS_FILE 2>/dev/null > einfo "Generated new $ALL_BINS_FILE" >fi >echo > ># Step 2: Searching broken files >einfo "Searching binaries and libraries that uses $QUERY ..." >if [ "$KEEPOLD" = "1" -a -r "$BROKEN_FILE" ]; then > einfo "Using cached $BROKEN_FILE" > cat $BROKEN_FILE >&2 >else > if [ "$KEEPOLD" = "1" -a \! -r "$BROKEN_FILE" ]; then > KEEPOLD=0 > fi > ALL_COUNT=`cat $ALL_BINS_FILE $ALL_LIBS_FILE | wc -l` > CURR_COUNT=0 > cat $ALL_LIBS_FILE $ALL_BINS_FILE |\ > while read FILE; do > PER=$(($CURR_COUNT*100/$ALL_COUNT)) > if [ "$(($PER<10))" = 1 ]; then PER=' '$PER ; fi > echo -ne "\r[ $PER% ] " >&2 > CURR_COUNT=$(($CURR_COUNT+1)) > $SCAN_CMD $FILE 2>/dev/null | grep -q "$QUERY" && echo $FILE > done | tee $BROKEN_FILE > echo > einfo "Generated new $BROKEN_FILE" > echo >fi > >if [ \! -s "$BROKEN_FILE" ]; then > einfo "No broken files found" > exit >fi >echo > ># Step 3: calculate packages list >einfo "Assigning files to packages..." >if [ "$KEEPOLD" = "1" -a -r "$PACKAGES_FILE" ]; then > einfo "Using cached $PACKAGES_FILE" > cat $PACKAGES_FILE | awk '{print "="$1}' >else > if [ "$KEEPOLD" = "1" -a \! -r "$PACKAGES_FILE" ]; then > KEEPOLD=0 > fi > get_file_owner_from_file $BROKEN_FILE |\ > grep -v "$EXCLUDE_PACKAGES" | tee $PACKAGES_FILE | awk '{print "="$1}' > einfo "Generated new $PACKAGES_FILE" >fi >echo > ># Step 4: Strip out version information but respect SLOT >assign_packages_to_ebuilds > >einfo "Executing emerge..." >cat $EBUILDS_FILE | xargs echo $COMMAND $EMERGE_ARGS >cat $EBUILDS_FILE | xargs $COMMAND $EMERGE_ARGS >C=$? >echo > >if [ "$PRETEND" = "1" -a $C -eq 0 ]; then > einfo "All ok. Now you can remove --pretend from options and rerun $THIS_NAME with --keep-old" >elif [ $C -eq 0 ]; then > einfo "$THIS_NAME completed successfully. Removing temporary files." > cleanup >else > ewarn "While executing emerge, some errors has occurred." > ewarn "This may be because script currently does not calculate a correct package order." > ewarn "Please rerun $THIS_NAME one more time and if this not help, run emerge manually, but without problem package in it." > cat $EBUILDS_FILE | xargs ewarn $COMMAND $EMERGE_ARGS >fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 254655
: 178424