Add support to install/remove subpkgs independently of its sourcepkg.

--HG--
extra : convert_revision : 5495fb6558fa71dd843f54981313df233236ac50
This commit is contained in:
Juan RP 2009-02-20 06:25:35 +01:00
parent b225a1dc30
commit 04a0248ef1
4 changed files with 62 additions and 13 deletions

View file

@ -42,15 +42,29 @@ _EOF
xbps_write_metadata_pkg()
{
local pkg="$1"
local subpkg=
for subpkg in ${subpackages}; do
if [ "${pkg}" != "${sourcepkg}" ] && \
[ "${pkg}" != "${sourcepkg}-${subpkg}" ]; then
continue
fi
check_installed_pkg ${sourcepkg}-${subpkg}-${version}
[ $? -eq 0 ] && continue
if [ ! -f $XBPS_TEMPLATESDIR/${sourcepkg}/${subpkg}.template ]; then
msg_error "Cannot find subpackage template!"
fi
. $XBPS_TEMPLATESDIR/${sourcepkg}/${subpkg}.template
pkgname=${sourcepkg}-${subpkg}
xbps_write_metadata_pkg_real
run_template ${sourcepkg}
[ "${pkg}" = "${sourcepkg}-${subpkg}" ] && break
done
[ -n "${subpackages}" ] && [ "$pkg" != "${sourcepkg}" ] && return $?
if [ -n "${subpackages}" ]; then
run_template ${sourcepkg}
rm -rf $XBPS_DESTDIR/${sourcepkg}-${version}/*