svn commit: r378659 - projects/rework-dependency-registration/Mk/Scripts
Baptiste Daroussin
bapt at FreeBSD.org
Sun Feb 8 14:49:24 UTC 2015
Author: bapt
Date: Sun Feb 8 14:49:23 2015
New Revision: 378659
URL: https://svnweb.freebsd.org/changeset/ports/378659
QAT: https://qat.redports.org/buildarchive/r378659/
Log:
Replace realpath(1) by a code that only resolve the final symlink and leaves all
others as is while transforming the path into an absolute path
This solve the pgp dependency
Modified:
projects/rework-dependency-registration/Mk/Scripts/actual-package-depends.sh
Modified: projects/rework-dependency-registration/Mk/Scripts/actual-package-depends.sh
==============================================================================
--- projects/rework-dependency-registration/Mk/Scripts/actual-package-depends.sh Sun Feb 8 14:31:24 2015 (r378658)
+++ projects/rework-dependency-registration/Mk/Scripts/actual-package-depends.sh Sun Feb 8 14:49:23 2015 (r378659)
@@ -7,6 +7,45 @@ if [ -z "${PKG_BIN}" ]; then
exit 1
fi
+resolv_symlink() {
+ local file tgt
+ file=${1}
+ if [ ! -L ${file} ] ; then
+ echo ${file}
+ return
+ fi
+
+ tgt=`readlink ${file}`
+ case $tgt in
+ /*)
+ echo $tgt
+ return
+ ;;
+ esac
+
+ file=${file%/*}/${tgt}
+ absolute_path ${file}
+}
+
+absolute_path() {
+ local file myifs target
+ file=$1
+
+ myifs=${IFS}
+ IFS='/'
+ set -- ${file}
+ IFS=${myifs}
+ for el; do
+ case $el in
+ .) continue ;;
+ '') continue ;;
+ ..) target=${target%/*} ;;
+ *) target="${target}/${el}" ;;
+ esac
+ done
+ echo ${target}
+}
+
find_dep() {
pattern=$1
case ${pattern} in
@@ -22,7 +61,8 @@ find_dep() {
;;
esac
if [ -n "${searchfile}" ]; then
- ${PKG_BIN} which -q ${searchfile} || ${PKG_BIN} which -q "$(/bin/realpath ${searchfile} 2>/dev/null)" ||
+ echo $(resolv_symlink ${searchfile}) >&2
+ ${PKG_BIN} which -q ${searchfile} || ${PKG_BIN} which -q "$(resolv_symlink ${searchfile} 2>/dev/null)" ||
echo "actual-package-depends: dependency on ${searchfile} not registered (normal if it belongs to base)" >&2
fi
}
More information about the svn-ports-projects
mailing list