summaryrefslogtreecommitdiff
path: root/src/devtools/find-libdeps.in
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-05-02 15:06:04 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-05-02 15:06:04 -0400
commit962250da23024224fc9e0be782b16ae08df46671 (patch)
tree2cc17939d6fc064b65eb3ce20e43ba49565d925c /src/devtools/find-libdeps.in
parentbf2e3833c4158c8ec94e6af621f7d50d11353957 (diff)
Update for the new devtools-par (major)
* `src/devtools`: Redo to get devtools from another location, and patch it * `src/chroot-tools/{chcleanup,chroot.conf}`: Only install 'base-devel' by default * libremkchroot: deprecate in favor of `librechroot make` * librechroot: - redo option parsing to be a "sub-command" (git-like) interface, instead of having esoteric flags (pacman-like). - add more documentation. - allow COPY to be an absolute path - generally clean up and use updated functions from `makechrootpkg.sh` * libremakepkg: - allow COPY to be an absolute path - update to work with the new `makechrootpkg.sh`: - `makechrootpkg.sh:chroot_exec()` -> `libremakepkg:run()` - `makechrootpkg.sh:chroot_init()` -> `libremakepkg:chroot_init()` - All functions from `makechrootpkg.sh` are wrapped, because they don't work with `set -euE`. - Other small changes
Diffstat (limited to 'src/devtools/find-libdeps.in')
-rw-r--r--src/devtools/find-libdeps.in87
1 files changed, 0 insertions, 87 deletions
diff --git a/src/devtools/find-libdeps.in b/src/devtools/find-libdeps.in
deleted file mode 100644
index 7618850..0000000
--- a/src/devtools/find-libdeps.in
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-
-source @pkgdatadir@/common.sh
-
-set -e
-shopt -s extglob
-
-IGNORE_INTERNAL=0
-
-if [[ $1 = "--ignore-internal" ]]; then
- IGNORE_INTERNAL=1
- shift
-fi
-
-script_mode=${0##*/find-lib}
-
-case $script_mode in
- deps|provides) true;;
- *) die "Unknown mode $script_mode" ;;
-esac
-
-if [[ -z $1 ]]; then
- echo "${0##*/} [options] <package file|extracted package dir>"
- echo "Options:"
- echo " --ignore-internal ignore internal libraries"
- exit 1
-fi
-
-if [[ -d $1 ]]; then
- pushd $1 >/dev/null
-else
- setup_workdir
-
- case ${script_mode} in
- deps) bsdtar -C $WORKDIR -xf "$1";;
- provides) bsdtar -C $WORKDIR -xf "$1" --include="*.so*";;
- esac
-
- pushd $WORKDIR >/dev/null
-fi
-
-process_sofile() {
- # extract the library name: libfoo.so
- soname="${sofile%.so?(+(.+([0-9])))}".so
- # extract the major version: 1
- soversion="${sofile##*\.so\.}"
- if [[ "$soversion" = "$sofile" ]] && (($IGNORE_INTERNAL)); then
- continue
- fi
- if ! in_array "${soname}=${soversion}-${soarch}" ${soobjects[@]}; then
- # libfoo.so=1-64
- echo "${soname}=${soversion}-${soarch}"
- soobjects=(${soobjects[@]} "${soname}=${soversion}-${soarch}")
- fi
-}
-
-case $script_mode in
- deps) find_args="-perm -u+x";;
- provides) find_args="-name *.so*";;
-esac
-
-find . -type f $find_args | while read filename; do
- if [[ $script_mode = "provides" ]]; then
- # ignore if we don't have a shared object
- if ! LC_ALL=C readelf -h "$filename" 2>/dev/null | grep -q '.*Type:.*DYN (Shared object file).*'; then
- continue
- fi
- fi
-
- # get architecture of the file; if soarch is empty it's not an ELF binary
- soarch=$(LC_ALL=C readelf -h "$filename" 2>/dev/null | sed -n 's/.*Class.*ELF\(32\|64\)/\1/p')
- [[ -n $soarch ]] || continue
-
- if [[ $script_mode = "provides" ]]; then
- # get the string binaries link to: libfoo.so.1.2 -> libfoo.so.1
- sofile=$(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -n 's/.*Library soname: \[\(.*\)\].*/\1/p')
- [[ -z $sofile ]] && sofile="${filename##*/}"
- process_sofile
- elif [[ $script_mode = "deps" ]]; then
- # process all libraries needed by the binary
- for sofile in $(LC_ALL=C readelf -d "$filename" 2>/dev/null | sed -nr 's/.*Shared library: \[(.*)\].*/\1/p'); do
- process_sofile
- done
- fi
-done
-
-popd >/dev/null