summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_comp
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/pkg_comp')
-rw-r--r--pkgtools/pkg_comp/Makefile4
-rw-r--r--pkgtools/pkg_comp/files/pkg_comp.sh19
2 files changed, 18 insertions, 5 deletions
diff --git a/pkgtools/pkg_comp/Makefile b/pkgtools/pkg_comp/Makefile
index 44ef74c9b54..5fa4dbe5c18 100644
--- a/pkgtools/pkg_comp/Makefile
+++ b/pkgtools/pkg_comp/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.36 2006/03/12 19:36:01 jmmv Exp $
+# $NetBSD: Makefile,v 1.37 2006/06/17 12:18:24 seb Exp $
-DISTNAME= pkg_comp-1.28
+DISTNAME= pkg_comp-1.29
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkg_comp/files/pkg_comp.sh b/pkgtools/pkg_comp/files/pkg_comp.sh
index 951a86d0b18..69034048bde 100644
--- a/pkgtools/pkg_comp/files/pkg_comp.sh
+++ b/pkgtools/pkg_comp/files/pkg_comp.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: pkg_comp.sh,v 1.31 2006/03/12 19:36:01 jmmv Exp $
+# $NetBSD: pkg_comp.sh,v 1.32 2006/06/17 12:18:24 seb Exp $
#
# pkg_comp - Build packages inside a clean chroot environment
# Copyright (c) 2002, 2003, 2004, 2005 Julio M. Merino Vidal <jmmv@NetBSD.org>
@@ -838,18 +838,31 @@ EOF
#
pkg_chroot()
{
+ local prefix script
+
[ -d $DESTDIR ] || err "$DESTDIR does not exist"
copy_vulnerabilities
fsmount
echo "PKG_COMP ==> Entering sandbox \`$DESTDIR'"
+ prefix=`mktemp $DESTDIR/pkg_comp/tmp/pkg_comp-XXXX`
+ rm $prefix
+ script="$prefix.sh"
+ init_script $script
if [ $# -eq 0 ]; then
- ENV=/etc/shrc chroot $DESTDIR $ROOTSHELL
+ cat >> $script <<EOF
+ENV=/etc/shrc $ROOTSHELL
+EOF
else
- ENV=/etc/shrc chroot $DESTDIR $*
+ cat >> $script <<EOF
+$*
+EOF
fi
+ chmod +x $script
+ ENV=/etc/shrc chroot $DESTDIR /pkg_comp/tmp/`basename $script`
echo
+ rm $script
fsumount
}