summaryrefslogtreecommitdiff
path: root/mk/pkgformat
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2017-08-21 12:48:25 +0000
committerjlam <jlam@pkgsrc.org>2017-08-21 12:48:25 +0000
commit6cb62e4edc1fb5045ca0fe48140b5060e4acf90b (patch)
tree17370cd9e45ef52ef537d6f54ad7c4941cc86a90 /mk/pkgformat
parente2da00a8888c5132ad435d85ae2d1b9099d0136a (diff)
downloadpkgsrc-6cb62e4edc1fb5045ca0fe48140b5060e4acf90b.tar.gz
mk/pkgformat: Support INSTALL scripts that rely on UNPACK.
The pkginstall framework had an UNPACK action invoked early in the PRE-INSTALL stage to unpack scriplets that were invoked in later stages to perform extra work for installation, removal, or both. Add an UNPACK action that is a no-op for any scripts that don't support the action.
Diffstat (limited to 'mk/pkgformat')
-rw-r--r--mk/pkgformat/pkg/templates/install11
1 files changed, 10 insertions, 1 deletions
diff --git a/mk/pkgformat/pkg/templates/install b/mk/pkgformat/pkg/templates/install
index 7021a1558bf..2026f4d2b71 100644
--- a/mk/pkgformat/pkg/templates/install
+++ b/mk/pkgformat/pkg/templates/install
@@ -27,10 +27,19 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
-# $NetBSD: install,v 1.2 2017/08/10 05:41:52 jlam Exp $
+# $NetBSD: install,v 1.3 2017/08/21 12:48:25 jlam Exp $
case ${STAGE} in
PRE-INSTALL)
+ # Scripts that make use of the older pkginstall framework may
+ # need to unpack scriptlets during PRE-INSTALL to be used in
+ # later stages.
+ #
+ # Failure to unpack is fatal since the scriptlets will be
+ # required to complete package installation or removal.
+ #
+ ${SH} ${SELF} ${PKGNAME} UNPACK || exit $?
+
task_load preinstall
# Use the data in the shell comments appended at the end of