Merge install and package update log init functions
[hvlinux.git] / functions / fpkg
index 588fa4a..dfbafae 100644 (file)
@@ -7,19 +7,6 @@ source ../functions/gztobz2
 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()
@@ -191,12 +178,13 @@ update_packages_init()
     # 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