Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 198219 Details for
Bug 278081
app-portage/gentoolkit-0.2.4.4 revdep-rebuild patch to allow use on IRIX
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
IRIX patch for revdep-rebuild from gentoolkit0.2.4.4, also adds prefix support
revdep-rebuild.patch (text/plain), 12.42 KB, created by
Stuart Shelton
on 2009-07-16 17:16:03 UTC
(
hide
)
Description:
IRIX patch for revdep-rebuild from gentoolkit0.2.4.4, also adds prefix support
Filename:
MIME Type:
Creator:
Stuart Shelton
Created:
2009-07-16 17:16:03 UTC
Size:
12.42 KB
patch
obsolete
>--- /opt/gentoo/home/../usr/bin/revdep-rebuild 2009-07-16 17:36:51.359506000 +0100 >+++ revdep-rebuild 2009-07-16 18:11:19.016362200 +0100 >@@ -83,7 +83,7 @@ declare RC_NOCOLOR # Hack to > declare REBUILD_LIST # Array of atoms to emerge > declare SKIP_LIST # Array of atoms that cannot be emerged (masked?) > declare SONAME # Soname/soname path pattern given on commandline >-declare SONAME_SEARCH # Value of SONAME modified to match ldd's output >+declare SONAME_SEARCH # Value of SONAME modified to match ldd's output #'# vim-syntax > declare WORKING_TEXT # Feedback about the search > declare WORKING_DIR # Working directory where cache files are kept > >@@ -241,7 +241,7 @@ die() { > clean_exit() { > if [[ ! $KEEP_TEMP ]]; then > rm -f "${FILES[@]}" >- if [[ "$WORKING_DIR" != "/var/cache/${APP_NAME}" ]]; then >+ if [[ "$WORKING_DIR" != "$EPREFIX/var/cache/${APP_NAME}" ]]; then > # Remove the working directory > builtin cd; rmdir "$WORKING_DIR" > fi >@@ -256,9 +256,9 @@ 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 | >+ find -L $EPREFIX/var/db/pkg -name CONTENTS -print0 | > xargs -0 grep -Fl "${*/%/ }" | >- sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:' >+ sed 's:^.*/var/db/pkg/\(.*\)/CONTENTS:\1:' > } > ## > # Normalize some EMERGE_OPTIONS >@@ -275,7 +275,7 @@ setup_color() { > # environment. > export NOCOLOR=$(portageq envvar NOCOLOR) > [[ $NOCOLOR = yes || $NOCOLOR = true ]] && export RC_NOCOLOR=yes # HACK! (grr) >- . /etc/init.d/functions.sh >+ . $EPREFIX/etc/init.d/functions.sh > } > ## > # Die if an argument is missing. >@@ -432,10 +432,10 @@ get_opts() { > normalize_emerge_opts > > # If the user is not super, add --pretend to EMERGE_OPTIONS >- if [[ ${EMERGE_OPTIONS[@]} != *--pretend* && $UID -ne 0 ]]; then >- ewarn "You are not superuser. Adding --pretend to emerge options." >- EMERGE_OPTIONS+=(--pretend) >- fi >+# if [[ ${EMERGE_OPTIONS[@]} != *--pretend* && $UID -ne 0 ]]; then >+# ewarn "You are not superuser. Adding --pretend to emerge options." >+# EMERGE_OPTIONS+=(--pretend) >+# fi > } > ## > # Is there a --pretend or --fetchonly flag in the EMERGE_OPTIONS array? >@@ -470,7 +470,8 @@ cd() { > if builtin cd -P "$@"; then > if [[ $1 != $PWD ]]; then > # Some symlink malfeasance is going on >- die 1 "Working directory expected to be $1, but it is $PWD" >+ #die 1 "Working directory expected to be $1, but it is $PWD" >+ ewarn "Working directory expected to be $1, but it is $PWD" > fi > else > die 1 "Unable to change working directory to '$@'" >@@ -523,7 +524,7 @@ get_search_env() { > local uid=$(python -c 'import os; import pwd; print pwd.getpwuid(os.getuid())[0]') > # Find a place to put temporary files > if [[ "$uid" == "root" ]]; then >- local tmp_target="/var/cache/${APP_NAME}" >+ local tmp_target="$EPREFIX/var/cache/${APP_NAME}" > else > local tmp_target="$(mktemp -d -t revdep-rebuild.XXXXXXXXXX)" > fi >@@ -646,9 +647,9 @@ get_ldpath() { > clean_trap "$LDPATH_FILE" > # Ensure that the "trusted" lib directories are at the start of the path > COMPLETE_LD_LIBRARY_PATH=( >- /lib* >- /usr/lib* >- $(sed '/^#/d;s/#.*$//' < /etc/ld.so.conf) >+ $EPREFIX/lib* >+ $EPREFIX/usr/lib* >+ $(sed '/^#/d;s/#.*$//' < $EPREFIX/etc/ld.so.conf) > $(sed 's:/[^/]*$::' < "$FILES_FILE" | sort -ru) > ) > IFS=':' >@@ -666,6 +667,14 @@ main_checks() { > local ldd_status > local numFiles > local COMPLETE_LD_LIBRARY_PATH >+ local running_on_irix old_RLD_ARGS old_LD_LIBRARYN32_PATH old_LD_LIBRARY64_PATH >+ running_on_irix="$(uname -s)" >+ if [[ $running_on_irix == IRIX || $running_on_irix == IRIX64 ]]; then >+ running_on_irix=1 >+ else >+ running_on_irix=0 >+ fi >+ export running_on_irix > if [[ $SEARCH_BROKEN && $FULL_LD_PATH ]]; then > [[ -r "$LDPATH_FILE" && -s "$LDPATH_FILE" ]] || > die 1 "Unable to find $LDPATH_FILE" >@@ -682,52 +691,94 @@ main_checks() { > if [[ $target_file != *.la ]]; then > # Note: double checking seems to be faster than single with complete path > # (special add ons are rare). >+ if (( $running_on_irix )); then >+ # By default, IRIX' rld writes errors to /dev/tty :( >+ old_RLD_ARGS="$_RLD_ARGS" >+ export _RLD_ARGS="-log /dev/stdout" >+ fi > ldd_output=$(ldd "$target_file" 2>> "$ERRORS_FILE" | sort -u) > ldd_status=$? # TODO: Check this for problems with sort >+ if (( $running_on_irix )); then >+ export _RLD_ARGS="$old_RLD_ARGS" >+ fi > # HACK: if LD_LIBRARY_MASK is null or undefined grep -vF doesn't work >- if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" | >- grep -q "$SONAME_SEARCH"; then >+ #if grep -vF "${LD_LIBRARY_MASK:=$'\a'}" <<< "$ldd_output" | >+ #grep -q "$SONAME_SEARCH"; then > if [[ $SEARCH_BROKEN && $FULL_LD_PATH ]]; then >- if LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH" ldd "$target_file" 2>/dev/null | >- grep -vF "$LD_LIBRARY_MASK" | grep -q "$SONAME_SEARCH"; then >+ #if ((running_on_irix)); then >+ # old_LD_LIBRARY64_PATH="$LD_LIBRARY64_PATH" >+ # old_LD_LIBRARYN32_PATH="$LD_LIBRARYN32_PATH" >+ # old_RLD_ARGS="$_RLD_ARGS" >+ # export _RLD_ARGS="-log /dev/stdout" >+ # # If either of these is set, LD_LIBRARY_PATH is ignored >+ # unset LD_LIBRARYN32_PATH >+ # unset LD_LIBRARY64_PATH >+ #fi >+ #if LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH" ldd "$target_file" 2>/dev/null | >+ # grep -vF "$LD_LIBRARY_MASK" | grep -q "$SONAME_SEARCH"; then >+ # if (( $running_on_irix )); then >+ # LD_LIBRARY64_PATH="$old_LD_LIBRARY64_PATH" >+ # LD_LIBRARYN32_PATH="$old_LD_LIBRARYN32_PATH" >+ # export _RLD_ARGS="$old_RLD_ARGS" >+ # fi > # FIXME: I hate duplicating code > # Only build missing direct dependencies >- MISSING_LIBS=$( >- expr='s/[[:space:]]*\([^[:space:]]*\) => not found/\1/p' >- sed -n "$expr" <<< "$ldd_output" >- ) >+ if (( $running_on_irix )); then >+ MISSING_LIBS=$( >+ expr="s/^.*Cannot Successfully map soname '\([^[:space:]]*\)' under any of the filenames.*$/\1/p"; >+ sed -n "$expr" <<< "$ldd_output" >+ ) >+ else >+ MISSING_LIBS=$( >+ expr='s/[[:space:]]*\([^[:space:]]*\) => not found/\1/p'; >+ sed -n "$expr" <<< "$ldd_output" >+ ) >+ fi > REQUIRED_LIBS=$( > expr='s/^[[:space:]]*NEEDED[[:space:]]*\([^[:space:]]*\).*/\1/p'; >- objdump -x "$target_file" | grep NEEDED | sed "$expr" | sort -u >+ objdump -x "$target_file" 2>/dev/null | grep NEEDED | sed "$expr" | sort -u > ) > MISSING_LIBS=$(grep -F "$REQUIRED_LIBS" <<< "$MISSING_LIBS") > if [[ $MISSING_LIBS ]]; then > echo "obj $target_file" >> "$BROKEN_FILE" >- echo_v " broken $target_file (requires $MISSING_LIBS)" >+ echo_v " broken $target_file ( requires $( for LIB in $( sort <<< "$MISSING_LIBS" | uniq ); do echo -n "$LIB "; done ))" > fi >- fi >+ #else >+ # if (( $running_on_irix )); then >+ # LD_LIBRARY64_PATH="$old_LD_LIBRARY64_PATH" >+ # LD_LIBRARYN32_PATH="$old_LD_LIBRARYN32_PATH" >+ # export _RLD_ARGS="$old_RLD_ARGS" >+ # fi >+ #fi > else > # FIXME: I hate duplicating code > # Only rebuild for direct dependencies >- MISSING_LIBS=$( >- expr="/$SONAME_SEARCH/s/^[[:space:]]*\([^[:space:]]*\).*$/\1/p" >- sort -u <<< "$ldd_output" | sed -n "$expr" >- ) >+ if (( $running_on_irix )); then >+ MISSING_LIBS=$( >+ expr="s/^.*Cannot Successfully map soname '\([^[:space:]]*\)' under any of the filenames.*$/\1/p"; >+ sed -n "$expr" <<< "$ldd_output" >+ ) >+ else >+ MISSING_LIBS=$( >+ expr="/$SONAME_SEARCH/s/^[[:space:]]*\([^[:space:]]*\).*$/\1/p"; >+ sort -u <<< "$ldd_output" | sed -n "$expr" >+ ) >+ fi > REQUIRED_LIBS=$( > expr='s/^[[:space:]]*NEEDED[[:space:]]*\([^[:space:]]*\).*/\1/p'; >- objdump -x "$target_file" | grep NEEDED | sed "$expr" | sort -u >+ objdump -x "$target_file" 2>/dev/null | grep NEEDED | sed "$expr" | sort -u > ) > MISSING_LIBS=$(grep -F "$REQUIRED_LIBS" <<< "$MISSING_LIBS") > if [[ $MISSING_LIBS ]]; then > echo "obj $target_file" >> "$BROKEN_FILE" > if [[ $SEARCH_BROKEN ]]; then >- echo_v " broken $target_file (requires $MISSING_LIBS)" >+ echo_v " broken $target_file ( requires $( for LIB in $( sort <<< "$MISSING_LIBS" | uniq ); do echo -n "$LIB "; done ))" > else > echo_v " found $target_file" > fi > fi > fi >- fi >+ #fi > elif [[ $SEARCH_BROKEN ]]; then > # Look for broken .la files > la_SEARCH_DIRS="$SEARCH_DIRS" >@@ -741,7 +792,7 @@ main_checks() { > ); do > if [[ $depend = /* && ! -e $depend ]]; then > echo "obj $target_file" >> "$BROKEN_FILE" >- echo_v " broken $target_file (requires $depend)" >+ echo_v " broken $target_file (requires absolute dependency $depend)" > elif [[ $depend = -[LR]/* ]]; then > if ! [[ $'\n'${la_SEARCH_DIRS}$'\n' == *$'\n'${depend#-?}$'\n'* ]]; then > la_SEARCH_DIRS+=$'\n'"${depend#-?}" >@@ -755,6 +806,17 @@ main_checks() { > la_broken="no" > fi > done >+ if (( $running_on_irix )); then >+ for la_search_dir in /lib /lib32 /lib32/internal /lib32/mips4 /lib64 /lib64/mips4 \ >+ /usr/lib /usr/lib/abi /usr/lib/internal \ >+ /usr/lib32 /usr/lib32/internal /usr/lib32/mips3 /usr/lib32/mips4 \ >+ /usr/lib64 /usr/lib64/internal /usr/lib64/mips3 /usr/lib64/mips4 >+ do >+ if [[ -e ${la_search_dir}/${la_lib}.so || -e ${la_search_dir}/${la_lib}.a ]]; then >+ la_broken="no" >+ fi >+ done >+ fi > IFS="$OIFS" > if [[ $la_broken = yes ]]; then > echo "obj $target_file" >> "$BROKEN_FILE" >@@ -852,7 +914,7 @@ assign_packages_to_ebuilds() { > # Get the slot > PKG="${EXACT_PKG%%-r[[:digit:]]*}" > PKG="${PKG%-*}" >- SLOT=$(</var/db/pkg/$EXACT_PKG/SLOT) >+ SLOT=$(<$EPREFIX/var/db/pkg/$EXACT_PKG/SLOT) > echo "$PKG:$SLOT" > done < "$PKGS_FILE" > "$EBUILDS_FILE" > einfo "Generated new $EBUILDS_FILE" >@@ -988,37 +1050,37 @@ setup_search_paths_and_masks() { > > einfo "Configuring search environment for $APP_NAME" > >- # Update the incremental variables using /etc/profile.env, /etc/ld.so.conf, >- # portage, and the environment >+ # Update the incremental variables using $EPREFIX/etc/profile.env, >+ # $EPREFIX/etc/ld.so.conf, portage, and the environment > > # Read the incremental variables from environment and portage > # Until such time as portage supports these variables as incrementals >- # The value will be what is in /etc/make.conf >+ # The value will be what is in $EPREFIX/etc/make.conf > SEARCH_DIRS+=" "$(unset SEARCH_DIRS; portageq envvar SEARCH_DIRS) > SEARCH_DIRS_MASK+=" "$(unset SEARCH_DIRS_MASK; portageq envvar SEARCH_DIRS_MASK) > LD_LIBRARY_MASK+=" "$(unset LD_LIBRARY_MASK; portageq envvar LD_LIBRARY_MASK) > > # Add the defaults >- if [[ -d /etc/revdep-rebuild ]]; then >- for configfile in /etc/revdep-rebuild/*; do >+ if [[ -d $EPREFIX/etc/revdep-rebuild ]]; then >+ for configfile in $EPREFIX/etc/revdep-rebuild/*; do > SEARCH_DIRS+=" "$(. $configfile; echo $SEARCH_DIRS) > SEARCH_DIRS_MASK+=" "$(. $configfile; echo $SEARCH_DIRS_MASK) > LD_LIBRARY_MASK+=" "$(. $configfile; echo $LD_LIBRARY_MASK) > done > else >- SEARCH_DIRS+=" /bin /sbin /usr/bin /usr/sbin /lib* /usr/lib*" >- SEARCH_DIRS_MASK+=" /opt/OpenOffice /usr/lib/openoffice" >+ SEARCH_DIRS+=" $EPREFIX/bin $EPREFIX/sbin $EPREFIX/usr/bin $EPREFIX/usr/sbin $EPREFIX/lib* $EPREFIX/usr/lib*" >+ SEARCH_DIRS_MASK+=" $EPREFIX/opt/OpenOffice $EPREFIX/usr/lib/openoffice" > LD_LIBRARY_MASK+=" libodbcinst.so libodbc.so libjava.so libjvm.so" > fi > >- # Get the ROOTPATH and PATH from /etc/profile.env >- if [[ -r "/etc/profile.env" && -s "/etc/profile.env" ]]; then >- SEARCH_DIRS+=" "$(. /etc/profile.env; /usr/bin/tr ':' ' ' <<< "$ROOTPATH $PATH") >+ # Get the ROOTPATH and PATH from $EPREFIX/etc/profile.env >+ if [[ -r "$EPREFIX/etc/profile.env" && -s "$EPREFIX/etc/profile.env" ]]; then >+ SEARCH_DIRS+=" "$(. $EPREFIX/etc/profile.env; $EPREFIX/usr/bin/tr ':' ' ' <<< "$ROOTPATH $PATH") > fi > > # Get the directories from /etc/ld.so.conf >- if [[ -r /etc/ld.so.conf && -s /etc/ld.so.conf ]]; then >- SEARCH_DIRS+=" "$(sed '/^#/d;s/#.*$//' /etc/ld.so.conf) >+ if [[ -r $EPREFIX/etc/ld.so.conf && -s $EPREFIX/etc/ld.so.conf ]]; then >+ SEARCH_DIRS+=" "$(sed '/^#/d;s/#.*$//' $EPREFIX/etc/ld.so.conf) > fi > > # Set the final variables
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 278081
:
198219
|
216906