summaryrefslogtreecommitdiff
path: root/util/nmedit
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-06-28 18:45:02 +0000
committerJay Freeman <saurik@saurik.com>2008-06-28 18:45:02 +0000
commitecc34bcfbf6fedbd87f34c8b1b263e2aa8141abd (patch)
treee3851afc1137d8fc43d773fa238823e07a862ba6 /util/nmedit
parent56af309dadc4a25af2cb5f31b55202de39c7ed6c (diff)
Made nmedit deterministic.
git-svn-id: http://svn.telesphoreo.org/trunk@345 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'util/nmedit')
-rwxr-xr-xutil/nmedit30
1 files changed, 30 insertions, 0 deletions
diff --git a/util/nmedit b/util/nmedit
new file mode 100755
index 000000000..674579e73
--- /dev/null
+++ b/util/nmedit
@@ -0,0 +1,30 @@
+#!/bin/bash
+base=$(basename "$0")
+if [[ $0 == */* ]]; then
+ self=${0}
+else
+ self=$(which "$0")
+fi
+self=$(realpath "${self}")
+which -a "${base}" | while read -r fake; do
+ real=$(realpath "${fake}")
+ if [[ ${real} != ${self} ]]; then
+ "${real}" "$@"
+ break
+ fi
+done
+declare -a file
+while [[ $# -ne 0 ]]; do
+ case "$1" in
+ (-s) shift;;
+ (-o) outp=$2; break;;
+ (*) file[${#file[@]}]=$1;;
+ esac; shift
+done
+if [[ -n "${outp}" ]]; then
+ ldid -T- "${outp}"
+else
+ for mach in "${file[@]}"; do
+ ldid -T- "${mach}"
+ done
+fi