-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated with a script to list all the unique dependencies in the nati…
…ve libraries and executables.
- Loading branch information
Showing
2 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Check if the directory is provided as an argument | ||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <path_to_search>" | ||
exit 1 | ||
fi | ||
|
||
# Directory to search (provided as an argument) | ||
SEARCH_DIR="$1" | ||
|
||
# Temporary file to store all dependencies | ||
TEMP_FILE=$(mktemp) | ||
|
||
# Find all executables and .so files | ||
find "$SEARCH_DIR" -type f -not -name "*.dll" | while read -r file; do | ||
if file "$file" | grep -qE 'ELF|executable'; then | ||
# List dependencies using ldd and append to TEMP_FILE | ||
# echo "Processing $file..." | ||
ldd "$file" 2>/dev/null | awk '{print $1}' | xargs -n1 basename >> "$TEMP_FILE" | ||
fi | ||
done | ||
|
||
# Sort and deduplicate the dependencies | ||
sort -u "$TEMP_FILE" | ||
|
||
# Clean up temporary file | ||
rm -f "$TEMP_FILE" | ||
|