From 5bad037fa71bcd7684ae1ffc7549b7b45fa08af5 Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 11 Apr 2022 13:29:32 +0100 Subject: added error logging --- src/get.sh | 4 ++-- src/profile.sh | 3 ++- src/util.sh | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/get.sh b/src/get.sh index 3c49e3a..b99340f 100755 --- a/src/get.sh +++ b/src/get.sh @@ -91,8 +91,8 @@ download_package () { ${VERBOSE} && printf "${LIGHT_BLACK}downloading $package from $url\n" $package $checksum touch $output - (curl ${CURL_OPTS} -o "$output_info" "$url.info" || printf "${RED}Failed to download info for %s\n" $package) & - (curl ${CURL_OPTS} -o "$output" "$url" || printf "${RED}Failed to download %s\n" $package) & + (curl ${CURL_OPTS} -o "$output_info" "$url.info" 2>> ${LOG_FILE} || printf "${RED}Failed to download info for %s\n" $package) & + (curl ${CURL_OPTS} -o "$output" "$url" 2>> ${LOG_FILE} || printf "${RED}Failed to download %s\n" $package) & } download_packages () { diff --git a/src/profile.sh b/src/profile.sh index 2bd741e..b0fa785 100755 --- a/src/profile.sh +++ b/src/profile.sh @@ -8,7 +8,7 @@ export CONF_FILE="/etc/xipkg.conf" -export CURL_OPTS="-sL" +export CURL_OPTS="-sSL" export DEP_DIR=$(parseconf -v dir.deps) export REPOS="$(parseconf -v repos)" @@ -22,3 +22,4 @@ export CACHE_DIR=$(parseconf -v dir.cache) export PACKAGE_CACHE="${CACHE_DIR}/packages" export SYNC_CACHE="${CACHE_DIR}/sync" +export LOG_FILE="/var/log/xipkg.log" diff --git a/src/util.sh b/src/util.sh index 98af40b..501da96 100644 --- a/src/util.sh +++ b/src/util.sh @@ -1,7 +1,7 @@ #!/bin/sh download_file() { - curl ${CURL_OPTS} -o $1 -w "%{http_code}" $2 2> /dev/null + curl ${CURL_OPTS} -o $1 -w "%{http_code}" $2 2>> ${LOG_FILE} } # this function is broken -- cgit v1.2.1