-Now using a single file for all custom definitions and functions for each package.
[hvlinux.git] / functions
index 9a6496f..53747fd 100644 (file)
--- a/functions
+++ b/functions
@@ -130,8 +130,10 @@ get_pkg_name()
        return 1
     fi
 
-    # \1 matches anything followed by a dash and a number
-    echo ${1} | sed "s!^\(.*\)-[0-9].*!\1!g"
+    # SED do not support non-greedy regexp:
+    # We want to match any characters preceeding a dash followed by a number
+    # (shortest match -> non-greedy)
+    echo ${1} | sed "s!\([^-][^0-9]*\)-[0-9].*!\1!"
 }
 
 # Saves the content of CFLAGS and CXXFLAGS environment variables.
@@ -726,12 +728,6 @@ ipkg()
        exit ${EXIT_FAILURE}
     fi
 
-    # Checking if there is a corresponding config.cache file
-    local cache_file=$(pwd)/config.cache.$(get_pkg_name ${PACKAGE_NAME})
-    if [ -f ${cache_file} ]; then
-        CONFIGURE_OPTS="${CONFIGURE_OPTS} --cache-file=${cache_file}"
-    fi
-
     PACKAGE_LOG=${LFS_LOG_DIR}/${LABEL}.log
 
     # Checking if package was previously successfully installed