accept symlinks as arguments

This commit is contained in:
Roland Walker
2014-02-07 11:02:57 -05:00
parent c0b016d2aa
commit 464cde2ea7
4 changed files with 12 additions and 0 deletions
+3
View File
@@ -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
+3
View File
@@ -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
+3
View File
@@ -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
+3
View File
@@ -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