Skip to content

Commit

Permalink
make identify position independent (niklasb#31)
Browse files Browse the repository at this point in the history
* make identify position independent

* readlink before chdir
  • Loading branch information
152334H authored Sep 6, 2020
1 parent d69f04c commit 4a8b202
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions identify
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
set -o pipefail
cd "$(dirname "$0")"
help() {
echo >&2 "Usage: $0 path/to/libc.so"
echo >&2 " OR $0 bid=<BUILD_ID>"
Expand All @@ -16,8 +15,13 @@ fi

arg="$1"

if [[ -f "$arg" ]]; then
libc=$arg
if [ -f "$arg" ]; then
libc="$(readlink -f "$arg")"
fi

cd "$(dirname "$0")"

if [[ -f "$libc" ]]; then
arg="sha1=$(sha1sum "$libc" | awk '{print $1}')"
fi

Expand Down

0 comments on commit 4a8b202

Please sign in to comment.