fastbulk - Remove core files & empty dirs from /var/pkg/db
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 22 Aug 2012 19:40:47 +0000 (12:40 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 22 Aug 2012 19:40:47 +0000 (12:40 -0700)
* The presence of a core file prevents the pkg code from properly handling
  the directory, causing installs from packages to fail if any dependency
  has a broken /var/pkg/db directory.

* Clean out any core files and empty dirs before starting a build.

test/fastbulk/Makefile

index 4f40c8e..81709d1 100644 (file)
@@ -174,6 +174,10 @@ build: ${PRESTAGE}
        rm -rf ${BUILDBASE}/usr.obj/work
        mkdir -p ${BUILDBASE}/usr.obj/work
        -rm ${BUILDROOT}/tmp/logs/run/*
        rm -rf ${BUILDBASE}/usr.obj/work
        mkdir -p ${BUILDBASE}/usr.obj/work
        -rm ${BUILDROOT}/tmp/logs/run/*
+       find ${BUILDROOT}/var/db/pkg -name '*.core' -delete
+       find ${BUILDROOT}/var/db/pkg -type d -depth 1 -delete
+       #${CHROOTENV} "pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities"
+       #${CHROOTENV} "pkg_admin rebuild"
        ${CHROOTENV} "cd /tmp/track; ./fastbulk -j ${NPARALLEL} /usr/pkgsrc"
 
 ${BUILDBASE}/bin/getpkgsrcdir: getpkgsrcdir.c
        ${CHROOTENV} "cd /tmp/track; ./fastbulk -j ${NPARALLEL} /usr/pkgsrc"
 
 ${BUILDBASE}/bin/getpkgsrcdir: getpkgsrcdir.c