summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-04-11 13:29:32 +0100
committerdavidovski <david@davidovski.xyz>2022-04-11 13:29:32 +0100
commit5bad037fa71bcd7684ae1ffc7549b7b45fa08af5 (patch)
treeac62d88592ce424e5426849cc8949a0660cb80fe /src
parent55d1861110d56e35b2c13d7742e0dc7ca2dd2665 (diff)
added error loggingv1.1.7
Diffstat (limited to 'src')
-rwxr-xr-xsrc/get.sh4
-rwxr-xr-xsrc/profile.sh3
-rw-r--r--src/util.sh2
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