|
@@ -13,23 +13,72 @@ cd ${executabledir}
|
|
|
readelf -d ${executable} |grep NEEDED|awk '{ print $5 }'|sed 's/\[//g'|sed 's/\]//g' > ${rootdir}/.depdetect_readelf
|
|
readelf -d ${executable} |grep NEEDED|awk '{ print $5 }'|sed 's/\[//g'|sed 's/\]//g' > ${rootdir}/.depdetect_readelf
|
|
|
|
|
|
|
|
|
|
|
|
|
-echo "yum install " > ${rootdir}/.depdetect_centos
|
|
|
|
|
-echo "apt-get install " > ${rootdir}/.depdetect_ubuntu
|
|
|
|
|
-echo "apt-get install " > ${rootdir}/.depdetect_debian
|
|
|
|
|
|
|
+echo "yum install " > ${rootdir}/.depdetect_centos_list_uniq
|
|
|
|
|
+echo "apt-get install " > ${rootdir}/.depdetect_ubuntu_list_uniq
|
|
|
|
|
+echo "apt-get install " > ${rootdir}/.depdetect_debian_list_uniq
|
|
|
while read lib; do
|
|
while read lib; do
|
|
|
sharedlib=${lib}
|
|
sharedlib=${lib}
|
|
|
- if [ ${lib} == "libm.so.6" ]||[ ${lib} == "libc.so.6" ]||[ ${lib} == "libpthread.so.0" ]||[ ${lib} == "libdl.so.2" ]||[ ${lib} == "libnsl.so.1" ];then
|
|
|
|
|
|
|
+ if [ "${lib}" == "libm.so.6" ]||[ ${lib} == "libc.so.6" ]||[ ${lib} == "libpthread.so.0" ]||[ ${lib} == "libdl.so.2" ]||[ ${lib} == "libnsl.so.1" ];then
|
|
|
echo "glibc.i386" >> ${rootdir}/.depdetect_centos_list
|
|
echo "glibc.i386" >> ${rootdir}/.depdetect_centos_list
|
|
|
echo "lib32gcc1" >> ${rootdir}/.depdetect_ubuntu_list
|
|
echo "lib32gcc1" >> ${rootdir}/.depdetect_ubuntu_list
|
|
|
echo "lib32gcc1" >> ${rootdir}/.depdetect_debian_list
|
|
echo "lib32gcc1" >> ${rootdir}/.depdetect_debian_list
|
|
|
- elif [ ${lib} == "libstdc++.so.6" ];then
|
|
|
|
|
|
|
+ elif [ "${lib}" == "libstdc++.so.6" ];then
|
|
|
echo "libstdc++.i686" >> ${rootdir}/.depdetect_centos_list
|
|
echo "libstdc++.i686" >> ${rootdir}/.depdetect_centos_list
|
|
|
echo "libstdc++6:i386" >> ${rootdir}/.depdetect_ubuntu_list
|
|
echo "libstdc++6:i386" >> ${rootdir}/.depdetect_ubuntu_list
|
|
|
echo "libstdc++6:i386" >> ${rootdir}/.depdetect_debian_list
|
|
echo "libstdc++6:i386" >> ${rootdir}/.depdetect_debian_list
|
|
|
|
|
+ elif [ "${lib}" == "libtier0.so" ];then
|
|
|
|
|
+ # Known shared libs what dont requires dependencies
|
|
|
|
|
+ :
|
|
|
else
|
|
else
|
|
|
|
|
+ unknownlib=1
|
|
|
echo "${lib}" >> ${rootdir}/.depdetect_unknown
|
|
echo "${lib}" >> ${rootdir}/.depdetect_unknown
|
|
|
fi
|
|
fi
|
|
|
done < ${rootdir}/.depdetect_readelf
|
|
done < ${rootdir}/.depdetect_readelf
|
|
|
-uniq ${rootdir}/.depdetect_centos_list > ${rootdir}/.depdetect_centos_list_uniq
|
|
|
|
|
-uniq ${rootdir}/.depdetect_ubuntu_list > ${rootdir}/.depdetect_ubuntu_list_uniq
|
|
|
|
|
-uniq ${rootdir}/.depdetect_debian_list > ${rootdir}/.depdetect_debian_list_uniq
|
|
|
|
|
|
|
+sort ${rootdir}/.depdetect_centos_list | uniq >> ${rootdir}/.depdetect_centos_list_uniq
|
|
|
|
|
+sort ${rootdir}/.depdetect_ubuntu_list | uniq >> ${rootdir}/.depdetect_ubuntu_list_uniq
|
|
|
|
|
+sort ${rootdir}/.depdetect_debian_list | uniq >> ${rootdir}/.depdetect_debian_list_uniq
|
|
|
|
|
+if [ "${unknownlib}" == "1" ];then
|
|
|
|
|
+ sort ${rootdir}/.depdetect_unknown | uniq >> ${rootdir}/.depdetect_unknown_uniq
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
+awk -vORS=' ' '{ print $1, $2 }' ${rootdir}/.depdetect_centos_list_uniq > ${rootdir}/.depdetect_centos_line
|
|
|
|
|
+awk -vORS=' ' '{ print $1, $2 }' ${rootdir}/.depdetect_ubuntu_list_uniq > ${rootdir}/.depdetect_ubuntu_line
|
|
|
|
|
+awk -vORS=' ' '{ print $1, $2 }' ${rootdir}/.depdetect_debian_list_uniq > ${rootdir}/.depdetect_debian_line
|
|
|
|
|
+
|
|
|
|
|
+echo ""
|
|
|
|
|
+echo "Required Dependencies"
|
|
|
|
|
+echo "================================="
|
|
|
|
|
+echo "${executable}"
|
|
|
|
|
+echo ""
|
|
|
|
|
+echo "CentOS"
|
|
|
|
|
+echo "================================="
|
|
|
|
|
+cat ${rootdir}/.depdetect_centos_line
|
|
|
|
|
+echo ""
|
|
|
|
|
+echo ""
|
|
|
|
|
+echo "Ubuntu"
|
|
|
|
|
+echo "================================="
|
|
|
|
|
+cat ${rootdir}/.depdetect_ubuntu_line
|
|
|
|
|
+echo ""
|
|
|
|
|
+echo ""
|
|
|
|
|
+echo "Debian"
|
|
|
|
|
+echo "================================="
|
|
|
|
|
+cat ${rootdir}/.depdetect_debian_line
|
|
|
|
|
+echo ""
|
|
|
|
|
+if [ "${unknownlib}" == "1" ];then
|
|
|
|
|
+ echo "Unknown shared Library"
|
|
|
|
|
+ echo "================================="
|
|
|
|
|
+ cat ${rootdir}/.depdetect_debian_uniq
|
|
|
|
|
+fi
|
|
|
|
|
+echo -en "\n"
|
|
|
|
|
+
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_centos_line
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_centos_list
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_centos_list
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_centos_list_uniq
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_debian_list
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_debian_list_uniq
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_readelf
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_ubuntu_list
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_ubuntu_list_uniq
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_unknown
|
|
|
|
|
+rm -f ${rootdir}/.depdetect_unknown_uniq
|