From b3853c9243e8f114ea4c1f00f58cfa2cecb9ad51 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Thu, 18 Apr 2013 10:52:46 +0200 Subject: [PATCH 1/2] beesh: add timeout and try count to wget call If wget could not establish a connection within 1 minute we will exit and not try to download the file again. --- src/beesh.sh.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/beesh.sh.in b/src/beesh.sh.in index fcc8876..d33ee67 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -283,6 +283,8 @@ function fetch_one_file() { ${nocheck} \ --output-document="${F}/${file}" \ --no-clobber \ + --timeout=60 \ + --tries=1 \ "${url}" || true trap - EXIT From ecaeb5674aad4bbd1b8639802c5d210be4768472 Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Wed, 24 Jul 2013 09:35:38 +0200 Subject: [PATCH 2/2] bee-cache: implement option print-missing-files --- src/bee-cache.sh.in | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/bee-cache.sh.in b/src/bee-cache.sh.in index f1bf5f1..50deed2 100644 --- a/src/bee-cache.sh.in +++ b/src/bee-cache.sh.in @@ -147,6 +147,23 @@ function print_uniq_files_for_pkg() { | grep -E "^${pkg} " } +function print_missing_files() { + local pkg=$1 + + if [ -z "${pkg}" ] ; then + pkg="*" + fi + + while read line; do + file=$(cut -d ' ' -f 8- <<< ${line}) + + if [ ! -e "${file}" ]; then + echo "${line}" + fi + done < <( tmp_merge_install_inventory_files "${TMPINSTALL[@]}" ) \ + | grep -E "^${pkg} " +} + function tmp_merge_install_inventory_files() { ${BEEFLOCK} --shared ${BEECACHE_INVENTORY} sort -m -u -r -k8 -k1 \ ${BEECACHE_INVENTORY} "${@}" @@ -211,6 +228,7 @@ function usage() { print-uniq-files print-conflicting-files print-conflicts + print-missing-files [pkgname] EOF } @@ -281,6 +299,9 @@ case "${cmd}" in print-conflicts) print_conflicts "${@}" | cut -d ' ' -f${FIELDS} ;; + print-missing-files) + print_missing_files "${@}" | cut -d ' ' -f${FIELDS} + ;; *) echo >&2 "bee-cache: ${cmd}: Unknown command." exit 1