summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2003-08-31 06:37:16 +0000
committerjlam <jlam>2003-08-31 06:37:16 +0000
commit9a13a028bd99ba4de1d587cf08888bb40d6130ad (patch)
treefb0abc76187fb9a10732ec5072584759f47cdbd7
parentbeb1e6e17a212e2313ca021e80f549af9ae37fa6 (diff)
downloadpkgsrc-9a13a028bd99ba4de1d587cf08888bb40d6130ad.tar.gz
Check to see if DEPOTBASE is different from PKG_DBDIR as an optimization.
-rw-r--r--mk/bulk/pre-build32
1 files changed, 23 insertions, 9 deletions
diff --git a/mk/bulk/pre-build b/mk/bulk/pre-build
index fd2386c8de1..25a497de394 100644
--- a/mk/bulk/pre-build
+++ b/mk/bulk/pre-build
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: pre-build,v 1.27.2.3 2003/08/26 21:58:07 jlam Exp $
+# $NetBSD: pre-build,v 1.27.2.4 2003/08/31 06:37:16 jlam Exp $
#
# Clean up system to be ready for bulk pkg build
#
@@ -77,10 +77,17 @@ if [ -d ${PKG_DBDIR} ]; then
cd ${PKG_DBDIR}
for pkg in *
do
- if `pkg_info -K ${DEPOTBASE} -qe $pkg`; then
- echo pkg_delete -r $pkg
- pkg_delete -K ${DEPOTBASE} -r $pkg
- elif `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
+ case "${DEPOTBASE}" in
+ "${PKG_DBDIR}")
+ ;;
+ *)
+ if `pkg_info -K ${DEPOTBASE} -qe $pkg`; then
+ echo pkg_delete -r $pkg
+ pkg_delete -K ${DEPOTBASE} -r $pkg
+ fi
+ ;;
+ esac
+ if `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
echo pkg_delete -r $pkg
pkg_delete -K ${PKG_DBDIR} -r $pkg
fi
@@ -89,10 +96,17 @@ if [ -d ${PKG_DBDIR} ]; then
# to deinstall
for pkg in *
do
- if `pkg_info -K ${DEPOTBASE} -qe $pkg`; then
- echo pkg_delete -f $pkg
- pkg_delete -K ${DEPOTBASE} -f $pkg
- elif `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
+ case "${DEPOTBASE}" in
+ "${PKG_DBDIR}")
+ ;;
+ *)
+ if `pkg_info -K ${DEPOTBASE} -qe $pkg`; then
+ echo pkg_delete -f $pkg
+ pkg_delete -K ${DEPOTBASE} -f $pkg
+ fi
+ ;;
+ esac
+ if `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
echo pkg_delete -f $pkg
pkg_delete -K ${PKG_DBDIR} -f $pkg
fi