if len(pargs) < 2:
parser.error("missing required args")
- if "merge" in pargs:
- print("Disabling noauto in features... merge disables it. (qmerge doesn't)")
- os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto"
-
os.environ["PORTAGE_CALLER"]="ebuild"
-try:
- import portage
-except ImportError:
- from os import path as osp
- sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
- import portage
+# for an explanation on this logic, see pym/_emerge/__init__.py
+from os import environ as ose
+from os import path as osp
+if ose.__contains__("PORTAGE_PYTHONPATH"):
+ sys.path.insert(0, ose["PORTAGE_PYTHONPATH"])
+else:
+ sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp. realpath(__file__))), "pym"))
+import portage
portage.dep._internal_warnings = True
from portage import os
exit 1
fi
- target="${1}"
- linkname="${2}"
- [[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
- destdir=${linkname%/*}
+ if [[ ${2} == */ ]] || \
- [[ -d ${D}${2} && ! -L ${D}${2} ]] ; then
++ [[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then
+ # implicit basename not allowed by PMS (bug #379899)
+ eqawarn "QA Notice: dosym target omits basename: '${2}'"
+ fi
+
+ destdir=${2%/*}
-[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
+[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
- ln -snf "${target}" "${ED}/${linkname}"
-ln -snf "$1" "${D}$2"
++target="${1}"
++[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
++ln -snf "${target}" "${ED}/${2}"
ret=$?
[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
exit $ret