Browse Source

remove ) from results

feature/dst-changes
Daniel Gibbs 4 months ago
parent
commit
057027ff88
  1. 10
      lgsm/modules/command_dev_detect_glibc.sh

10
lgsm/modules/command_dev_detect_glibc.sh

@ -46,11 +46,11 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do
glibc_check_files=$(find "${glibc_check_dir}" | wc -l)
find "${glibc_check_dir}" -type f -print0 \
| while IFS= read -r -d $'\0' line; do
glibcversion=$(objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1)
glibcversion=$(objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1 | sed 's/)$//')
if [ "${glibcversion}" ]; then
echo -e "${glibcversion}: ${line}" >> "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp"
fi
objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp"
objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | sed 's/)$//' >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp"
echo -n "${i} / ${glibc_check_files}" $'\r'
((i++))
done
@ -60,14 +60,14 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do
fn_messages_separator
if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then
echo -e "Required glibc"
cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 | sed 's/)$//' | tee -a "${tmpdir}/detect_glibc_highest.tmp"
cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 | tee -a "${tmpdir}/detect_glibc_highest.tmp"
echo -e ""
echo -e "Files requiring GLIBC"
echo -e "Highest verion required: filename"
cat "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp"
echo -e ""
echo -e "All required GLIBC versions"
cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | sed 's/)$//'
cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort
rm -f "${tmpdir:?}/detect_glibc_${glibc_check_var}.tmp"
rm -f "${tmpdir:?}/detect_glibc_files_${glibc_check_var}.tmp"
else
@ -81,7 +81,7 @@ echo -e ""
fn_print_nl "${bold}${lightyellow}Final glibc Requirement"
fn_messages_separator
if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then
cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 | sed 's/)$//'
cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1
rm -f "${tmpdir:?}/detect_glibc_highest.tmp"
else
fn_print_information_nl "glibc is not required"

Loading…
Cancel
Save