Split pkgs required by xbps-base-chroot, as it was made in Fedora.
- Added an additional shell func to add full (build/run), build or run time dependencies to packages. An optional third parameter can be used to specify other version than the one set in the depends file. - Use a "depends" file in package directory to specify minimum required ABI/API version for a package, so that there's no need to set the version all the time in pkgs. - Updated bash to 4.0. --HG-- extra : convert_revision : 1aa0ce32d4bdc2cd371eac19ae7bcff2c986b6b3
This commit is contained in:
@@ -56,6 +56,7 @@ xbps_write_metadata_pkg()
|
||||
if [ ! -f $XBPS_TEMPLATESDIR/${sourcepkg}/${subpkg}.template ]; then
|
||||
msg_error "Cannot find subpackage template!"
|
||||
fi
|
||||
unset run_depends
|
||||
. $XBPS_TEMPLATESDIR/${sourcepkg}/${subpkg}.template
|
||||
pkgname=${sourcepkg}-${subpkg}
|
||||
xbps_write_metadata_pkg_real
|
||||
@@ -65,13 +66,11 @@ xbps_write_metadata_pkg()
|
||||
|
||||
[ -n "${subpackages}" ] && [ "$pkg" != "${sourcepkg}" ] && return $?
|
||||
|
||||
if [ -n "${subpackages}" ]; then
|
||||
run_template ${sourcepkg}
|
||||
unset run_depends
|
||||
if [ -z "${run_depends}" ]; then
|
||||
for subpkg in ${subpackages}; do
|
||||
run_depends="$run_depends ${sourcepkg}-${subpkg}-${version}"
|
||||
done
|
||||
fi
|
||||
for subpkg in ${subpackages}; do
|
||||
run_depends="$run_depends ${sourcepkg}-${subpkg}-${version}"
|
||||
done
|
||||
xbps_write_metadata_pkg_real
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#-
|
||||
|
||||
. ${XBPS_SHUTILSDIR}/tmpl_funcs.sh
|
||||
|
||||
#
|
||||
# Installs a pkg by reading its build template file.
|
||||
#
|
||||
|
||||
@@ -69,6 +69,7 @@ reset_tmpl_vars()
|
||||
disable_parallel_build run_depends cross_compiler \
|
||||
only_for_archs patch_args conf_files keep_dirs \
|
||||
install_priority noarch subpackages sourcepkg \
|
||||
abi_depends api_depends \
|
||||
XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \
|
||||
XBPS_BUILD_DONE XBPS_INSTALL_DONE"
|
||||
|
||||
@@ -104,6 +105,46 @@ setup_tmpl()
|
||||
|
||||
}
|
||||
|
||||
Add_dependency()
|
||||
{
|
||||
local type="$1"
|
||||
local pkgname="$2"
|
||||
local minver="$3"
|
||||
|
||||
case "$type" in
|
||||
build|full|run) ;;
|
||||
*) msg_error "Unknown dependency type for $pkgname." ;;
|
||||
esac
|
||||
|
||||
if [ -f $XBPS_TEMPLATESDIR/$pkgname/$pkgname.depends ]; then
|
||||
. $XBPS_TEMPLATESDIR/$pkgname/$pkgname.depends
|
||||
elif [ -f $XBPS_TEMPLATESDIR/$pkgname/depends ]; then
|
||||
. $XBPS_TEMPLATESDIR/$pkgname/depends
|
||||
fi
|
||||
|
||||
if [ "$type" = "full" -o "$type" = "build" ]; then
|
||||
if [ -z "$minver" -a -z "$api_depends" ]; then
|
||||
build_depends="${build_depends} $pkgname-0"
|
||||
elif [ -z "$minver" -a -n "$api_depends" ]; then
|
||||
build_depends="${build_depends} $pkgname-$api_depends"
|
||||
else
|
||||
build_depends="${build_depends} $pkgname-$minver"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$type" = "full" -o "$type" = "run" ]; then
|
||||
if [ -z "$minver" -a -z "$abi_depends" ]; then
|
||||
run_depends="${run_depends} $pkgname-0"
|
||||
elif [ -z "$minver" -a -n "$abi_depends" ]; then
|
||||
run_depends="${run_depends} $pkgname-$abi_depends"
|
||||
else
|
||||
run_depends="${run_depends} $pkgname-$minver"
|
||||
fi
|
||||
fi
|
||||
|
||||
unset abi_depends api_depends
|
||||
}
|
||||
|
||||
#
|
||||
# Checks some vars used in templates and sets some of them required.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user