blob: db6f99a79f850c46d197e51c96a42fb483d8e3ab (
plain) (
tree)
|
|
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: root
# Purpose:
#
HOMEPAGE="http://formilux.org"
function unpack_plist ()
{
[ $# -ne 2 ] \
&& die "unpack_plist <category> <dst>"
local cat=$1
local dst="$2"
[ ! -d "$dst" ] \
&& mkdir -p "$dst"
local t
[ -e "$PORTAGE_CONFIGROOT/etc/portage/plist/${cat}/transform" ] \
&& t=(
$(< $PORTAGE_CONFIGROOT/etc/portage/plist/${cat}/transform)
)
find "$PORTAGE_CONFIGROOT/etc/portage/plist/${cat}" \
-mindepth 2 -maxdepth 2 \
-type f -printf '%P\n' | sort \
| while read ; do
[ "$(best_version ~$REPLY)" != "$REPLY" ] \
&& ewarn "You should update $PORTAGE_CONFIGROOT/etc/portage/plist/${cat}/$REPLY"
[ ! -e "$PKGDIR/${REPLY}.tbz2" ] \
&& die "Can't find $PKGDIR/${REPLY}.tbz2"
einfo "Extracting ${REPLY} ..."
qtbz2 --tarbz2 -O "$PKGDIR/${REPLY}.tbz2" \
| tar xvpj --atime-preserve --show-transformed-names \
-C "$dst" \
-T "$PORTAGE_CONFIGROOT/etc/portage/plist/${cat}/${REPLY}" \
${t[@]/#/--transform } \
| while read ; do
einfo " $REPLY"
done
done
}
function check_symbol ()
{
[ $# -ne 1 ] \
&& die "chk_dep <fs dir>"
local dir="$1"
[ ! -d "$dir" ] \
&& die "fs dir $dir does not exist"
mkdir NEEDED SONAME
einfo "Checking NEEDED and SONAME mismatches ..."
scanelf -RqBn "$dir" \
| sed -e "s;$dir/;;" \
| awk '{
size=split($1,libs,",")
for (i = 1 ; i <= size ; i++) {
print $2 >> "'NEEDED/'"libs[i]
}
}'
scanelf -RqBS "$dir" \
| sed -e "s;dir/;;" \
| awk '{
size=split($1,libs,",")
for (i = 1 ; i <= size ; i++) {
print $2 >> "'SONAME/'"libs[i]
}
}'
diff -Nu \
<(find SONAME -mindepth 1 \
-printf '%f\n' \
| sort) \
<(find NEEDED -mindepth 1 \
-printf '%f\n' \
| sort) \
| egrep '^(\-|\+)[a-zA-Z0-9]' \
| while read ; do
case ${REPLY:0:1} in
-) ewarn "${REPLY:1} is needed by nothing" ;;
+) ewarn "${REPLY:1} is missing but needed by :"
cat NEEDED/${REPLY:1}
;;
esac
done
# | fgrep -v \
# -f /etc/portage/crossdev/libdl.lst \
# -f /etc/portage/crossdev/lib-nosoname.lst \
}
function big_compress ()
{
[ $# -ne 1 ] \
&& die "big_compress <dir>"
find ${1} -type d -name bin -or -name sbin \
| xargs --no-run-if-empty -I {} -- \
find {} -type f \
| xargs --no-run-if-empty -- \
scanelf -mBF '%F' \
| xargs --no-run-if-empty -- \
sstrip -z
}
|