X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;ds=sidebyside;f=functions%2Fipkg;h=61ba49238cf1bef267b251d8b3f32193fb6f3200;hb=3a7d016a0246156de63a6f98bbf5be2e95230060;hp=2fd39ebb66065bd9ae4302dc340d3c3eea409194;hpb=aae6368436cbee5d6e7b6ce0cc6d624df238c15b;p=hvlinux.git diff --git a/functions/ipkg b/functions/ipkg index 2fd39eb..61ba492 100644 --- a/functions/ipkg +++ b/functions/ipkg @@ -24,13 +24,24 @@ unset -f hvconfig_cache unset -f hvconfig_post unset -f hvbuild_post -ipkg_decompress_package() +# Arg #1: Clean label for debug message (optional) +function dir_cleanup() { # Removing old build directory (if any) if [ -d ${LFS_TMP}/${PACKAGE} ]; then - echo "Removing old build directory" + echo "Removing ${1} source directory" rm -rf ${LFS_TMP}/${PACKAGE} fi + if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then + echo "Removing ${1} build directory" + rm -rf ${LFS_TMP}/${PACKAGE}-build + fi +} + +ipkg_decompress_package() +{ + # Removing old source and build directories (if any) + dir_cleanup "old" echo "Decompressing package" decompress_package ${PACKAGE} @@ -80,7 +91,12 @@ hvconfig() hvbuild() { ${HVMAKE} - ${HVMAKE} install + + if [ -n "${INSTALL_DIR}" ]; then + ${HVMAKE} DESTDIR=${INSTALL_DIR} install + else + ${HVMAKE} install + fi } # Default patch applying function @@ -107,15 +123,7 @@ ipkg_finish() # Some scripts need to preserve the source or build directory. They can # do so by renaming them. - if [ -d ${LFS_TMP}/${PACKAGE} ]; then - # Removing source directory - echo "Removing source directory" - rm -rf ${LFS_TMP}/${PACKAGE} - fi - if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then - echo "Removing build directory" - rm -rf ${LFS_TMP}/${PACKAGE}-build - fi + dir_cleanup else BUILD_SIZE="Unknown" fi @@ -209,7 +217,9 @@ ipkg_script() hvconfig_post fi - cd ${BUILD_DIR} + if [ -d ${BUILD_DIR} ]; then + cd ${BUILD_DIR} + fi hvbuild # Execute post-build function if applicable