From dd78ae59bbd622b16fa17720fbc5aed0ed39e78b Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Sun, 19 Jun 2011 11:08:20 +0200 Subject: ptxd_make_xpkg_finish: refactor extract commen parts of the opkg/ipkg creation. Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_make_ipkg_finish.sh | 15 --------------- scripts/lib/ptxd_make_opkg_finish.sh | 15 --------------- scripts/lib/ptxd_make_xpkg_finish.sh | 15 ++++++++++++++- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/scripts/lib/ptxd_make_ipkg_finish.sh b/scripts/lib/ptxd_make_ipkg_finish.sh index 2ef23e682..ab5f21c36 100644 --- a/scripts/lib/ptxd_make_ipkg_finish.sh +++ b/scripts/lib/ptxd_make_ipkg_finish.sh @@ -20,18 +20,3 @@ ptxd_make_ipkg_finish_impl() { } export -f ptxd_make_ipkg_finish_impl - -# -# create an ipkg package -# -ptxd_make_ipkg_finish() { - local -a fake_args - if [ -f "${pkg_fake_env}" ]; then - fake_args=( "-i" "${pkg_fake_env}" ) - fi - fake_args[${#fake_args[@]}]="-u" - - export ${!pkg_*} ${!ptx_*} - fakeroot "${fake_args[@]}" -- ptxd_make_ipkg_finish_impl -} -export -f ptxd_make_ipkg_finish diff --git a/scripts/lib/ptxd_make_opkg_finish.sh b/scripts/lib/ptxd_make_opkg_finish.sh index 583a5ef24..d303c6d15 100644 --- a/scripts/lib/ptxd_make_opkg_finish.sh +++ b/scripts/lib/ptxd_make_opkg_finish.sh @@ -20,18 +20,3 @@ ptxd_make_opkg_finish_impl() { } export -f ptxd_make_opkg_finish_impl - -# -# create an opkg package -# -ptxd_make_opkg_finish() { - local -a fake_args - if [ -f "${pkg_fake_env}" ]; then - fake_args=( "-i" "${pkg_fake_env}" ) - fi - fake_args[${#fake_args[@]}]="-u" - - export ${!pkg_*} ${!ptx_*} - fakeroot "${fake_args[@]}" -- ptxd_make_opkg_finish_impl -} -export -f ptxd_make_opkg_finish diff --git a/scripts/lib/ptxd_make_xpkg_finish.sh b/scripts/lib/ptxd_make_xpkg_finish.sh index 9de4c15fd..cf1e89fc8 100644 --- a/scripts/lib/ptxd_make_xpkg_finish.sh +++ b/scripts/lib/ptxd_make_xpkg_finish.sh @@ -9,7 +9,20 @@ # see the README file. # +# +# run the actual package creation in fakeroot +# +ptxd_make_xpkg_finish_impl() { + local -a fake_args + if [ -f "${pkg_fake_env}" ]; then + fake_args=( "-i" "${pkg_fake_env}" ) + fi + fake_args[${#fake_args[@]}]="-u" + export ${!pkg_*} ${!ptx_*} + fakeroot "${fake_args[@]}" -- "ptxd_make_${pkg_xpkg_type}_finish_impl" +} +export -f ptxd_make_xpkg_finish_impl # # function to create a generic package @@ -57,7 +70,7 @@ EOF # create pkg # echo "xpkg_finish: creating ${pkg_xpkg_type} package ... " && - "ptxd_make_${pkg_xpkg_type}_finish" && + ptxd_make_xpkg_finish_impl && rm -rf "${pkg_xpkg_tmp}" || { local ret=$? echo "failed" -- cgit v1.2.3