diff --git a/android.sh b/android.sh index beae60d..ed3ae8c 100755 --- a/android.sh +++ b/android.sh @@ -229,6 +229,7 @@ for gpl_library in {$LIBRARY_X264,$LIBRARY_XVIDCORE,$LIBRARY_X265,$LIBRARY_LIBVI fi done +trap fail_operation EXIT echo -n -e "\nDownloading sources: " echo -e "INFO: Downloading the source code of ffmpeg and external libraries.\n" 1>>"${BASEDIR}"/build.log 2>&1 @@ -328,8 +329,7 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then RC=$(copy_external_library_license_file ${library} "${LICENSE_FILE}") if [[ ${RC} -ne 0 ]]; then - echo -e "DEBUG: Failed to copy the license file of ${ENABLED_LIBRARY}\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "ERROR: Failed to copy the license file of ${ENABLED_LIBRARY}\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 fi @@ -349,8 +349,7 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then RC=$? if [[ ${RC} -ne 0 ]]; then - echo -e "DEBUG: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "ERROR: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 fi @@ -381,7 +380,6 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then if [ $? -eq 0 ]; then echo "ok" else - echo "failed" exit 1 fi else @@ -399,7 +397,6 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then rm -f "${BASEDIR}"/android/ffmpeg-kit-android-lib/build/outputs/aar/ffmpeg-kit-release.aar 1>>"${BASEDIR}"/build.log 2>&1 ./gradlew ffmpeg-kit-android-lib:clean ffmpeg-kit-android-lib:assembleRelease ffmpeg-kit-android-lib:testReleaseUnitTest 1>>"${BASEDIR}"/build.log 2>&1 if [ $? -ne 0 ]; then - echo -e "failed\n" exit 1 fi @@ -409,7 +406,6 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then mkdir -p "${FFMPEG_KIT_AAR}" 1>>"${BASEDIR}"/build.log 2>&1 cp "${BASEDIR}"/android/ffmpeg-kit-android-lib/build/outputs/aar/ffmpeg-kit-release.aar "${FFMPEG_KIT_AAR}"/ffmpeg-kit.aar 1>>"${BASEDIR}"/build.log 2>&1 if [ $? -ne 0 ]; then - echo -e "failed\n" exit 1 fi diff --git a/ios.sh b/ios.sh index 04264eb..b30200d 100755 --- a/ios.sh +++ b/ios.sh @@ -254,6 +254,7 @@ for gpl_library in {$LIBRARY_X264,$LIBRARY_XVIDCORE,$LIBRARY_X265,$LIBRARY_LIBVI fi done +trap fail_operation EXIT echo -n -e "\nDownloading sources: " echo -e "INFO: Downloading the source code of ffmpeg and external libraries.\n" 1>>"${BASEDIR}"/build.log 2>&1 diff --git a/linux.sh b/linux.sh index 6fbb3ed..22ad107 100755 --- a/linux.sh +++ b/linux.sh @@ -185,6 +185,7 @@ for gpl_library in {$LIBRARY_X264,$LIBRARY_LINUX_XVIDCORE,$LIBRARY_LINUX_X265,$L fi done +trap fail_operation EXIT echo -n -e "\nDownloading sources: " echo -e "INFO: Downloading the source code of ffmpeg and external libraries.\n" 1>>"${BASEDIR}"/build.log 2>&1 diff --git a/macos.sh b/macos.sh index 9c94ce3..7e888a7 100755 --- a/macos.sh +++ b/macos.sh @@ -220,6 +220,7 @@ for gpl_library in {$LIBRARY_X264,$LIBRARY_XVIDCORE,$LIBRARY_X265,$LIBRARY_LIBVI fi done +trap fail_operation EXIT echo -n -e "\nDownloading sources: " echo -e "INFO: Downloading the source code of ffmpeg and external libraries.\n" 1>>"${BASEDIR}"/build.log 2>&1 diff --git a/scripts/android/ffmpeg.sh b/scripts/android/ffmpeg.sh index 3828868..6a1b8d4 100755 --- a/scripts/android/ffmpeg.sh +++ b/scripts/android/ffmpeg.sh @@ -85,7 +85,7 @@ for library in {0..61}; do pkg-config --libs --static cpu-features 2>>"${BASEDIR}"/build.log 1>/dev/null if [[ $? -eq 1 ]]; then echo -e "ERROR: cpu-features was not found in the pkg-config search path\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "\nffmpeg: failed\n\nSee build.log for details\n" + echo -e "\nffmpeg: " exit 1 fi ;; @@ -469,7 +469,6 @@ fi ${CONFIGURE_POSTFIX} 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi @@ -477,18 +476,15 @@ if [[ -z ${NO_OUTPUT_REDIRECTION} ]]; then make -j$(get_cpu_count) 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else echo -e "started\n" make -j$(get_cpu_count) + echo -n -e "\n${LIB_NAME}: " if [[ $? -ne 0 ]]; then - echo -n -e "\n${LIB_NAME}: failed\n\nSee build.log for details\n" exit 1 - else - echo -n -e "\n${LIB_NAME}: " fi fi @@ -499,7 +495,6 @@ fi make install 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi @@ -511,6 +506,5 @@ rsync -am --include='*.h' --include='*/' --exclude='*' "${BASEDIR}"/src/ffmpeg/ if [ $? -eq 0 ]; then echo "ok" else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi diff --git a/scripts/apple/ffmpeg-kit.sh b/scripts/apple/ffmpeg-kit.sh index 96af136..ba596ca 100755 --- a/scripts/apple/ffmpeg-kit.sh +++ b/scripts/apple/ffmpeg-kit.sh @@ -73,7 +73,6 @@ ${SED_INLINE} "s|allow_undefined_flag -o|allow_undefined_flag -target $(get_targ ${SED_INLINE} 's|\$rpath/\\$soname|@rpath/ffmpegkit.framework/ffmpegkit|g' libtool 1>>"${BASEDIR}"/build.log 2>&1 if [ $? -ne 0 ]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi @@ -89,6 +88,5 @@ make install 1>>"${BASEDIR}"/build.log 2>&1 if [ $? -eq 0 ]; then echo "ok" else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi diff --git a/scripts/apple/ffmpeg.sh b/scripts/apple/ffmpeg.sh index 6df906a..a52ad71 100755 --- a/scripts/apple/ffmpeg.sh +++ b/scripts/apple/ffmpeg.sh @@ -552,7 +552,6 @@ ${SED_INLINE} 's/static int av_log_level/__thread int av_log_level/g' "${BASEDIR ${CONFIGURE_POSTFIX} 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi @@ -561,18 +560,15 @@ build_ffmpeg() { make -j$(get_cpu_count) 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else echo -e "started\n" make -j$(get_cpu_count) + echo -n -e "\n${LIB_NAME}: " if [[ $? -ne 0 ]]; then - echo -n -e "\n${LIB_NAME}: failed\n\nSee build.log for details\n" exit 1 - else - echo -n -e "\n${LIB_NAME}: " fi fi } @@ -595,7 +591,6 @@ install_ffmpeg() { make install 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi } @@ -641,6 +636,5 @@ rsync -am --include='*.h' --include='*/' --exclude='*' "${BASEDIR}"/src/ffmpeg/ if [ $? -eq 0 ]; then echo "ok" else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi diff --git a/scripts/function-apple.sh b/scripts/function-apple.sh index b03caa9..8069b4d 100755 --- a/scripts/function-apple.sh +++ b/scripts/function-apple.sh @@ -262,8 +262,7 @@ create_ffmpeg_universal_library() { RC=$? if [[ ${RC} -ne 0 ]]; then - echo -e "DEBUG: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "ERROR: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 fi @@ -427,8 +426,7 @@ create_ffmpeg_framework() { RC=$? if [[ ${RC} -ne 0 ]]; then - echo -e "DEBUG: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "ERROR: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 fi @@ -1112,8 +1110,7 @@ get_sdk_path() { # 1. XCFRAMEWORK NAME # exit_xcframework() { - echo -e "INFO: Building $1 xcframework failed\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "ERROR: Building $1 xcframework failed\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 } @@ -1121,8 +1118,7 @@ exit_xcframework() { # 1. FRAMEWORK NAME # exit_framework() { - echo -e "INFO: Building $1 framework failed\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "ERROR: Building $1 framework failed\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 } @@ -1130,8 +1126,7 @@ exit_framework() { # 1. UNIVERSAL LIBRARY NAME # exit_universal_library() { - echo -e "\nINFO: Failed to build universal $1 library\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "\nERROR: Failed to build universal $1 library\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 } diff --git a/scripts/function-linux.sh b/scripts/function-linux.sh index 1b9989c..197f1be 100755 --- a/scripts/function-linux.sh +++ b/scripts/function-linux.sh @@ -98,14 +98,12 @@ install_pkg_config_file() { # DELETE OLD FILE rm -f "$DESTINATION" 2>>"${BASEDIR}"/build.log if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi # INSTALL THE NEW FILE cp "$SOURCE" "$DESTINATION" 2>>"${BASEDIR}"/build.log if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi @@ -165,8 +163,7 @@ create_linux_bundle() { RC=$(copy_external_library_license_file ${library} "${LICENSE_FILE}") if [[ ${RC} -ne 0 ]]; then - echo -e "DEBUG: Failed to copy the license file of ${ENABLED_LIBRARY}\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "ERROR: Failed to copy the license file of ${ENABLED_LIBRARY}\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 fi @@ -186,8 +183,7 @@ create_linux_bundle() { RC=$? if [[ ${RC} -ne 0 ]]; then - echo -e "DEBUG: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n\nSee build.log for details\n" + echo -e "ERROR: Failed to copy the license file of custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 fi diff --git a/scripts/function.sh b/scripts/function.sh index f256fb2..5d991c6 100755 --- a/scripts/function.sh +++ b/scripts/function.sh @@ -1928,8 +1928,8 @@ clone_git_repository_with_commit_id() { RC=$? - if [ ${RC} -ne 0 ]; then - echo -e "\nINFO: Failed to create local directory $2\n" 1>>"${BASEDIR}"/build.log 2>&1 + if [[ ${RC} -ne 0 ]]; then + echo -e "\nERROR: Failed to create local directory $2\n" 1>>"${BASEDIR}"/build.log 2>&1 rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return @@ -1941,8 +1941,8 @@ clone_git_repository_with_commit_id() { RC=$? - if [ ${RC} -ne 0 ]; then - echo -e "\nINFO: Failed to clone $1\n" 1>>"${BASEDIR}"/build.log 2>&1 + if [[ ${RC} -ne 0 ]]; then + echo -e "\nERROR: Failed to clone $1\n" 1>>"${BASEDIR}"/build.log 2>&1 rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return @@ -1952,8 +1952,8 @@ clone_git_repository_with_commit_id() { RC=$? - if [ ${RC} -ne 0 ]; then - echo -e "\nINFO: Failed to cd into $2\n" 1>>"${BASEDIR}"/build.log 2>&1 + if [[ ${RC} -ne 0 ]]; then + echo -e "\nERROR: Failed to cd into $2\n" 1>>"${BASEDIR}"/build.log 2>&1 rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return @@ -1963,8 +1963,8 @@ clone_git_repository_with_commit_id() { RC=$? - if [ ${RC} -ne 0 ]; then - echo -e "\nINFO: Failed to fetch commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 + if [[ ${RC} -ne 0 ]]; then + echo -e "\nERROR: Failed to fetch commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 rm -rf "$2" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return @@ -1974,8 +1974,8 @@ clone_git_repository_with_commit_id() { RC=$? - if [ ${RC} -ne 0 ]; then - echo -e "\nINFO: Failed to checkout commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 + if [[ ${RC} -ne 0 ]]; then + echo -e "\nERROR: Failed to checkout commit id $3 from $1\n" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return fi @@ -1995,8 +1995,8 @@ clone_git_repository_with_tag() { RC=$? - if [ ${RC} -ne 0 ]; then - echo -e "\nINFO: Failed to create local directory $3\n" 1>>"${BASEDIR}"/build.log 2>&1 + if [[ ${RC} -ne 0 ]]; then + echo -e "\nERROR: Failed to create local directory $3\n" 1>>"${BASEDIR}"/build.log 2>&1 rm -rf "$3" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return @@ -2008,8 +2008,8 @@ clone_git_repository_with_tag() { RC=$? - if [ ${RC} -ne 0 ]; then - echo -e "\nINFO: Failed to clone $1 -> $2\n" 1>>"${BASEDIR}"/build.log 2>&1 + if [[ ${RC} -ne 0 ]]; then + echo -e "\nERROR: Failed to clone $1 -> $2\n" 1>>"${BASEDIR}"/build.log 2>&1 rm -rf "$3" 1>>"${BASEDIR}"/build.log 2>&1 echo ${RC} return @@ -2035,34 +2035,26 @@ is_gpl_licensed() { downloaded_library_sources() { # DOWNLOAD FFMPEG SOURCE CODE FIRST - DOWNLOAD_RESULT=$(download_library_source "ffmpeg") - if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then - echo -e "failed\n" + if [[ $(download_library_source "ffmpeg") -ne 0 ]]; then exit 1 fi + # DOWNLOAD LIBRARY SOURCES for library in {1..50}; do if [[ ${!library} -eq 1 ]]; then library_name=$(get_library_name $((library - 1))) - echo -e "\nDEBUG: Downloading library ${library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 - - DOWNLOAD_RESULT=$(download_library_source "${library_name}") - if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then - echo -e "failed\n" + if [[ $(download_library_source "${library_name}") -ne 0 ]]; then exit 1 fi fi done + # DOWNLOAD CUSTOM LIBRARY SOURCES for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do library_name="CUSTOM_LIBRARY_${custom_library_index}_NAME" - echo -e "\nDEBUG: Downloading custom library ${!library_name}\n" 1>>"${BASEDIR}"/build.log 2>&1 - - DOWNLOAD_RESULT=$(download_custom_library_source "${custom_library_index}") - if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then - echo -e "failed\n" + if [[ $(download_custom_library_source "${custom_library_index}") -ne 0 ]]; then exit 1 fi done @@ -2089,7 +2081,7 @@ download() { else rm -f "${FFMPEG_KIT_TMPDIR}"/"$2" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e -n "\nINFO: Failed to download $1 to ${FFMPEG_KIT_TMPDIR}/$2, rc=${RC}. " 1>>"${BASEDIR}"/build.log 2>&1 + echo -e -n "\nERROR: Failed to download $1 to ${FFMPEG_KIT_TMPDIR}/$2, rc=${RC}. " 1>>"${BASEDIR}"/build.log 2>&1 if [ "$3" == "exit" ]; then echo -e "DEBUG: Build will now exit.\n" 1>>"${BASEDIR}"/build.log 2>&1 @@ -2135,7 +2127,7 @@ download_library_source() { fi if [ ${DOWNLOAD_RC} -ne 0 ]; then - echo -e "INFO: Downloading library $1 failed. Can not get library from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 + echo -e "ERROR: Downloading library $1 failed. Can not get library from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 echo ${DOWNLOAD_RC} else echo -e "\nINFO: $1 library downloaded" 1>>"${BASEDIR}"/build.log 2>&1 @@ -2186,7 +2178,7 @@ download_custom_library_source() { fi if [ ${DOWNLOAD_RC} -ne 0 ]; then - echo -e "INFO: Downloading custom library ${LIB_NAME} failed. Can not get library from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 + echo -e "ERROR: Downloading custom library ${LIB_NAME} failed. Can not get library from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 echo ${DOWNLOAD_RC} else echo -e "\nINFO: ${LIB_NAME} custom library downloaded" 1>>"${BASEDIR}"/build.log 2>&1 @@ -2222,8 +2214,7 @@ download_gnu_config() { DOWNLOAD_RC=$(clone_git_repository_with_tag "${SOURCE_REPO_URL}" "${SOURCE_ID}" "${LIB_LOCAL_PATH}") if [[ ${DOWNLOAD_RC} -ne 0 ]]; then - echo -e "INFO: Downloading gnu config failed. Can not get source from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 - echo -e "failed\n" + echo -e "ERROR: Downloading gnu config failed. Can not get source from ${SOURCE_REPO_URL}\n" 1>>"${BASEDIR}"/build.log 2>&1 exit 1 else echo -e "\nINFO: gnu config downloaded successfully\n" 1>>"${BASEDIR}"/build.log 2>&1 @@ -2423,3 +2414,8 @@ initialize_folder() { return 0 } + +fail_operation() { + echo -e "failed\n" + echo -e "See build.log for the details\n" +} diff --git a/scripts/linux/ffmpeg-kit.sh b/scripts/linux/ffmpeg-kit.sh index b827e03..08f42a0 100755 --- a/scripts/linux/ffmpeg-kit.sh +++ b/scripts/linux/ffmpeg-kit.sh @@ -48,7 +48,6 @@ autoreconf_library "${LIB_NAME}" 1>>"${BASEDIR}"/build.log 2>&1 || return 1 --host="${HOST}" 1>>"${BASEDIR}"/build.log 2>&1 if [ $? -ne 0 ]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi @@ -62,7 +61,6 @@ make -j$(get_cpu_count) install 1>>"${BASEDIR}"/build.log 2>&1 if [ $? -eq 0 ]; then echo "ok" else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi diff --git a/scripts/linux/ffmpeg.sh b/scripts/linux/ffmpeg.sh index 068672c..de4c8ea 100755 --- a/scripts/linux/ffmpeg.sh +++ b/scripts/linux/ffmpeg.sh @@ -414,7 +414,6 @@ ${SED_INLINE} 's/static int av_log_level/__thread int av_log_level/g' "${BASEDIR ${CONFIGURE_POSTFIX} 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi @@ -422,18 +421,15 @@ if [[ -z ${NO_OUTPUT_REDIRECTION} ]]; then make -j$(get_cpu_count) 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else echo -e "started\n" make -j$(get_cpu_count) + echo -n -e "\n${LIB_NAME}: " if [[ $? -ne 0 ]]; then - echo -n -e "\n${LIB_NAME}: failed\n\nSee build.log for details\n" exit 1 - else - echo -n -e "\n${LIB_NAME}: " fi fi @@ -444,7 +440,6 @@ fi make install 1>>"${BASEDIR}"/build.log 2>&1 if [[ $? -ne 0 ]]; then - echo -e "failed\n\nSee build.log for details\n" exit 1 fi @@ -465,6 +460,5 @@ rsync -am --include='*.h' --include='*/' --exclude='*' "${BASEDIR}"/src/ffmpeg/ if [ $? -eq 0 ]; then echo "ok" else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi diff --git a/scripts/main-android.sh b/scripts/main-android.sh index 9f0bfd7..4169d35 100755 --- a/scripts/main-android.sh +++ b/scripts/main-android.sh @@ -178,11 +178,7 @@ while [ ${#enabled_library_list[@]} -gt $completed ]; do declare "$BUILD_COMPLETED_FLAG=1" check_if_dependency_rebuilt "${library}" echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else @@ -219,11 +215,7 @@ for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do # SET SOME FLAGS AFTER THE BUILD if [ $RC -eq 0 ]; then echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else diff --git a/scripts/main-ios.sh b/scripts/main-ios.sh index 1a4f693..d61dd29 100755 --- a/scripts/main-ios.sh +++ b/scripts/main-ios.sh @@ -155,11 +155,7 @@ while [ ${#enabled_library_list[@]} -gt $completed ]; do declare "$BUILD_COMPLETED_FLAG=1" check_if_dependency_rebuilt "${library}" echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else @@ -196,11 +192,7 @@ for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do # SET SOME FLAGS AFTER THE BUILD if [ $RC -eq 0 ]; then echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else diff --git a/scripts/main-linux.sh b/scripts/main-linux.sh index 7a8a1e2..a83d838 100755 --- a/scripts/main-linux.sh +++ b/scripts/main-linux.sh @@ -75,11 +75,7 @@ while [ ${#enabled_library_list[@]} -gt $completed ]; do declare "$BUILD_COMPLETED_FLAG=1" check_if_dependency_rebuilt "${library}" echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else @@ -116,11 +112,7 @@ for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do # SET SOME FLAGS AFTER THE BUILD if [ $RC -eq 0 ]; then echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else diff --git a/scripts/main-macos.sh b/scripts/main-macos.sh index 96481ab..5b586fb 100755 --- a/scripts/main-macos.sh +++ b/scripts/main-macos.sh @@ -154,11 +154,7 @@ while [ ${#enabled_library_list[@]} -gt $completed ]; do declare "$BUILD_COMPLETED_FLAG=1" check_if_dependency_rebuilt "${library}" echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else @@ -195,11 +191,7 @@ for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do # SET SOME FLAGS AFTER THE BUILD if [ $RC -eq 0 ]; then echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else diff --git a/scripts/main-tvos.sh b/scripts/main-tvos.sh index c11d177..4c128b8 100755 --- a/scripts/main-tvos.sh +++ b/scripts/main-tvos.sh @@ -153,11 +153,7 @@ while [ ${#enabled_library_list[@]} -gt $completed ]; do declare "$BUILD_COMPLETED_FLAG=1" check_if_dependency_rebuilt "${library}" echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else @@ -194,11 +190,7 @@ for custom_library_index in "${CUSTOM_LIBRARIES[@]}"; do # SET SOME FLAGS AFTER THE BUILD if [ $RC -eq 0 ]; then echo "ok" - elif [ $RC -eq 200 ]; then - echo -e "not supported\n\nSee build.log for details\n" - exit 1 else - echo -e "failed\n\nSee build.log for details\n" exit 1 fi else diff --git a/tvos.sh b/tvos.sh index 6221dac..dc69c19 100755 --- a/tvos.sh +++ b/tvos.sh @@ -234,6 +234,7 @@ for gpl_library in {$LIBRARY_X264,$LIBRARY_XVIDCORE,$LIBRARY_X265,$LIBRARY_LIBVI fi done +trap fail_operation EXIT echo -n -e "\nDownloading sources: " echo -e "INFO: Downloading the source code of ffmpeg and external libraries.\n" 1>>"${BASEDIR}"/build.log 2>&1