Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 124760 Details for
Bug 184042
app-portage/gentoolkit - refactored revdep-rebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
revdep-rebuild.patch
revdep-rebuild.patch (text/plain), 6.02 KB, created by
michael@smith-li.com
on 2007-07-13 18:53:06 UTC
(
hide
)
Description:
revdep-rebuild.patch
Filename:
MIME Type:
Creator:
michael@smith-li.com
Created:
2007-07-13 18:53:06 UTC
Size:
6.02 KB
patch
obsolete
>--- revdep-rebuild.orig 2007-07-10 14:57:28.000000000 -0400 >+++ revdep-rebuild 2007-07-13 14:48:55.000000000 -0400 >@@ -84,7 +84,7 @@ > -q, --quiet Be less verbose (also passed to emerge command) > -v, --verbose Be more verbose > -u, --no-util UTIL Do not use features provided by UTIL >- --no-util=UTIL UTIL can be one of portage-utils, pkgcore, or equery >+ --no-util=UTIL UTIL can be one of portage-utils or pkgcore > or it can be a *quoted* space-delimited list. > -L, --library NAME Emerge existing packages that use the library with NAME > --library=NAME NAME can be a full path to the library or a basic >@@ -110,6 +110,9 @@ > progress $@ > fi > } >+# Get the name of a package owning a file on the filesystem using one of several >+# utilities: This is a placeholder. The function is defined in get_args() >+get_file_owner() { :; } > # Replace whitespace with linebreaks, normalize repeated '/' chars, and sort -u > # (If any libs have whitespace in their filenames, someone needs punishment.) > clean_var() { >@@ -129,8 +132,9 @@ > # What to do when dynamic linking is consistent > clean_exit() { > [[ $KEEP_TEMP ]] || rm $LIST.?_* >- set_color green >- die 0 $'\n'"$OK_TEXT... All done. " >+ echo >+ einfo "$OK_TEXT... All done. " >+ exit 0 > } > get_args() { > appname="${0##*/}" >@@ -204,12 +208,20 @@ > shift > done > # Check if various utils are allowed and installed >- if [[ $avoid_utils != *portage-utils* ]] && hash q 2> /dev/null; then >- PORTAGE_UTILS=1 >+ if [[ $avoid_utils != *portage-utils* ]] && hash qfile 2> /dev/null; then >+ get_file_owner() { qfile -qvC "$@"; } > elif [[ $avoid_utils != *pkgcore* ]] && hash pquery 2> /dev/null; then >- PKGCORE=1 >- elif [[ $avoid_utils != *equery* ]] && hash equery 2> /dev/null; then >- EQUERY=1 >+ get_file_owner() { local IFS=,; pquery --nocolor --owns="$*"; } >+ # equery disabled for incompatibility with modern portage. >+ # elif [[ $avoid_utils != *equery* ]] && hash equery 2> /dev/null; then >+ # get_file_owner() { equery -q -C b $@; } >+ else >+ get_file_owner() { >+ local IFS=$'\n' >+ find /var/db/pkg -name CONTENTS -print0 | >+ xargs -0 grep -Fl "$*" | >+ sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:' >+ } > fi > EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]/%-p/--pretend}) > EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]/%-f/--fetchonly}) >@@ -317,14 +329,12 @@ > # Set to "<tab>$SONAME<space>" > SONAME_SEARCH=$'\t'"$SONAME " > fi >- # NOTE: Using a redirect instead of echo is good, but it will cause a minor >- # incompatibility with older versions of revdep-rebuild, because the >- # string sent to md5sum will no longer have a newline at the end. >- SOMD5=$(md5sum <<< "$SONAME_SEARCH$SONAME") >- LIST+="_${SOMD5:0:8}" >+ local uuid="${SONAME##*/}" >+ uuid="${uuid//[[:space:]]}" >+ LIST+="_$uuid" > HEAD_TEXT="using $SONAME" > OK_TEXT="There are no dynamic links to $SONAME" >- unset WORKING_TEXT SOMD5 >+ unset WORKING_TEXT > fi > > [[ $LIST ]] || die 1 $LIST IS NOT DEFINED >@@ -339,6 +349,9 @@ > # Compare old and new environments > # Don't use our previous files if environment doesn't match > new_env=$( >+ # We don't care if these options change >+ EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]//--pretend/}) >+ EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]//--fetchonly/}) > cat <<- EOF > SEARCH_DIRS="$SEARCH_DIRS" > SEARCH_DIRS_MASK="$SEARCH_DIRS_MASK" >@@ -519,19 +532,7 @@ > set_trap "$LIST.4_packages*" > rm -f $LIST.4* > while read obj FILE; do >- if [[ $PORTAGE_UTILS ]]; then >- EXACT_PKG=$(qfile -qvC $FILE) >- elif [[ $PKGCORE ]]; then >- EXACT_PKG=$(pquery --nocolor --owns="$FILE") >- elif [[ $EQUERY ]]; then >- EXACT_PKG=$(equery -q -C b $FILE) >- else >- EXACT_PKG=$( >- find /var/db/pkg -name CONTENTS | >- xargs grep -Fl "obj $FILE " | >- sed -e 's:/var/db/pkg/\(.*\)/CONTENTS:\1:g' >- ) >- fi >+ EXACT_PKG=$(get_file_owner $FILE) > if [[ $EXACT_PKG ]]; then > # Strip version information > PKG="${EXACT_PKG%%-r[[:digit:]]*}" >@@ -547,6 +548,19 @@ > done < "$LIST.3_rebuild" > einfo "Generated new $LIST.4_packages_raw and $LIST.4_package_owners" > fi >+ # if we find '(none)' on every line, exit out >+ if ! grep -qvF '(none)' "$LIST.4_package_owners"; then >+ ewarn "Found some broken files, but none of them were associated with known packages" >+ ewarn "Unable to proceed with automatic repairs." >+ ewarn "The broken files are listed in $LIST.4_package_owners" >+ if [[ $VERBOSE ]]; then >+ ewarn "The broken files are:" >+ while read filename junk; do >+ ewarn " $filename" >+ done < "$LIST.4_package_owners" >+ fi >+ exit 0 # FIXME: Should we exit 1 here? >+ fi > } > clean_packages() { > einfo 'Cleaning list of packages to rebuild' >@@ -583,19 +597,7 @@ > elif [[ -rs $LIST.3_rebuild ]]; then > rebuildList=" $(<"$LIST.3_rebuild") " > rebuildList=(${rebuildList//[[:space:]]obj[[:space:]]/ }) >- if [[ $PORTAGE_UTILS ]]; then >- qfile -qvC ${rebuildList[@]} >- elif [[ $PKGCORE ]]; then >- IFS=, >- pquery --nocolor --owns="${rebuildList[*]}" >- IFS="$oIFS" >- elif [[ $EQUERY ]]; then >- equery -q -C b ${rebuildList[@]} >- else >- find /var/db/pkg -name CONTENTS | >- xargs grep -Fl "$rebuildList" | >- sed 's:/var/db/pkg/\(.*\)/CONTENTS:=\1:' >- fi > $LIST.4_ebuilds >+ get_file_owner "${rebuildList[@]}" > $LIST.4_ebuilds > einfo "Generated new $LIST.4_ebuilds" > else > einfo 'Nothing to rebuild.' >@@ -729,6 +731,18 @@ > einfo 'You can re-run revdep-rebuild to verify that all libraries and binaries' > einfo 'are fixed. If some inconsistency remains, it can be orphaned file, deep' > einfo 'dependency, binary package or specially evaluated library.' >+ [[ $KEEP_TEMP ]] || rm $LIST*.?_* > else > einfo 'Now you can remove -p (or --pretend) from arguments and re-run revdep-rebuild.' > fi >+ >+if grep -qF '(none)' "$LIST.4_package_owners"; then >+ ewarn "Found some broken files that weren't associated with known packages" >+ ewarn "The broken files are listed in $LIST.4_package_owners" >+ if [[ $VERBOSE ]]; then >+ ewarn "The broken files are:" >+ while read filename junk; do >+ [[ junk = *none* ]] && ewarn " $filename" >+ done < "$LIST.4_package_owners" >+ fi >+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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 184042
:
123727
|
123795
|
123821
|
124074
|
124178
|
124343
|
124352
|
124370
|
124464
|
124466
|
124474
|
124489
|
124704
|
124760
|
125088
|
125136
|
125180
|
125187
|
125206
|
125347
|
125349
|
125357
|
125494
|
129344