X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=functions-update;h=a72b304ea61d007e386a5488e31e4f3aa70d39a8;hb=7257be007e096ab1f7f6e3bf6c738b9b67b849f2;hp=33d9cf4fd0e440ab7e59fb3a5adcf676ea7c67f4;hpb=1786cd5454ea76e7f894efa81a7cef80a057b634;p=hvlinux.git diff --git a/functions-update b/functions-update index 33d9cf4..a72b304 100644 --- a/functions-update +++ b/functions-update @@ -96,11 +96,17 @@ static_checkpatch() local PATCHES_LIST=${2} local PATCHES_URL=${3} - local PATCHES_FOUND=$(cat ${PATCHES_LIST} | grep "${PACK}-" | sed "s/.*\(${PACK}-.*\.patch\).*/\1/") + # Remplace les "+" par "%2B" + local PACK_URL=$(echo $PACK | sed s!\+!%2B!g) + + local PATCHES_FOUND=$(cat ${PATCHES_LIST} | grep "${PACK_URL}-" | sed "s/.*\(${PACK_URL}-.*\.patch\).*/\1/") if [ -n "${PATCHES_FOUND}" ]; then for p in ${PATCHES_FOUND}; do - if [ ! -f ${LFS_PKG_DIR}/${p} ]; then - rcmd "Fetching ${p} from ${PATCHES_URL}" ${WGETCMD} ${PATCHES_URL}/${p} + # Remplace les "%2B" par "+" + PATCH_NAME=$(echo ${p} | sed s!%2B!\+!g) + + if [ ! -f ${LFS_PKG_DIR}/${PATCH_NAME} ]; then + rcmd "Fetching ${PATCH_NAME} from ${PATCHES_URL}" ${WGETCMD} ${PATCHES_URL}/${p} fi done fi @@ -229,9 +235,7 @@ static_getpkg() # so we can safely remove any file prior to trying to download it. rm -f ${LFS_PKG_DIR}/${PACK}.${arch_ext} - echo "Tryng to fetch ${PACK}.${arch_ext}" - - ${WGETCMD} ${URL}/${PACK}.${arch_ext} + rcmd "Fetching ${PACK}.${arch_ext}" ${WGETCMD} ${URL}/${PACK}.${arch_ext} wget_status=$? # Append log to global log file @@ -255,8 +259,9 @@ static_getpkg() return 1 fi - # If we arrive here, it means we were able to successfully download the file. - if [ "x${arch_ext}" = "xtar.gz" -o "x${arch_ext}" = "xtgz" -o "x${arch_ext}" = "xtar.Z" ]; then + # If we are here, it means the file was successfully downloaded. + if [ "x${arch_ext}" = "xtar.gz" -o "x${arch_ext}" = "xtgz" \ + -o "x${arch_ext}" = "xtar.Z" ]; then gztobz2 ${LFS_PKG_DIR}/${PACK}.${arch_ext} fi return $? @@ -319,17 +324,12 @@ fpkg() local PACK=${1} local URL=${2} - local FETCH_STRING="Fetching ${PACK}" if [ -z "${SRC_FILENAME}" ]; then # Default source filename = name of package SRC_FILENAME=${PACK} fi - if [ -n "${FILE_EXT}" ]; then - FETCH_STRING="${FETCH_STRING}.${FILE_EXT}" - fi - if [ -z "${FILE_EXT}" -o \ "x${FILE_EXT}" = "xtar.gz" -o \ "x${FILE_EXT}" = "xtgz" -o \ @@ -358,7 +358,9 @@ fpkg() DEST_FILE=${DEST_DIR}/${PACK}.${FINAL_EXT} if [ ! -f ${DEST_FILE} ]; then - rcmd "${FETCH_STRING}" static_getpkg ${SRC_FILENAME} ${URL} ${FILE_EXT} + 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: