diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-11-23 11:27:52 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2011-11-23 11:27:52 +0100 |
commit | 78c5474ff0c3f14b82f0d03ebf67e86d414b8870 (patch) | |
tree | 5c3b145e391f72a1d607a6bf558664c18408de07 /scripts | |
parent | b4ac8de1cfa29f1882c6bfee4b0f2b394e31daf2 (diff) | |
download | ptxdist-78c5474ff0c3f14b82f0d03ebf67e86d414b8870.tar.gz ptxdist-78c5474ff0c3f14b82f0d03ebf67e86d414b8870.tar.xz |
call pre-/postinst scripts in ptxd_make_xpkg_pkg
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_finish.sh | 23 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_pkg.sh | 14 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_prepare.sh | 7 |
3 files changed, 24 insertions, 20 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_finish.sh b/scripts/lib/ptxd_make_xpkg_finish.sh index d424eacc7..542558985 100644 --- a/scripts/lib/ptxd_make_xpkg_finish.sh +++ b/scripts/lib/ptxd_make_xpkg_finish.sh @@ -72,6 +72,16 @@ EOF rm -f "${ptx_pkg_dir}/${pkg_xpkg}"_*"${PTXDIST_IPKG_ARCH_STRING}.ipk" # + # add pre-/postinst runs to the command list + # + ( + echo "ptxd_install_run preinst" + cat "${pkg_xpkg_cmds}" + echo "ptxd_install_run postinst" + ) > "${pkg_xpkg_cmds}.tmp" + mv "${pkg_xpkg_cmds}.tmp" "${pkg_xpkg_cmds}" + + # # create pkg # echo "xpkg_finish: creating ${pkg_xpkg_type} package ... " && @@ -83,18 +93,5 @@ EOF } echo "done." - - - # - # post install - # - # FIXME: install ipkg rather than executing script - if ptxd_in_path PTXDIST_PATH_RULES "${pkg_xpkg}.postinst"; then - echo "xpkg_finish: running postinst" - DESTDIR="${ptx_nfsroot}" /bin/sh "${ptxd_reply}" - DESTDIR="${ptx_nfsroot_dbg}" /bin/sh "${ptxd_reply}" - fi - - return } export -f ptxd_make_xpkg_finish diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh index 89d631974..aa02512d8 100644 --- a/scripts/lib/ptxd_make_xpkg_pkg.sh +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh @@ -627,6 +627,20 @@ ptxd_install_lib() { } export -f ptxd_install_lib +ptxd_install_run() { + local script="${pkg_xpkg_control_dir}/${1}" + + if [ -e "${script}" ]; then + echo "\ +executing '${pkg_label}.${1}' +" + DESTDIR="${ptx_nfsroot}" /bin/sh "${script}" && + DESTDIR="${ptx_nfsroot_dbg}" /bin/sh "${script}" + fi || + ptxd_install_error "running '${1}' script failed!" +} +export -f ptxd_install_run + ptxd_make_xpkg_pkg() { local pkg_xpkg_tmp="$1" local pkg_xpkg_cmds="$2" diff --git a/scripts/lib/ptxd_make_xpkg_prepare.sh b/scripts/lib/ptxd_make_xpkg_prepare.sh index eeb93565e..e88a3477f 100644 --- a/scripts/lib/ptxd_make_xpkg_prepare.sh +++ b/scripts/lib/ptxd_make_xpkg_prepare.sh @@ -93,13 +93,6 @@ install_init: @DEPENDS@ -> ${dep}" "${pkg_xpkg_control_dir}/${script}" || return echo "packaging: '$(ptxd_print_path "${ptxd_reply}")'" - - # FIXME: install ipkg rather than executing script - if [ "${script}" = "preinst" ]; then - echo "install_init: executing '${ptxd_reply}'" - DESTDIR="${ptx_nfsroot}" /bin/sh "${ptxd_reply}" - DESTDIR="${ptx_nfsroot_dbg}" /bin/sh "${ptxd_reply}" - fi else echo "not available" fi |