shutils: allow subpkgs to use INSTALL/REMOVE scripts.

subpkgs to use them need to have ${pkgname}.INSTALL/REMOVE scripts
on the directory.

--HG--
extra : convert_revision : 293def453dd17d5bbdd68c9b25f8f2f16d673a8e
This commit is contained in:
Juan RP
2009-05-05 00:19:25 +02:00
parent e98378b2d5
commit 706782cf0c
2 changed files with 15 additions and 5 deletions

View File

@@ -146,9 +146,14 @@ _EOF
case "$action" in
install)
if [ -f "$XBPS_TEMPLATESDIR/$pkgname/INSTALL" ]; then
if [ -n "${sourcepkg}" -a "${sourcepkg}" != "${pkgname}" ]; then
install_file=${XBPS_TEMPLATESDIR}/${pkgname}/${pkgname}.INSTALL
else
install_file=${XBPS_TEMPLATESDIR}/${pkgname}/INSTALL
fi
if [ -f ${install_file} ]; then
found=1
cat $XBPS_TEMPLATESDIR/$pkgname/INSTALL >> $tmpf
cat ${install_file} >> $tmpf
fi
echo "exit 0" >> $tmpf
if [ -z "$found" ]; then
@@ -158,9 +163,14 @@ _EOF
mv $tmpf ${DESTDIR}/INSTALL && chmod 755 ${DESTDIR}/INSTALL
;;
remove)
if [ -f "$XBPS_TEMPLATESDIR/$pkgname/REMOVE" ]; then
if [ -n "${sourcepkg}" -a "${sourcepkg}" != "${pkgname}" ]; then
remove_file=${XBPS_TEMPLATESDIR}/${pkgname}/${pkgname}.REMOVE
else
remove_file=${XBPS_TEMPLATESDIR}/${pkgname}/REMOVE
fi
if [ -f ${remove_file} ]; then
found=1
cat $XBPS_TEMPLATESDIR/$pkgname/REMOVE >> $tmpf
cat ${remove_file} >> $tmpf
fi
echo "exit 0" >> $tmpf
if [ -z "$found" ]; then