summaryrefslogtreecommitdiffstats
path: root/find-libprovides.sh
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-08-08 16:23:00 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-08-08 16:23:00 +0200
commit259a313c819fef564bf0518a91285e2215cbefdb (patch)
tree99e73b714da7c9a6782545a25534a91894feb8a0 /find-libprovides.sh
parente50f2a53d718bc3a55162745ffb20464f16601b2 (diff)
downloadbin-259a313c819fef564bf0518a91285e2215cbefdb.tar.gz
bin-259a313c819fef564bf0518a91285e2215cbefdb.tar.xz
improve libdeps scripts a bit
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'find-libprovides.sh')
-rwxr-xr-xfind-libprovides.sh32
1 files changed, 25 insertions, 7 deletions
diff --git a/find-libprovides.sh b/find-libprovides.sh
index 2d9bd52..2005080 100755
--- a/find-libprovides.sh
+++ b/find-libprovides.sh
@@ -1,16 +1,31 @@
-#!/bin/sh
+#!/bin/bash
+
+set -e
+
+IGNORE_INTERNAL=0
+
+if [[ $1 = "--ignore-internal" ]]; then
+ IGNORE_INTERNAL=1
+ shift
+fi
if [[ -z $1 ]]; then
- echo "$(basename "$0") <package file>"
- exit 1
+ echo "$(basename "$0") [options] <package file|extracted package dir>"
+ echo "Options:"
+ echo " --ignore-internal ignore internal libraries"
+ exit 1
fi
-tmpdir=$(mktemp -d /tmp/find-sodeps.XXXXXXX)
-trap "rm -rf '$tmpdir'" EXIT INT TERM
+if [[ -d $1 ]]; then
+ cd $1
+else
+ tmpdir=$(mktemp -d /tmp/find-sodeps.XXXXXXX)
+ trap "rm -rf '$tmpdir'" EXIT INT TERM
-tar -C $tmpdir -xf "$1"
+ tar -C $tmpdir -xf "$1"
-cd $tmpdir
+ cd $tmpdir
+fi
in_array() {
local needle=$1; shift
@@ -35,6 +50,9 @@ do
soname="${sofile%%\.so\.*}.so"
# extract the major version: 1
soversion="${sofile##*\.so\.}"
+ if [[ "$soversion" = "$sofile" ]] && (($IGNORE_INTERNAL)); then
+ continue
+ fi
if ! in_array "${soname}=${soversion}-${soarch}" ${soprovides[@]}; then
# libfoo.so=1-64
echo "${soname}=${soversion}-${soarch}"