projects
/
hvlinux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Latest ffmpeg svn & Firefox
[hvlinux.git]
/
functions
diff --git
a/functions
b/functions
index
7afb023
..
1fb9fa4
100644
(file)
--- a/
functions
+++ b/
functions
@@
-20,8
+20,16
@@
WARNING="echo -en \\033[1;33m"
# FAILURE prints text in a red colour
FAILURE="echo -en \\033[1;31m"
# FAILURE prints text in a red colour
FAILURE="echo -en \\033[1;31m"
+# It seems that when compiling bash-4.0, using
+# "make -j 1" is causing problems...
+if [ "x${MAKEJOBS}" == "x1" ]; then
+ HVMAKE="make"
+else
+ HVMAKE="make -j ${MAKEJOBS}"
+fi
+
# Extracting the version number from a complete package name.
# Extracting the version number from a complete package name.
-# Arg. #1: Complete package name with version (ex:
gcc-3.4.4 will output 3.4.4
)
+# Arg. #1: Complete package name with version (ex:
firefox-3.5.5.source will output 3.5.5
)
get_pkg_ver()
{
# Checking for correct number of arguments
get_pkg_ver()
{
# Checking for correct number of arguments
@@
-30,7
+38,7
@@
get_pkg_ver()
return 1
fi
return 1
fi
- echo ${1} | sed "s!
^.*-\(.*\)!\1!g"
+ echo ${1} | sed "s!
.*-\(\([0-9]\.\)*\).*!\1!g" | sed 's!\.$!!g'
}
# Extracting the base version number from a complete package name.
}
# Extracting the base version number from a complete package name.
@@
-487,11
+495,7
@@
static_decompressed_dirname()
{
local PACKAGE=${1}
{
local PACKAGE=${1}
- local DIRNAME=$(dirname $(tar -tf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 | head -n1))
-
- if [ "x${DIRNAME}" == "x." ]; then
- DIRNAME=$(basename $(tar -tf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 | head -n1))
- fi
+ local DIRNAME=$(tar -tf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 | head -n1 | awk -F \/ '{print $1}')
echo ${DIRNAME}
}
echo ${DIRNAME}
}
@@
-518,7
+522,7
@@
apply_patches()
if [ $# -eq 2 ]; then
TARGET_DIR=${2}
else
if [ $# -eq 2 ]; then
TARGET_DIR=${2}
else
- TARGET_DIR=$
(static_decompressed_dirname ${PACKAGE})
+ TARGET_DIR=$
{PACKAGE}
fi
# Checking if we can find at least one patch.
fi
# Checking if we can find at least one patch.
@@
-584,11
+588,9
@@
decompress_package()
return ${EXIT_FAILURE}
fi
return ${EXIT_FAILURE}
fi
- local DECOMPRESSED_DIRNAME=$(static_decompressed_dirname ${PACKAGE})
-
- if [ -d ${TOPDIR}/${DECOMPRESSED_DIRNAME} ]; then
+ if [ -d ${TOPDIR}/${PACKAGE} ]; then
# Removing old source directory (if any)
# Removing old source directory (if any)
- rm -v -rf ${TOPDIR}/${
DECOMPRESSED_DIRNAM
E} || exit 1
+ rm -v -rf ${TOPDIR}/${
PACKAG
E} || exit 1
fi
# Decompressing package
fi
# Decompressing package
@@
-606,14
+608,20
@@
decompress_package()
ipkg()
{
# Checking for correct number of arguments
ipkg()
{
# Checking for correct number of arguments
- if [ $# -
ne
2 ]; then
+ if [ $# -
lt
2 ]; then
echo
echo "${FUNCNAME}(): Wrong number of arguments"
echo " command was: \"${FUNCNAME}() $*\""
exit ${EXIT_FAILURE}
fi
echo
echo "${FUNCNAME}(): Wrong number of arguments"
echo " command was: \"${FUNCNAME}() $*\""
exit ${EXIT_FAILURE}
fi
- static_ipkg ${1} ${2} ${1}
+ local PACKAGE=${1}
+ shift
+ local CUSTOM_SCRIPT=${1}
+ shift
+ local CONFIGURE_OPTS=${*}
+
+ static_ipkg ${PACKAGE} ${CUSTOM_SCRIPT} ${PACKAGE} ${CONFIGURE_OPTS}
}
# Installation of a package conforming to GNU autotools.
}
# Installation of a package conforming to GNU autotools.
@@
-746,7
+754,7
@@
static_ipkg()
exit ${EXIT_FAILURE}
fi
exit ${EXIT_FAILURE}
fi
- PACKAGE_LOG=${LFS_LOG_DIR}/${
PACKAGE_NAME
}.log
+ PACKAGE_LOG=${LFS_LOG_DIR}/${
LABEL
}.log
# Checking if package was previously successfully installed
if grep "^${LABEL} successfully installed" ${LFS_LOG_FILE} \
# Checking if package was previously successfully installed
if grep "^${LABEL} successfully installed" ${LFS_LOG_FILE} \
@@
-763,11
+771,15
@@
static_ipkg()
decompress_package ${PACKAGE_NAME} 1>> ${PACKAGE_LOG} 2>&1
eval_retval2
decompress_package ${PACKAGE_NAME} 1>> ${PACKAGE_LOG} 2>&1
eval_retval2
- # Get the name of the decompressed directory
local DECOMPRESSED_DIRNAME=$(static_decompressed_dirname ${PACKAGE_NAME})
local DECOMPRESSED_DIRNAME=$(static_decompressed_dirname ${PACKAGE_NAME})
+ # Rename the decompressed package as per the package name if necessary
+ if [ "x${DECOMPRESSED_DIRNAME}" != "x${PACKAGE_NAME}" ]; then
+ mv ${LFS_TMP}/${DECOMPRESSED_DIRNAME} ${LFS_TMP}/${PACKAGE_NAME} || exit 1
+ fi
+
# Displaying package source size in log file
# Displaying package source size in log file
- echo " Source size:" $(du -h -s ${LFS_TMP}/${
DECOMPRESSED_DIR
NAME} | awk '{ print $1 }') 1>> ${LFS_LOG_FILE}
+ echo " Source size:" $(du -h -s ${LFS_TMP}/${
PACKAGE_
NAME} | awk '{ print $1 }') 1>> ${LFS_LOG_FILE}
# Removing old build directory (if any)
if [ -d ${LFS_TMP}/${PACKAGE_NAME}-build ]; then
# Removing old build directory (if any)
if [ -d ${LFS_TMP}/${PACKAGE_NAME}-build ]; then
@@
-784,14
+796,14
@@
static_ipkg()
eval_retval2
# Displaying package build size in log file
eval_retval2
# Displaying package build size in log file
- BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${
DECOMPRESSED_DIR
NAME} ${LFS_TMP}/${PACKAGE_NAME}-build | grep total | awk '{ print $1 }')
+ BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${
PACKAGE_
NAME} ${LFS_TMP}/${PACKAGE_NAME}-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.
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.
- if [ -d ${LFS_TMP}/${
DECOMPRESSED_DIR
NAME} ]; then
+ if [ -d ${LFS_TMP}/${
PACKAGE_
NAME} ]; then
# Removing source directory
# Removing source directory
- rm -v -rf ${LFS_TMP}/${
DECOMPRESSED_DIR
NAME} 1>> ${PACKAGE_LOG} 2>&1
+ rm -v -rf ${LFS_TMP}/${
PACKAGE_
NAME} 1>> ${PACKAGE_LOG} 2>&1
eval_retval2
fi
if [ -d ${LFS_TMP}/${PACKAGE_NAME}-build ]; then
eval_retval2
fi
if [ -d ${LFS_TMP}/${PACKAGE_NAME}-build ]; then
@@
-873,12
+885,13
@@
action_checkbox_time()
# Display the action name, run a command, log its output and display it's
# status. Write to install log file when successfully completed so it
# won't be called again after a successfull installation.
# Display the action name, run a command, log its output and display it's
# status. Write to install log file when successfully completed so it
# won't be called again after a successfull installation.
-# First argument:
label (string)
-# Second argument: script name
+# First argument:
Message to display during action
+# Second argument: script name
(will be label)
run_script_log()
{
run_script_log()
{
-
LABEL
=${1}
+
MSGSTRING
=${1}
SCRIPT=${2}
SCRIPT=${2}
+ LABEL=${SCRIPT}
# Checking for correct number of arguments
if [ $# -lt 2 ]; then
# Checking for correct number of arguments
if [ $# -lt 2 ]; then
@@
-905,7
+918,7
@@
run_script_log()
fi
# Displaying script name
fi
# Displaying script name
- echo -n "[ ] ${
LABEL
}"
+ echo -n "[ ] ${
MSGSTRING
}"
echo "------------------------" 1>> ${LFS_LOG_FILE}
echo "Running " ${LABEL} 1>> ${LFS_LOG_FILE}
echo 1>> ${LFS_LOG_FILE}
echo "------------------------" 1>> ${LFS_LOG_FILE}
echo "Running " ${LABEL} 1>> ${LFS_LOG_FILE}
echo 1>> ${LFS_LOG_FILE}