fastbulk - Adjustments to fix various issues
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 22 Aug 2012 05:18:40 +0000 (22:18 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 22 Aug 2012 05:18:40 +0000 (22:18 -0700)
* We weren't properly installing the binary packages we were creating,
  resulting in parallel build races.  Fixing this fixes most of the
  issues fastbulk was having.

* Change the way pkgsrc is mounted... copy it to /build/fastbulk and add
  code to ensure that it is clean.

* resident the bmake binary to speed things up a bit.

test/fastbulk/Makefile
test/fastbulk/dobuild
test/fastbulk/dochanges
test/fastbulk/pkgsrc.ign [new file with mode: 0644]

index a4fe2d9..7d0cf3d 100644 (file)
@@ -64,6 +64,7 @@ setup: cleanup
        mkdir -p ${BUILDBASE}/tmp/logs/bad
        mkdir -p ${BUILDBASE}/etc
        mkdir -p ${BUILDBASE}/usr.pkg
        mkdir -p ${BUILDBASE}/tmp/logs/bad
        mkdir -p ${BUILDBASE}/etc
        mkdir -p ${BUILDBASE}/usr.pkg
+       mkdir -p ${BUILDBASE}/usr.pkgsrc
        mkdir -p ${BUILDBASE}/usr.obj
        mkdir -p ${BUILDBASE}/var.db
        mkdir -p ${BUILDBASE}/var.db/pkg
        mkdir -p ${BUILDBASE}/usr.obj
        mkdir -p ${BUILDBASE}/var.db
        mkdir -p ${BUILDBASE}/var.db/pkg
@@ -80,17 +81,24 @@ setup: cleanup
        mount_null ${BUILDBASE}/track ${BUILDROOT}/tmp/track
        mount_null ${BUILDBASE}/etc ${BUILDROOT}/etc
        mount_null ${BUILDBASE}/usr.pkg ${BUILDROOT}/usr/pkg
        mount_null ${BUILDBASE}/track ${BUILDROOT}/tmp/track
        mount_null ${BUILDBASE}/etc ${BUILDROOT}/etc
        mount_null ${BUILDBASE}/usr.pkg ${BUILDROOT}/usr/pkg
+       mount_null ${BUILDBASE}/usr.pkgsrc ${BUILDROOT}/usr/pkgsrc
        mount_null ${BUILDBASE}/usr.obj ${BUILDROOT}/usr/obj
        mount_null ${BUILDBASE}/var.db ${BUILDROOT}/var/db
        mount_null ${BUILDBASE}/var.db.pkg ${BUILDROOT}/var/db/pkg
        mount_null ${BUILDBASE}/var.db.pkg.refcount \
                        ${BUILDROOT}/var/db/pkg.refcount
        mount_null ${SYSROOT}/dev ${BUILDROOT}/dev
        mount_null ${BUILDBASE}/usr.obj ${BUILDROOT}/usr/obj
        mount_null ${BUILDBASE}/var.db ${BUILDROOT}/var/db
        mount_null ${BUILDBASE}/var.db.pkg ${BUILDROOT}/var/db/pkg
        mount_null ${BUILDBASE}/var.db.pkg.refcount \
                        ${BUILDROOT}/var/db/pkg.refcount
        mount_null ${SYSROOT}/dev ${BUILDROOT}/dev
-       mount_null ${SYSPKGSRC} ${BUILDROOT}/usr/pkgsrc
+       cpdup -v -s0 -i0 -X ${.CURDIR}/pkgsrc.ign \
+                       ${SYSPKGSRC} ${BUILDROOT}/usr/pkgsrc
+       find ${BUILDROOT}/usr/pkgsrc -name work | xargs rm -rf
+       mkdir -p ${BUILDROOT}/usr/pkgsrc/packages
+       mkdir -p ${BUILDROOT}/usr/pkgsrc/distfiles
        mount_null ${BUILDBASE}/packages ${BUILDROOT}/usr/pkgsrc/packages
        mount_null ${BUILDBASE}/distfiles ${BUILDROOT}/usr/pkgsrc/distfiles
        mount_null ${BUILDBASE}/packages ${BUILDROOT}/usr/pkgsrc/packages
        mount_null ${BUILDBASE}/distfiles ${BUILDROOT}/usr/pkgsrc/distfiles
+       echo "finding and removing work directories"
 
 cleanup:
 
 cleanup:
+       -resident -d ${BUILDROOT}/usr/pkg/bin/bmake
        -umount ${BUILDROOT}/usr/pkgsrc/distfiles > /dev/null 2>&1
        -umount ${BUILDROOT}/usr/pkgsrc/packages > /dev/null 2>&1
        -umount ${BUILDROOT}/usr/pkgsrc > /dev/null 2>&1
        -umount ${BUILDROOT}/usr/pkgsrc/distfiles > /dev/null 2>&1
        -umount ${BUILDROOT}/usr/pkgsrc/packages > /dev/null 2>&1
        -umount ${BUILDROOT}/usr/pkgsrc > /dev/null 2>&1
@@ -115,6 +123,7 @@ realclean: cleanup
        rm -rf ${BUILDBASE}/tmp
        rm -rf ${BUILDBASE}/track
        rm -rf ${BUILDBASE}/usr.pkg
        rm -rf ${BUILDBASE}/tmp
        rm -rf ${BUILDBASE}/track
        rm -rf ${BUILDBASE}/usr.pkg
+       rm -rf ${BUILDBASE}/usr.pkgsrc
        rm -rf ${BUILDBASE}/usr.obj
        rm -rf ${BUILDBASE}/var.db.pkg
        rm -rf ${BUILDBASE}/var.db.pkg.refcount
        rm -rf ${BUILDBASE}/usr.obj
        rm -rf ${BUILDBASE}/var.db.pkg
        rm -rf ${BUILDBASE}/var.db.pkg.refcount
@@ -124,6 +133,7 @@ realclean: cleanup
 bootstrap:
        rm -rf ${BUILDBASE}/usr.obj/work
        ${CHROOTENV} "cd /usr/pkgsrc/bootstrap; ./bootstrap --workdir=/usr/obj/work"
 bootstrap:
        rm -rf ${BUILDBASE}/usr.obj/work
        ${CHROOTENV} "cd /usr/pkgsrc/bootstrap; ./bootstrap --workdir=/usr/obj/work"
+       resident ${BUILDROOT}/usr/pkg/bin/bmake
 
 # Figure out what has changed and deinstall the related packages
 #
 
 # Figure out what has changed and deinstall the related packages
 #
index a1db2c0..9ee34f7 100755 (executable)
@@ -31,4 +31,5 @@ end
 #
 bmake deinstall DEINSTALLDEPENDS=ALL SKIP_LICENSE_CHECK=yes
 bmake repackage clean SKIP_LICENSE_CHECK=yes
 #
 bmake deinstall DEINSTALLDEPENDS=ALL SKIP_LICENSE_CHECK=yes
 bmake repackage clean SKIP_LICENSE_CHECK=yes
+bmake bin-install
 exit $status
 exit $status
index c9e0b9d..a4df188 100755 (executable)
@@ -10,4 +10,5 @@ foreach pkgsrcdir ( `cat /tmp/track/changes.txt` )
        bmake deinstall DEINSTALLDEPENDS=ALL
        bmake package-eat-cookie
        rm -f /usr/pkgsrc/packages/*/${pkgname}.tgz )
        bmake deinstall DEINSTALLDEPENDS=ALL
        bmake package-eat-cookie
        rm -f /usr/pkgsrc/packages/*/${pkgname}.tgz )
+       popd
 end
 end
diff --git a/test/fastbulk/pkgsrc.ign b/test/fastbulk/pkgsrc.ign
new file mode 100644 (file)
index 0000000..1fb56d9
--- /dev/null
@@ -0,0 +1,4 @@
+distfiles
+packages
+.git
+work