nrelease: Fix 'make restartpkgs'
authorAaron LI <aly@aaronly.me>
Mon, 28 Oct 2019 15:39:29 +0000 (23:39 +0800)
committerAaron LI <aly@aaronly.me>
Mon, 28 Oct 2019 22:10:40 +0000 (06:10 +0800)
'make restartpkgs' is broken because 'make install' would fail if the
port is alreay installed.  Fix this issue by executing 'make deinstall'
first, which would exit cleanly even if the port is not installed yet.

nrelease/Makefile

index 652cfb2..de8ddae 100644 (file)
@@ -248,6 +248,9 @@ pkgs:
            || mount_null ${ISODIR}/distfiles ${ISOROOT}/usr/distfiles
 
 .for PKG in ${DPORTS_PACKAGES}
+.if make(restartpkgs)
+       ${CHROOT_CMD} "cd /usr/dports/${PKG} && make ${DPORTS_OPTIONS} deinstall"
+.endif
        ${CHROOT_CMD} "cd /usr/dports/${PKG} && make ${DPORTS_OPTIONS} install"
 .endfor
 .for PKG in ${DPORTS_PACKAGES}