xbps-src: dont overwrite globals with local vars in Add_dependency.

This commit is contained in:
Juan RP 2011-10-22 00:47:22 +02:00
parent 68d05f7588
commit dd612f06fd
1 changed files with 23 additions and 23 deletions

View File

@ -185,49 +185,49 @@ check_rundep_dup()
Add_dependency()
{
local type="$1" pkgname="$2" version="$3"
local type="$1" pkgn="$2" ver="$3"
case "$type" in
build|full|run) ;;
*) msg_error "Unknown dependency type for $pkgname.\n" ;;
*) msg_error "[$pkgname] Unknown dependency type for $pkgn.\n" ;;
esac
[ -z "$pkgname" ] && msg_error "[$pkgname] Add_dependency: pkgname empty!\n"
[ -z "$pkgn" ] && msg_error "[$pkgn] Add_dependency: pkgname empty!\n"
if [ -f $XBPS_SRCPKGDIR/${pkgname}/${pkgname}.depends ]; then
. $XBPS_SRCPKGDIR/${pkgname}/${pkgname}.depends
elif [ -f $XBPS_SRCPKGDIR/${pkgname}/depends ]; then
. $XBPS_SRCPKGDIR/${pkgname}/depends
if [ -f $XBPS_SRCPKGDIR/${pkgn}/${pkgn}.depends ]; then
. $XBPS_SRCPKGDIR/${pkgn}/${pkgn}.depends
elif [ -f $XBPS_SRCPKGDIR/${pkgn}/depends ]; then
. $XBPS_SRCPKGDIR/${pkgn}/depends
fi
if [ "$type" = "full" -o "$type" = "build" ]; then
if [ -z "$version" -a -z "$api_depends" ]; then
if check_builddep_dup "${pkgname}>=0"; then
build_depends="${build_depends} ${pkgname}>=0"
if [ -z "$ver" -a -z "$api_depends" ]; then
if check_builddep_dup "${pkgn}>=0"; then
build_depends="${build_depends} ${pkgn}>=0"
fi
elif [ -z "$version" -a -n "$api_depends" ]; then
if check_builddep_dup "${pkgname}${api_depends}"; then
build_depends="${build_depends} ${pkgname}${api_depends}"
elif [ -z "$ver" -a -n "$api_depends" ]; then
if check_builddep_dup "${pkgn}${api_depends}"; then
build_depends="${build_depends} ${pkgn}${api_depends}"
fi
else
if check_builddep_dup "${pkgname}${version}"; then
build_depends="${build_depends} ${pkgname}${version}"
if check_builddep_dup "${pkgn}${version}"; then
build_depends="${build_depends} ${pkgn}${ver}"
fi
fi
fi
if [ "$type" = "full" -o "$type" = "run" ]; then
if [ -z "$version" -a -z "$abi_depends" ]; then
if check_rundep_dup "${pkgname}>=0"; then
run_depends="${run_depends} ${pkgname}>=0"
if [ -z "$ver" -a -z "$abi_depends" ]; then
if check_rundep_dup "${pkgn}>=0"; then
run_depends="${run_depends} ${pkgn}>=0"
fi
elif [ -z "$version" -a -n "$abi_depends" ]; then
if check_rundep_dup "${pkgname}${api_depends}"; then
run_depends="${run_depends} ${pkgname}${abi_depends}"
elif [ -z "$ver" -a -n "$abi_depends" ]; then
if check_rundep_dup "${pkgn}${api_depends}"; then
run_depends="${run_depends} ${pkgn}${abi_depends}"
fi
else
if check_rundep_dup "${pkgname}${version}"; then
run_depends="${run_depends} ${pkgname}${version}"
if check_rundep_dup "${pkgn}${ver}"; then
run_depends="${run_depends} ${pkgn}${ver}"
fi
fi
fi