Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 123953 Details for
Bug 184291
scanelf-packagecheck (potential app-portage/gentoolkit: revdep-rebuild replacement)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
scanelf-packagecheck-0.01
scanelf-rebuild.sh (text/plain), 4.65 KB, created by
michael@smith-li.com
on 2007-07-05 13:07:39 UTC
(
hide
)
Description:
scanelf-packagecheck-0.01
Filename:
MIME Type:
Creator:
michael@smith-li.com
Created:
2007-07-05 13:07:39 UTC
Size:
4.65 KB
patch
obsolete
>#!/bin/bash ># Spit out a portage-compatible list of packages to build because of lib ># breakages. > >print_usage() { >cat << EOF >Usage: $0 [OPTIONS] > >Lists packages broken by library changes, upgrades, and missing dependencies. > > -h, --help Print this usage > -e, --exact Emerge based on exact package version > -q, --quiet Be less verbose (also passed to emerge command) > -u, --no-util UTIL Do not use features provided by UTIL > --no-util=UTIL UTIL can be one of portage-utils, pkgcore, or equery > 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 > regular expression (man grep) > -b, --check-linking Check dynamic linking for binaries > -l, --check-libtool Check *.la files for missing dependencies > >Calls emerge, all other options are used for it (e. g. -p, --pretend). > >Report bugs to <http://bugs.gentoo.org> >EOF >} >get_missing_sonames() { > local soname IFS=$'\n,' list=($(scanelf -BLpF%n#F)) > list=($(sort -u <<< "${list[*]}")) > for soname in ${list[@]}; do > [[ -e $soname ]] || echo $soname > done | sort -u >} >check_bins() { > local missing_sonames broken_pkgs bin libs pv p > missing_sonames=$(get_missing_sonames) > if [[ $missing_sonames ]] && > broken_pkgs=$(scanelf -LBpF "%F %n" | grep -F "$missing_sonames"); then > get_packages $( > while read bin libs; do > feedback=$(grep -oF "$missing_sonames" <<< "$libs") > feedback="${feedback##[[:space:]]}"; feedback="${feedback%%[[:space:]]}" > echo "$bin is missing ${feedback//[[:space:]]/ and }" >&2 > echo "$bin" > done <<< "$broken_pkgs" > ) | sort -u | slot > else > echo "Dynamic linking is consistent" >&2 > fi >} >get_all_las() { > local IFS paths > paths=( > /lib* > /usr/lib* > $(sed '/^#/d;s/#.*$//' < /etc/ld.so.conf | tr -s '/') > $(scanelf -BlpF%F | sed 's:/[^/]*$::' | tr -s '/') > ) > IFS=$'\n' > paths=($(sort -u <<< "${paths[*]%/}")) > find -L ${paths[@]} -type f -name '*.la' 2> /dev/null | sort -u >} >get_dependency_libs() { > awk -F"[=']" '/^dependency_libs/{ > gsub("^-[^[:space:]]*", "", $NF); > gsub("[[:space:]]-[^[:space:]]*", "", $NF); > print $NF > }' "$@" >} >check_las() { > local oIFS="$IFS" > local IFS > local broken_las=($( > while read la; do > deps=($(get_dependency_libs "$la")) > (( ${#deps[@]} > 0)) || continue > IFS=$'\n' > deps=($(sort -u <<< "${deps[*]}")) > IFS="$oIFS" > for dep in ${deps[@]}; do > [[ $dep = /* && ! -e $dep ]] || continue > echo "$la is missing $dep" >&2 > echo "$la" > done > done < <(get_all_las) | sort -u > )) > IFS=$'\n' > if (( ${#broken_las[@]} > 0)); then > get_packages <<< "${broken_las[*]}" | sort -u | slot > else > echo "No dependencies missing from .la files" >&2 > fi >} >slot() { > while read pv; do > p="${pv%%-r[[:digit:]]*}" > p="${p%-*}" > echo "$p:$(</var/db/pkg/$pv/SLOT)" > done >} >get_opts(){ > local x > while getopts "behlqL:u:" opt; do > case "$opt" in > L) SONAME="$OPTARG"; unset SEARCH_BROKEN;; > b) checks+=(linking);; > e) unset PACKAGE_NAMES;; > h) print_usage; exit 0;; > l) checks+=(libtool);; > q) quiet=1; EMERGE_OPTIONS+=" $opt";; > u) avoid_utils+=" $opt ";; # TODO: Check validity > esac > x=$OPTIND > done > shift $((x-1)) >} >validate_arg() { > [[ $1 && $1 != -* ]] || die 1 "Missing expected argument to $1" >} >get_args() { > declare avoid_utils checks > if [[ ! $1 ]]; then print_usage; exit 0; fi > while [[ $1 ]]; do > case $1 in > -[^-]*) get_opts "$1";; > --help) print_usage; exit 0;; > --exact) slot() { while read pv; do echo "=$pv"; done };; > --quiet) quiet=1;; > --library=*) search_lib="${1#*=}";; > --library) validate_arg "$1"; shift; search_lib="$1";; > --no-util=*) avoid_utils+=" ${1#*=} ";; # TODO: Check validity > --no-util) validate_arg "$1"; shift; avoid_utils+=" $1 ";; > --check-linking) checks+=(linking);; > --check-libtool) checks+=(libtool);; > --) break;; > *) echo "Invalid parameter $1:" >&2; print_usage; exit 1;; > esac > shift > done > if [[ avoid_utils != *portage-utils* ]] && hash qfile 2> /dev/null; then > get_packages() { qfile -qvC "$@"; } > elif [[ avoid_utils != *pkgcore* ]] && hash pquery 2> /dev/null; then > get_packages() { local IFS=,; pquery --nocolor --owns="$*"; } > elif [[ avoid_utils != *equery* ]] && hash equery 2> /dev/null; then > get_packages() { equery -q -C b $@; } > else > get_packages() { > local IFS=$'\n' > find /var/db/pkg -name CONTENTS -print0 | > xargs -0 grep -Fl "$*" | > sed 's:/var/db/pkg/\(.*\)/CONTENTS:=\1:' > } > fi > for check in ${checks[@]}; do > case $check in > linking) check_bins;; > libtool) check_las;; > esac > done >} >get_args "$@"
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 184291
:
123953
|
123972
|
124023
|
124181
|
133151
|
133229
|
135793