Explorar el Código

Added Shared Object dependencies Checker

Daniel Gibbs hace 9 años
padre
commit
14a066a076
Se han modificado 1 ficheros con 26 adiciones y 4 borrados
  1. 26 4
      lgsm/functions/command_dev_detect_ldd.sh

+ 26 - 4
lgsm/functions/command_dev_detect_ldd.sh

@@ -6,7 +6,7 @@
 # Can check a file or directory recursively.
 
 echo "================================="
-echo "LDD Requirements Checker"
+echo "Shared Object dependencies Checker"
 echo "================================="
 
 if [ -z "${filesdir}" ]; then
@@ -22,10 +22,32 @@ elif [ -f "${filesdir}" ]; then
 fi
 echo ""
 
+files=$(find ${filesdir} | wc -l)
 find ${filesdir} -type f -print0 |
 while IFS= read -r -d $'\0' line; do
-	ldd $line |grep "=>" >>"${lgsmdir}/tmp/detect_ldd.tmp"
+	#ldd -v $line 2>/dev/null|grep "=>" >>"${lgsmdir}/tmp/detect_ldd.tmp"
+	if [ -n "$(ldd $line 2>/dev/null |grep -v "not a dynamic executable")" ]; then
+		echo "$line" >> "${lgsmdir}/tmp/detect_ldd.tmp"
+		ldd $line 2>/dev/null |grep -v "not a dynamic executable" >> "${lgsmdir}/tmp/detect_ldd.tmp"
+
+		if [ -n "$(ldd $line 2>/dev/null |grep -v "not a dynamic executable"|grep "not found")" ]; then
+			echo "$line" >> "${lgsmdir}/tmp/detect_ldd_not_found.tmp"
+			ldd $line 2>/dev/null |grep -v "not a dynamic executable"|grep "not found" >> "${lgsmdir}/tmp/detect_ldd_not_found.tmp"
+		fi
+	fi
+	echo -n "$i / $files" $'\r'
+	((i++))
 done
+echo ""
+echo ""
+echo "All"
+echo "================================="
+cat "${lgsmdir}/tmp/detect_ldd.tmp"
+
+echo ""
+echo "Not Found"
+echo "================================="
+cat "${lgsmdir}/tmp/detect_ldd_not_found.tmp"
 
-cat "${lgsmdir}/tmp/detect_ldd.tmp"|sort|uniq|sort -r --version-sort
-rm "${lgsmdir}/tmp/detect_ldd.tmp"
+rm "${lgsmdir}/tmp/detect_ldd.tmp"
+rm "${lgsmdir}/tmp/detect_ldd_not_found.tmp"