3 # This is run from the chroot via fastbulk, which has CDd
4 # into a particular pkgsrc directory and wants us to build it.
6 # Nothing to do if the package already exists. Remove the run log
7 # to prevent fastbulk from replacing the log from a previous run
9 set pkgname = "`bmake show-var VARNAME=PKGNAME`"
10 set logname = $argv[1]
13 # Check if already installed, prevent overwrite of
14 # previous run's logfile if it exists, else put in
17 pkg_info -q -e $pkgname
18 if ( $status == 0 ) then
19 if ( -f /tmp/logs/good/$logname ) then
20 rm -f /tmp/logs/run/$logname
22 echo "(already installed from previous run)"
26 if ( -f /usr/pkgsrc/packages/All/${pkgname}.tgz ) then
27 echo "(found in /usr/pkgsrc/packages)"
28 bmake deinstall DEINSTALLDEPENDS=ALL SKIP_LICENSE_CHECK=yes
29 setenv PKG_PATH /usr/pkgsrc/packages/All
30 echo "pkg_add -f ${pkgname}"
35 # We have to remove any conflicting packages or the one we
36 # are trying to build will refuse to build. Note that we
37 # leave the related packages intact.
39 foreach i ( `bmake show-var VARNAME=CONFLICTS` )
40 echo "DELETING CONFLICTING PACKAGE: $i"
44 # To ensure a clean build deinstall anything that
45 # may cause our build repackage to fail.
47 # Clean after repackaging (if it succeeded) to keep the
48 # work topology footprint small. The work topology is
49 # left intact for failed builds.
51 bmake deinstall DEINSTALLDEPENDS=ALL SKIP_LICENSE_CHECK=yes
52 bmake repackage clean SKIP_LICENSE_CHECK=yes
53 if ( $status == 0 ) then
54 setenv PKG_PATH /usr/pkgsrc/packages/All
55 echo "pkg_add -f ${pkgname}"