summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_comp
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2003-09-07 22:31:18 +0000
committerjmmv <jmmv@pkgsrc.org>2003-09-07 22:31:18 +0000
commit58500668439e1db24fbd5b7eac0108753f273b24 (patch)
tree649bf9148cdba20b3c9bf35d658706382843343a /pkgtools/pkg_comp
parentaddc4bd8a79e4e2302be9e19c82ad60481951dc4 (diff)
downloadpkgsrc-58500668439e1db24fbd5b7eac0108753f273b24.tar.gz
Update to 1.10:
* Sync with audit-packages: use the new pkg-vulnerabilities file. * Check if the version of pkg_install inside the chroot is up to date before building anything. If not, force a rebuild automatically. * Disable all those ugly sync's after fsumount (were added because I had some strange problems, IIRC). You can reenabled them by setting SYNC_UMOUNT=yes in the configuration file.
Diffstat (limited to 'pkgtools/pkg_comp')
-rw-r--r--pkgtools/pkg_comp/Makefile4
-rw-r--r--pkgtools/pkg_comp/files/pkg_comp.817
-rw-r--r--pkgtools/pkg_comp/files/pkg_comp.sh59
3 files changed, 59 insertions, 21 deletions
diff --git a/pkgtools/pkg_comp/Makefile b/pkgtools/pkg_comp/Makefile
index f9a22e599e7..7cc8e9776c6 100644
--- a/pkgtools/pkg_comp/Makefile
+++ b/pkgtools/pkg_comp/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.13 2003/08/30 21:11:30 jmmv Exp $
+# $NetBSD: Makefile,v 1.14 2003/09/07 22:31:18 jmmv Exp $
-DISTNAME= pkg_comp-1.9
+DISTNAME= pkg_comp-1.10
WRKSRC= ${WRKDIR}
CATEGORIES= pkgtools
MASTER_SITES= # empty
diff --git a/pkgtools/pkg_comp/files/pkg_comp.8 b/pkgtools/pkg_comp/files/pkg_comp.8
index abbf75412d2..e3d394c567e 100644
--- a/pkgtools/pkg_comp/files/pkg_comp.8
+++ b/pkgtools/pkg_comp/files/pkg_comp.8
@@ -1,7 +1,7 @@
-.\" $NetBSD: pkg_comp.8,v 1.12 2003/08/30 23:17:31 wiz Exp $
+.\" $NetBSD: pkg_comp.8,v 1.13 2003/09/07 22:31:18 jmmv Exp $
.\"
.\" pkg_comp - Build packages inside a clean chroot environment
-.\" Copyright (c) 2002, 2003, Julio Merino <jmmv@netbsd.org>
+.\" Copyright (c) 2002, 2003, Julio M. Merino Vidal <jmmv@netbsd.org>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd August 30, 2003
+.Dd September 7, 2003
.Dt PKG_COMP 8
.Os
.Sh NAME
@@ -220,6 +220,14 @@ no X Window is configured inside the chroot
jail and no other X variables take effect.
Defaults to
.Ql xbase.tgz xcomp.tgz xcontrib.tgz xfont.tgz xmisc.tgz xserver.tgz .
+.It SYNC_UMOUNT
+If set to
+.Ql yes ,
+run
+.Xr sync 8
+three times after all file systems have been unmounted.
+Defaults to
+.Ql no .
.It USE_AUDIT_PACKAGES
If set to
.Ql yes ,
@@ -395,6 +403,7 @@ chroot environment.
.Xr pkg_delete 1 ,
.Xr packages 7 ,
.Xr mount_null 8 ,
+.Xr sync 8 ,
.Xr sysctl 8
.Sh AUTHORS
-.An Julio Merino Aq jmmv@netbsd.org
+.An Julio M. Merino Vidal Aq jmmv@netbsd.org
diff --git a/pkgtools/pkg_comp/files/pkg_comp.sh b/pkgtools/pkg_comp/files/pkg_comp.sh
index 6d999b5725b..1d31125f507 100644
--- a/pkgtools/pkg_comp/files/pkg_comp.sh
+++ b/pkgtools/pkg_comp/files/pkg_comp.sh
@@ -1,9 +1,9 @@
#!/bin/sh
#
-# $NetBSD: pkg_comp.sh,v 1.10 2003/08/30 21:11:31 jmmv Exp $
+# $NetBSD: pkg_comp.sh,v 1.11 2003/09/07 22:31:18 jmmv Exp $
#
# pkg_comp - Build packages inside a clean chroot environment
-# Copyright (c) 2002, 2003, Julio Merino <jmmv@netbsd.org>
+# Copyright (c) 2002, 2003, Julio M. Merino Vidal <jmmv@netbsd.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -47,7 +47,7 @@ _TEMPLATE_VARS="DESTDIR ROOTSHELL COPYROOTCFG BUILD_TARGET DISTRIBDIR SETS \
SETS_X11 USE_XPKGWEDGE REAL_SRC REAL_SRC_OPTS REAL_PKGSRC \
REAL_PKGSRC_OPTS REAL_DISTFILES REAL_DISTFILES_OPTS \
REAL_PACKAGES REAL_PACKAGES_OPTS REAL_PKGVULNDIR \
- NETBSD_RELEASE MOUNT_SCRIPT UMOUNT_SCRIPT"
+ NETBSD_RELEASE MOUNT_SCRIPT UMOUNT_SCRIPT SYNC_UMOUNT"
env_clean()
{
@@ -102,6 +102,7 @@ env_setdefaults()
: ${NETBSD_RELEASE:=no}
: ${MOUNT_SCRIPT:=}
: ${UMOUNT_SCRIPT:=}
+ : ${SYNC_UMOUNT:=no}
}
# ----------------------------------------------------------------------
@@ -123,12 +124,12 @@ usage()
copy_vulnerabilities()
{
if [ "$USE_AUDIT_PACKAGES" = "yes" ]; then
- echo "PKG_COMP ==> Installing new \`vulnerabilities' file"
- if [ ! -f "$REAL_PKGVULNDIR/vulnerabilities" ]; then
- echo "$REAL_PKGVULNDIR/vulnerabilities not found."
+ echo "PKG_COMP ==> Installing new \`pkg-vulnerabilities' file"
+ if [ ! -f "$REAL_PKGVULNDIR/pkg-vulnerabilities" ]; then
+ echo "$REAL_PKGVULNDIR/pkg-vulnerabilities not found."
else
mkdir -p $DESTDIR/$PKGVULNDIR
- cp $REAL_PKGVULNDIR/vulnerabilities $DESTDIR/$PKGVULNDIR
+ cp $REAL_PKGVULNDIR/pkg-vulnerabilities $DESTDIR/$PKGVULNDIR
fi
fi
}
@@ -243,13 +244,16 @@ fsumount()
echo " done."
- printf "Syncing: 1"
- sync ; sleep 1
- printf " 2"
- sync ; sleep 1
- printf " 3"
- sync ; sleep 1
- echo " done."
+ if [ "$SYNC_UMOUNT" != "no" ]; then
+ printf "Syncing: 1"
+ sync ; sleep 1
+ printf " 2"
+ sync ; sleep 1
+ printf " 3"
+ sync ; sleep 1
+ echo " done."
+ fi
+
if [ "$fsfailed" = "yes" ]; then
err "FATAL: failed to umount all filesystems"
else
@@ -390,6 +394,8 @@ pkg_makeroot()
# signals to umount them.
trap "echo \"*** Process aborted ***\" ; fsumount ; exit 1" INT QUIT
+ check_pkg_install
+
if [ "$USE_AUDIT_PACKAGES" = "yes" ]; then
pkg_build security/audit-packages
fi
@@ -505,7 +511,7 @@ pkg_build()
err "invalid packages:$invalid"
fi
- copy_vulnerabilities
+ check_pkg_install # executes copy_vulnerabilities too
# Build them
fsmount
@@ -543,6 +549,29 @@ EOF
fi
}
+check_pkg_install()
+{
+ copy_vulnerabilities
+
+ echo "PKG_COMP ==> Checking that pkg_install is up to date"
+ fsmount
+ script=`mktemp $DESTDIR/pkg_comp/tmp/pkg_comp-XXXX`.sh
+ cat > $script <<EOF
+#!/bin/sh
+cd /usr/pkgsrc/pkgtools/pkg_comp
+fail=\$(make show-var VARNAME=PKG_FAIL_REASON)
+if echo \$fail | grep "package tools need to be updated" >/dev/null; then
+ echo "PKG_COMP ==> pkg_install is out of date; rebuilding"
+ cd /usr/pkgsrc/pkgtools/pkg_install
+ make && make install && make clean
+fi
+EOF
+ chmod +x $script
+ chroot $DESTDIR /pkg_comp/tmp/`basename $script`
+ rm $script
+ fsumount
+}
+
# ----------------------------------------------------------------------
# install target
# ----------------------------------------------------------------------