aboutsummaryrefslogtreecommitdiffstats
path: root/main/lddtree
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-02 08:57:35 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2014-04-02 08:57:35 +0200
commitdf9234e0a16f34faaa4b0753409216006dfe1a18 (patch)
treeebcef915f62b00cccadab4f8fb059a325844bfa2 /main/lddtree
parente9e3d94f2d54acac8b543ab49650fe28f4baf59a (diff)
downloadaports-df9234e0a16f34faaa4b0753409216006dfe1a18.tar.bz2
aports-df9234e0a16f34faaa4b0753409216006dfe1a18.tar.xz
main/lddtree: print resolved interp symlinks
otherwise we might get the symlink included in initramfs but not the file(s) that the symlinks points to.
Diffstat (limited to 'main/lddtree')
-rw-r--r--main/lddtree/0001-lddtree-print-resolved-interp-symlinks.patch86
-rw-r--r--main/lddtree/APKBUILD15
2 files changed, 96 insertions, 5 deletions
diff --git a/main/lddtree/0001-lddtree-print-resolved-interp-symlinks.patch b/main/lddtree/0001-lddtree-print-resolved-interp-symlinks.patch
new file mode 100644
index 0000000000..81d4951a42
--- /dev/null
+++ b/main/lddtree/0001-lddtree-print-resolved-interp-symlinks.patch
@@ -0,0 +1,86 @@
+From 0f78645bb0941639bbc11bf047326fb9d7f9292a Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 2 Apr 2014 08:54:00 +0200
+Subject: [PATCH] lddtree: print resolved interp symlinks
+
+---
+ lddtree.sh | 46 ++++++++++++++++++++++++----------------------
+ 1 file changed, 24 insertions(+), 22 deletions(-)
+
+diff --git a/lddtree.sh b/lddtree.sh
+index cb9db42..28c06d0 100644
+--- a/lddtree.sh
++++ b/lddtree.sh
+@@ -140,6 +140,28 @@ list_existing_file() {
+ fi
+ }
+
++# echo all intermediate symlinks and return the resolved path in
++# global variable _resolv_links
++resolv_links() {
++ _resolv_links="$1"
++ local oldpwd="$PWD"
++ list_existing_file "${_resolv_links}"
++ cd "${_resolv_links%/*}"
++ while [ -L "$_resolv_links" ]; do
++ _resolv_links=$(readlink "$_resolv_links")
++ case "$_resolv_links" in
++ /*) _resolv_links="${ROOT}${_resolv_links#/}"
++ cd "${_resolv_links%/*}"
++ ;;
++ */*) cd "${_resolv_links%/*}"
++ ;;
++ esac
++ _resolv_links=$(pwd -P)/${_resolv_links##*/}
++ list_existing_file "${_resolv_links}"
++ done
++ cd "$oldpwd"
++}
++
+ show_elf() {
+ local elf=$1 indent=$2 parent_elfs=$3
+ local rlib lib libs
+@@ -157,30 +179,10 @@ show_elf() {
+ esac
+ parent_elfs="${parent_elfs},${elf}"
+ if ${LIST} ; then
+- list_existing_file "${resolved:-$1}"
++ resolv_links "${resolved:-$1}"
+ else
+ printf "${resolved:-not found}"
+ fi
+- local oldpwd="$PWD"
+- cd "${resolved%/*}"
+- while [ -L "$resolved" ]; do
+- resolved=$(readlink "$resolved")
+- case "$resolved" in
+- /*) resolved="${ROOT}${resolved#/}"
+- cd "${resolved%/*}"
+- ;;
+- */*) cd "${resolved%/*}"
+- ;;
+- esac
+- resolved=$(pwd -P)/${resolved##*/}
+-
+- if ${LIST} ; then
+- list_existing_file "${resolved:-$1}"
+- else
+- printf "${resolved:-not found}"
+- fi
+- done
+- cd "$oldpwd"
+ if [ ${indent} -eq 0 ] ; then
+ elf_specs=$(elf_specs "${resolved}")
+ interp=$(scanelf -qF '#F%i' "${resolved}")
+@@ -189,7 +191,7 @@ show_elf() {
+ [ -n "${interp}" ] && interp="${ROOT}${interp#/}"
+
+ if ${LIST} ; then
+- [ -n "${interp}" ] && echo "${interp}"
++ [ -n "${interp}" ] && resolv_links "${interp}"
+ else
+ printf " (interpreter => ${interp:-none})"
+ fi
+--
+1.9.0
+
diff --git a/main/lddtree/APKBUILD b/main/lddtree/APKBUILD
index 14ef8b0d63..1ec2b6223b 100644
--- a/main/lddtree/APKBUILD
+++ b/main/lddtree/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lddtree
pkgver=1.25
-pkgrel=0
+pkgrel=1
pkgdesc="List dynamic dependencies as a tree"
url="https://github.com/ncopa/lddtree"
arch="noarch"
@@ -12,7 +12,9 @@ replaces="pax-utils"
makedepends="$depends_dev"
install=""
subpackages=""
-source="lddtree-$pkgver.tar.gz::https://github.com/ncopa/lddtree/archive/v$pkgver.tar.gz"
+source="lddtree-$pkgver.tar.gz::https://github.com/ncopa/lddtree/archive/v$pkgver.tar.gz
+ 0001-lddtree-print-resolved-interp-symlinks.patch
+ "
_builddir="$srcdir"/lddtree-$pkgver
prepare() {
@@ -34,6 +36,9 @@ package() {
install -Dm755 lddtree.sh "$pkgdir"/usr/bin/lddtree
}
-md5sums="ef9ba097371d41aa48c4b13d5bcb14e5 lddtree-1.25.tar.gz"
-sha256sums="e53c3ec6ae93f7e5caf9566ba2727f9cb383f4d239d5977b4e96d6628501cc14 lddtree-1.25.tar.gz"
-sha512sums="471a363292033592f4e0c5e32f68d79f37a9648b27d604dc78878726fa281c618a18ee2e92a0d3b7817ebdaf92f5af4a73eb33e53f8b48ee83ea98095150895c lddtree-1.25.tar.gz"
+md5sums="ef9ba097371d41aa48c4b13d5bcb14e5 lddtree-1.25.tar.gz
+fc518d16c5febcebcf9678c07362e021 0001-lddtree-print-resolved-interp-symlinks.patch"
+sha256sums="e53c3ec6ae93f7e5caf9566ba2727f9cb383f4d239d5977b4e96d6628501cc14 lddtree-1.25.tar.gz
+a35ca064c58ccba7b89715c158fab63b6d90f5ed76a271501f11d214312ba9ac 0001-lddtree-print-resolved-interp-symlinks.patch"
+sha512sums="471a363292033592f4e0c5e32f68d79f37a9648b27d604dc78878726fa281c618a18ee2e92a0d3b7817ebdaf92f5af4a73eb33e53f8b48ee83ea98095150895c lddtree-1.25.tar.gz
+11f05548053204979ca338b6310adae795d392f2ad0fb8c74f1b0dee289380b0e47d5f5da8a17e06d3f4389a927b14044570e584125e47dc0920b2b133b12ee9 0001-lddtree-print-resolved-interp-symlinks.patch"