mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 18:13:08 +02:00
Merge branch '279-libstd-add-functions-to-search-shared-executables-and-libraries' into 'master'
Resolve "libstd: add functions to search shared executables and libraries" Closes #279 See merge request Pmodules/src!257
This commit is contained in:
@@ -343,6 +343,26 @@ std::is_member_of_array(){
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
std::find_executables(){
|
||||
${find} "$@" -type f -printf "%i %P\n" | \
|
||||
${sort} -n -k1 -u | \
|
||||
${awk} '{print $2}' | \
|
||||
${file} -f - | \
|
||||
${awk} '$2 ~ /ELF/ && $3 ~ /64-bit/ && $5 ~ /executable/ {print substr($1, 1, length($1)-1)}'
|
||||
}
|
||||
|
||||
std::find_shared_objects(){
|
||||
${find} "$@" -type f -printf "%i %P\n" | \
|
||||
${sort} -n -k1 -u | \
|
||||
${awk} '{print $2}' | \
|
||||
${file} -f - | \
|
||||
${awk} '$2 ~ /ELF/ && $3 ~ /64-bit/ && $5 ~ /shared/ && $6 ~ /object/ {print substr($1, 1, length($1)-1)}'
|
||||
}
|
||||
|
||||
std::get_dir_depth(){
|
||||
echo "$1" | ${grep} -o / | wc -l
|
||||
}
|
||||
# Local Variables:
|
||||
# mode: sh
|
||||
# sh-basic-offset: 8
|
||||
|
||||
Reference in New Issue
Block a user