From 93c0ead890fab419e86ecbf7865e444bf085c444 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Thu, 10 Mar 2011 03:13:34 +0000 Subject: [PATCH] =?utf8?q?Modification=20pour=20permettre=20la=20v=C3=A9ri?= =?utf8?q?fication=20de=20l'int=C3=A9grit=C3=A9=20des=20archives=20sans=20?= =?utf8?q?r=C3=A9seau=20actif?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- functions/fpkg | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/functions/fpkg b/functions/fpkg index 020443b..f637f54 100644 --- a/functions/fpkg +++ b/functions/fpkg @@ -71,6 +71,11 @@ update_packages_init() install -v -m755 -d ${LFS_PKG_DIR} 1> ${LFS_LOG_FILE} 2>&1 || exit 1 fi + if [ -n "${TEST_INTEGRITY}" ]; then + # En mode test intégrité, on ne veut pas télécharger quoi que ce soit + return 0 + fi + if [ -n "${USE_LFS_PATCHES}" ]; then # Getting list of all patches from LFS server. rcmd "Fetching LFS patches list" static_fetch_patches_list ${LFS_PATCHES_URL} ${LFS_PATCHES_LIST} @@ -255,7 +260,8 @@ test_archive_integrity() local EXT=${3} if [ ! -f ${FILE} ]; then - return 1 + # The file may be absent, in this case simply abort without error + return 0 fi local TESTCMD="" @@ -498,22 +504,29 @@ fpkg() DEST_FILE=${DEST_DIR}/${PACK}.${FINAL_EXT} if [ ! -f ${DEST_FILE} ]; then - set +e - static_getpkg ${SRC_FILENAME} ${URL} ${FILE_EXT} - set -e - - # Move file if source filename is not equal to package name and/or - # destination directory is not the default: - DOWNLOADED_FILE=${LFS_PKG_DIR}/${SRC_FILENAME}.${FINAL_EXT} - DEST_FILE=${DEST_DIR}/${PACK}.${FINAL_EXT} - - if [ "${DEST_FILE}" != "${DOWNLOADED_FILE}" ]; then - mv ${DOWNLOADED_FILE} ${DEST_FILE} - fi + if [ -z "${TEST_INTEGRITY}" ]; then + # Fetch package, unless we are testing integrity + set +e + static_getpkg ${SRC_FILENAME} ${URL} ${FILE_EXT} + set -e + + # Move file if source filename is not equal to package name and/or + # destination directory is not the default: + DOWNLOADED_FILE=${LFS_PKG_DIR}/${SRC_FILENAME}.${FINAL_EXT} + DEST_FILE=${DEST_DIR}/${PACK}.${FINAL_EXT} + + if [ "${DEST_FILE}" != "${DOWNLOADED_FILE}" ]; then + mv ${DOWNLOADED_FILE} ${DEST_FILE} + fi + fi fi if [ -n "${TEST_INTEGRITY}" ]; then test_archive_integrity "${PACK}" "${DEST_FILE}" "${FINAL_EXT}" + + # We do not want to fetch patches when testing integrity, + # so return immediately + return 0 fi # Check for available patches with PACKAGE (TARGET) name. -- 2.20.1