X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=functions%2Ffpkg;h=eedc14dc18192ad43f067d1f63b7ca658d6476d2;hb=769abe2665103a85d34685c3e1fff5d04480c47a;hp=588fa4afeea01b9f43fe1da16f48c4a4fa929a94;hpb=493d265f572abd5cd5d116a60f6d95a6e40d26b6;p=hvlinux.git diff --git a/functions/fpkg b/functions/fpkg index 588fa4a..eedc14d 100644 --- a/functions/fpkg +++ b/functions/fpkg @@ -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() @@ -167,17 +154,24 @@ wget_wrapper() # Arg. #2: Destination filename. static_fetch_patches_list() { + local wget_status + PATCHES_URL=${1} PATCHES_LIST_FILENAME=${2} # Appending a slash (/) will download the directory content as a file named # index.html - ${WGETCMD} "${PATCHES_URL}/" && + ${WGETCMD} "${PATCHES_URL}/" + wget_status=$? # Append log to global log file - cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE} && + cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE} - mv ${LFS_PKG_DIR}/index.html ${PATCHES_LIST_FILENAME} + if [ ${wget_status} -eq 0 ]; then + mv ${LFS_PKG_DIR}/index.html ${PATCHES_LIST_FILENAME} + else + return 1 + fi } # Arg. #1: If "test" is specified, set TEST_INTEGRITY to 1 @@ -191,12 +185,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 @@ -222,7 +217,7 @@ update_packages_init() if [ -n "${USE_LFS_PATCHES}" ]; then # Getting list of all patches from LFS server. - rcmd "Fetching LFS patches list" static_fetch_patches_list \ + rcmd "Fetching LFS patches list" static_fetch_patches_list \ ${LFS_PATCHES_URL} ${LFS_PATCHES_LIST} fi @@ -249,6 +244,11 @@ static_checkpatch() local PATCHES_LIST=${2} local PATCHES_URL=${3} + # Make sure patch list file exists + if [ ! -f ${PATCHES_LIST} ]; then + return + fi + # Remplace les "+" par "%2B" local PACK_URL=$(echo $PACK | sed s!\+!%2B!g)