From 464cde2ea729114c11f650db520c0fb0ad0f0274 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Fri, 7 Feb 2014 11:02:57 -0500 Subject: [PATCH] accept symlinks as arguments --- developer/bin/list_apps_in_pkg | 3 +++ developer/bin/list_id_in_kext | 3 +++ developer/bin/list_ids_in_app | 3 +++ developer/bin/list_ids_in_pkg | 3 +++ 4 files changed, 12 insertions(+) diff --git a/developer/bin/list_apps_in_pkg b/developer/bin/list_apps_in_pkg index 5ebfe123a3..f611561f6e 100755 --- a/developer/bin/list_apps_in_pkg +++ b/developer/bin/list_apps_in_pkg @@ -118,6 +118,9 @@ See CONTRIBUTING.md and 'man pkgutil' for more information. die "ERROR: Unknown argument '$arg'" fi done + if [[ -h "$opt_pkg" ]]; then + opt_pkg="$(/usr/bin/readlink "$opt_pkg")" + fi if ! [[ -e "$opt_pkg" ]]; then die "ERROR: No such pkg file: '$opt_pkg'" fi diff --git a/developer/bin/list_id_in_kext b/developer/bin/list_id_in_kext index 0d946c3ae0..8050a05f18 100755 --- a/developer/bin/list_id_in_kext +++ b/developer/bin/list_id_in_kext @@ -48,6 +48,9 @@ mark_up_sources () { _list_id_in_kext () { kextdir="$1" + if [[ -h "$kextdir" ]]; then + kextdir="$(/usr/bin/readlink "$kextdir")" + fi { # emit strings that look like bundle ids diff --git a/developer/bin/list_ids_in_app b/developer/bin/list_ids_in_app index a99f0a5086..bc4af90524 100755 --- a/developer/bin/list_ids_in_app +++ b/developer/bin/list_ids_in_app @@ -114,6 +114,9 @@ mark_up_sources () { _list_ids_in_app () { appdir="$1" + if [[ -h "$appdir" ]]; then + appdir="$(/usr/bin/readlink "$appdir")" + fi { # emit strings that look like bundle ids diff --git a/developer/bin/list_ids_in_pkg b/developer/bin/list_ids_in_pkg index daec30978c..cdefaff879 100755 --- a/developer/bin/list_ids_in_pkg +++ b/developer/bin/list_ids_in_pkg @@ -56,6 +56,9 @@ _list_ids_in_pkg () { if [[ -d "$1" ]]; then pkgdir="$1" + if [[ -h "$pkgdir" ]]; then + pkgdir="$(/usr/bin/readlink "$pkgdir")" + fi else local tmpdir=`/usr/bin/mktemp -d -t list_ids_in_pkg` trap "/bin/rm -rf -- '$tmpdir'" EXIT