FPKG_USER="root"
FPKG_GROUP="users"
-LFS_PKG_BASE="$(dirname $(pwd))/packages"
-LFS_PKG_DIR="${LFS_PKG_BASE}/${LFS_STAGE}"
-LFS_PATCHES_DIR="${LFS_PKG_BASE}/${LFS_STAGE}/patches"
-LFS_LOG_DIR="${LFS}/var/log/hvlinux-install/${LFS_STAGE}"
-LFS_LOG_FILE="${LFS_LOG_DIR}/pkg-update.log"
-WGET_LOG_FILE="${LFS_LOG_DIR}/pkg-wget.log"
-
-WGETCMD="wget --directory-prefix=${LFS_PKG_DIR} --timeout=15 --tries=3 -nc --continue --no-check-certificate --no-verbose --output-file=${WGET_LOG_FILE}"
-
-LFS_PATCHES_LIST=${LFS_PKG_DIR}/patches/list-lfs.html
-BLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches/list-blfs.html
-CLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches/list-clfs.html
-
# Test if the given file extension correspond to a compressed archive
# Arg. #1: File extension
is_extension_archive()
# downloading other packages
export RCMD_NO_EXIT=1
- test_presence_of_packages_directory
+ init_log_file_update
- # First create log directory if it does not exists.
- if [ ! -d ${LFS_LOG_DIR} ]; then
- install -m755 -d ${LFS_LOG_DIR} || exit 1
- fi
+ export LFS_PATCHES_LIST=${LFS_PKG_DIR}/patches/list-lfs.html
+ export BLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches/list-blfs.html
+ export CLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches/list-clfs.html
+ export WGET_LOG_FILE="${LFS_LOG_DIR}/pkg-wget.log"
+ export WGETCMD="wget --directory-prefix=${LFS_PKG_DIR} --timeout=15 --tries=3 -nc --continue --no-check-certificate --no-verbose --output-file=${WGET_LOG_FILE}"
# Then create destination directory if it does not exists.
if [ ! -d ${LFS_PKG_DIR} ]; then
}
# Create log directory and log file for current stage if necessary
-# This should be done automatically...
-init_log_file()
+# Arg #1: log file name
+static_init_log_file()
{
+ # Checking for correct number of arguments
+ if [ $# -ne 1 ]; then
+ echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+ return 1
+ fi
+
+ local LOG_FILE_NAME=${1}
+
# Scripts directory
export SCRDIR=$(pwd)
test_presence_of_packages_directory
- export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
- export LFS_PATCHES_DIR="${SCRDIR}/patches"
+ export LFS_PKG_BASE="$(dirname $(pwd))/packages"
+ export LFS_PKG_DIR="${LFS_PKG_BASE}/${LFS_STAGE}"
export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/${LFS_STAGE}
- export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
+ export LFS_LOG_FILE=${LFS_LOG_DIR}/${LOG_FILE_NAME}
export LFS_TMP="${LFS}/tmp"
mkdir -p ${LFS_LOG_DIR} &&
fi
}
+# Create log directory and install log file for current stage if necessary
+init_log_file()
+{
+ static_init_log_file "install.log"
+ export LFS_PATCHES_DIR="${SCRDIR}/patches"
+}
+
+# Create log directory and update log file for current stage if necessary
+init_log_file_update()
+{
+ static_init_log_file "pkg-update.log"
+ export LFS_PATCHES_DIR="${LFS_PKG_DIR}/patches"
+}
+
# Check that we are logged in as the root user, and exit if this is not the case.
check_for_root_user()
{