summaryrefslogtreecommitdiffstats
path: root/find-libprovides.sh
diff options
context:
space:
mode:
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}"