X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;ds=sidebyside;f=functions%2Fipkg;h=77f51c4d92e050f050213ef7713f532ec8822430;hb=d98da13bfa3454ed0c2d08774042ec37f503417a;hp=23a1e1ab0aa559af4d79f637fdeb1718a662c083;hpb=f3c8db3027d5dc530e1f30c88e0235975211582e;p=hvlinux.git diff --git a/functions/ipkg b/functions/ipkg index 23a1e1a..77f51c4 100644 --- a/functions/ipkg +++ b/functions/ipkg @@ -1,5 +1,12 @@ #!/bin/bash +# Global input variables: +# PACKAGE_STATUS +# +# Global output variables: +# BUILD_SIZE +# SOURCE_SIZE + function_exists() { local FUNCTION_NAME=$1 @@ -29,8 +36,8 @@ ipkg_decompress_package() mv -v ${LFS_TMP}/${DECOMPRESSED_DIRNAME} ${LFS_TMP}/${PACKAGE} fi - # Displaying package source size in log file - echo " Source size:" $(du -h -s ${LFS_TMP}/${PACKAGE} | awk '{ print $1 }') 1>> ${LFS_LOG_FILE} + # Saving package source size in global variable. + SOURCE_SIZE=$(du -h -s ${LFS_TMP}/${PACKAGE} | awk '{ print $1 }') # Removing old build directory (if any) if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then @@ -90,9 +97,8 @@ ipkg_finish() # Make sure to return to scripts directory cd ${SCRDIR} - # Displaying package build size in log file + # Saving package build size in global variable BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${PACKAGE} ${LFS_TMP}/${PACKAGE}-build | grep total | awk '{ print $1 }') - echo " Build size : ${BUILD_SIZE}" 1>> ${LFS_LOG_FILE} # Some scripts need to preserve the source or build directory. They can # do so by renaming them. @@ -118,7 +124,6 @@ ipkg_script() else # Use default script name PACKAGE_DEF=${SCRDIR}/pkg/$(get_pkg_name ${PACKAGE}) - fi ipkg_decompress_package @@ -151,12 +156,14 @@ ipkg_script() --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache" fi - # Add option --disable-dependency-tracking if supported - if cat ${LFS_TMP}/${PACKAGE}/configure | \ - grep "disable-dependency-tracking" 1> /dev/null 2>&1; then - CONFIGURE_OPTS="\ - ${CONFIGURE_OPTS} \ - --disable-dependency-tracking" + if [ -x ${LFS_TMP}/${PACKAGE}/configure ]; then + # Add option --disable-dependency-tracking if supported + if cat ${LFS_TMP}/${PACKAGE}/configure | \ + grep -q "disable-dependency-tracking"; then + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --disable-dependency-tracking" + fi fi ipkg_display_build_infos