Commit f555a715 authored by Natanael Copa's avatar Natanael Copa

main/lddtree: upgrade to 1.26

parent 0c1e8d47
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
From 10fa89cfedf1cdf826a3ded8fe2362ac02311240 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 21 Apr 2015 21:32:06 +0200
Subject: [PATCH] lddtree: remove bashism
Fixes #1. "Bad substitution" when running in dash.
---
lddtree.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lddtree.sh b/lddtree.sh
index 28c06d0..1968d08 100755
--- a/lddtree.sh
+++ b/lddtree.sh
@@ -1,8 +1,8 @@
#!/bin/sh
# Copyright 2007-2013 Gentoo Foundation
# Copyright 2007-2013 Mike Frysinger <vapier@gentoo.org>
+# Copyright 2014-2015 Natanael Copa <ncopa@alpinelinux.org>
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/pax-utils/lddtree.sh,v 1.22 2013/04/07 19:20:09 vapier Exp $
argv0=${0##*/}
version=1.25
@@ -216,7 +216,12 @@ show_elf() {
allhits="${allhits},${interp},${libs}"
fi
- for lib in ${libs//,/ } ; do
+ oifs="$IFS"
+ IFS=,
+ set -- ${libs}
+ IFS="$oifs"
+
+ for lib; do
lib=${lib##*/}
case ",${my_allhits}," in
*,${lib},*) continue;;
--
2.8.3
# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lddtree pkgname=lddtree
pkgver=1.25 pkgver=1.26
pkgrel=2 pkgrel=0
pkgdesc="List dynamic dependencies as a tree" pkgdesc="List dynamic dependencies as a tree"
url="https://github.com/ncopa/lddtree" url="https://github.com/ncopa/lddtree"
arch="noarch" arch="noarch"
...@@ -13,8 +13,6 @@ makedepends="$depends_dev" ...@@ -13,8 +13,6 @@ makedepends="$depends_dev"
install="" install=""
subpackages="" 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
0001-lddtree-remove-bashism.patch
" "
_builddir="$srcdir"/lddtree-$pkgver _builddir="$srcdir"/lddtree-$pkgver
...@@ -37,12 +35,4 @@ package() { ...@@ -37,12 +35,4 @@ package() {
install -Dm755 lddtree.sh "$pkgdir"/usr/bin/lddtree install -Dm755 lddtree.sh "$pkgdir"/usr/bin/lddtree
} }
md5sums="ef9ba097371d41aa48c4b13d5bcb14e5 lddtree-1.25.tar.gz sha512sums="9c244cf47627e6cfb396f4187e7c35b438bcb8e3978e43a91ad5a5d034233eaaffd1319e98b6a26b8bbcb570ede3eeb809a14720b50771587a96dde5f6516340 lddtree-1.26.tar.gz"
fc518d16c5febcebcf9678c07362e021 0001-lddtree-print-resolved-interp-symlinks.patch
bf882ddabd2c6e8d983c723457b24684 0001-lddtree-remove-bashism.patch"
sha256sums="e53c3ec6ae93f7e5caf9566ba2727f9cb383f4d239d5977b4e96d6628501cc14 lddtree-1.25.tar.gz
a35ca064c58ccba7b89715c158fab63b6d90f5ed76a271501f11d214312ba9ac 0001-lddtree-print-resolved-interp-symlinks.patch
3b9a5a273f88661e6317c8d86f5fd81e4a5f7f0cd75f6d24de1bf83c75441133 0001-lddtree-remove-bashism.patch"
sha512sums="471a363292033592f4e0c5e32f68d79f37a9648b27d604dc78878726fa281c618a18ee2e92a0d3b7817ebdaf92f5af4a73eb33e53f8b48ee83ea98095150895c lddtree-1.25.tar.gz
11f05548053204979ca338b6310adae795d392f2ad0fb8c74f1b0dee289380b0e47d5f5da8a17e06d3f4389a927b14044570e584125e47dc0920b2b133b12ee9 0001-lddtree-print-resolved-interp-symlinks.patch
40bd32d3d669a9170b5c4f5f9c4d47b74b7fdfeb1ad195bc12b1650453826100a70d8b1aed15d4f3a8b4f317f85ffcd1ca80132631e361595c6c0a85eee505c5 0001-lddtree-remove-bashism.patch"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment