50513d5d52
This commit should largele be a NOOP as it only adds support for DESTDIR undefined. This does allow us to start testing ports with DESTDIR set, but this is as of yet not supported. Although this has been extensively tested on pointyhat, this is a very intrusive change and some cases may have been overlooked. Please contact Gabor and me if you find any. PR: 100555 Submitted by: gabor Sponsored by: Google Summer of Code 2006
46 lines
1.1 KiB
Bash
46 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PAX=/bin/pax
|
|
ECHO_CMD=echo
|
|
MKDIR="/bin/mkdir -p"
|
|
RM=/bin/rm
|
|
BACKUPDIR=/var/backups
|
|
|
|
TOOLS="add check create delete info sign update version"
|
|
|
|
PREFIX=${PKG_PREFIX:-/usr/local}
|
|
if [ "${PREFIX}" = "/usr" ]; then
|
|
MANPREFIX="${TARGETDIR}/share"
|
|
else
|
|
MANPREFIX="${TARGETDIR}"
|
|
fi
|
|
|
|
case $2 in
|
|
PRE-INSTALL)
|
|
if [ "${PREFIX}" = "/usr" ]; then
|
|
if [ -e "${BACKUPDIR}/pkg_install.tgz" ]; then
|
|
${ECHO_CMD} "===> Please remove \`\`${BACKUPDIR}/pkg_install.tgz'' manually."
|
|
exit 1
|
|
fi
|
|
if [ "${PREFIX}" = "/usr" ]; then
|
|
files=""
|
|
for tool in ${TOOLS}; do
|
|
if [ -e "${PREFIX}/sbin/pkg_${tool}" ]; then
|
|
files="${files} ${PREFIX}/sbin/pkg_${tool}"
|
|
fi
|
|
if [ -e "${MANPREFIX}/man/man1/pkg_${tool}.1.gz" ]; then
|
|
files="${files} ${MANPREFIX}/man/man1/pkg_${tool}.1.gz"
|
|
${RM} -f "${MANPREFIX}/man/cat1/pkg_${tool}.1.gz"
|
|
fi
|
|
done
|
|
${MKDIR} ${BACKUPDIR}
|
|
${PAX} -w -z -f "${BACKUPDIR}/pkg_install.tgz" ${files}
|
|
${RM} -f ${files}
|
|
${ECHO_CMD} "===> Base pkg_install saved."
|
|
fi
|
|
fi
|
|
;;
|
|
esac
|