Index: bin/cygport.in =================================================================== RCS file: /cvsroot/cygwin-ports/cygport/bin/cygport.in,v retrieving revision 1.45 diff -u -r1.45 cygport.in --- bin/cygport.in 4 Jan 2007 02:35:26 -0000 1.45 +++ bin/cygport.in 6 Jan 2007 03:11:40 -0000 @@ -566,6 +566,19 @@ fi } +# provides a hook for cygclasses/cygports to take action +# *before* origsrc directory is mirrored to src directory +# NOTE that all sources in SRC_URI have already been unpacked, +# but the patches in PATCH_URI have NOT been applied, +# when this function is invoked. +src_prep_init_hook() { + : +} +# provides a hook for cygclasses/cygports to take action +# *after* origsrc directory is mirrored to src directory +src_prep_fini_hook() { + : +} src_prep() { local sigext; local src_patch; @@ -612,20 +625,23 @@ unpack ${top}/${src_pkg}; done - cd ${origsrcdir}/${SRC_DIR}; + if [ ! -d ${origsrcdir}/${SRC_DIR} ] + then + error "SRC_DIR is not correctly defined" + fi + + src_prep_init_hook + cd ${origsrcdir}/${SRC_DIR}; for src_patch in ${_src_orig_patches} do apply_patch ${top}/${src_patch}; done - if [ ! -d ${origsrcdir}/${SRC_DIR} ] - then - error "SRC_DIR is not correctly defined" - fi __step "Preparing working source directory"; + cd ${top} cp -fpr ${origsrcdir}/* ${srcdir}; mkdir -p ${C}; @@ -637,11 +653,15 @@ then apply_patch ${top}/${cygwin_patchfile} ${top}/${src_patchfile}; fi + + cd ${top} + src_prep_fini_hook + cd ${S} } # protect functions readonly -f fetch src_fetch unpack gpg_verify __mkdirs apply_patch __oldpatch src_prep - +export -f src_prep_init_hook src_prep_fini_hook ################################################################################ # @@ -969,8 +989,21 @@ cyginstall } +# provides a hook for cygclasses/cygports to take action +# *before* built-in preinstall steps. +src_install_init_hook() { + : +} + +# provides a hook for cygclasses/cygports to take action +# *after* built-in postinstall steps. +src_install_fini_hook() { + : +} + # protect functions export -f dodir docinto exeinto insinto +export -f src_install_init_hook src_install_fini_hook readonly -f dodir docinto exeinto insinto __prepinstalldirs cyginstall @@ -1678,7 +1711,7 @@ ;; inst*) __stage Installing; - (__prepinstalldirs && src_install && src_postinst) 2>&1 | tee ${installlog}; + (src_install_init_hook && __prepinstalldirs && src_install && src_postinst && src_install_fini_hook) 2>&1 | tee ${installlog}; _status=$?; ;; list)