From eb8a96cb60cfdc2e20018a90e979cc48bf7b48ef Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Thu, 4 Oct 2012 21:36:46 +0100 Subject: [PATCH] Added some extra debug and protection when getting mux config. --- support/getmuxlist | 19 +++++++++++++++++-- support/mkbundle | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/support/getmuxlist b/support/getmuxlist index dae32eb1..c2b1b7a8 100755 --- a/support/getmuxlist +++ b/support/getmuxlist @@ -7,20 +7,35 @@ URL=http://linuxtv.org/hg/dvb-apps/archive/tip.tar.bz2 TMP=/tmp/getmuxlist.$$ TVH=$(cd $(dirname $0)/..; pwd)/data/dvb-scan +function die +{ + [ ! -z "$1" ] && echo $1 || echo + rm -rf $TMP + rm -rf $TVH + exit 1 +} + # Get files rm -rf $TMP mkdir -p $TMP cd $TMP -(wget -O - -q $URL | tar xj) || (curl $URL | tar xj) -cd dvb-apps* +echo -n "fetching scan files ... " +(wget -O - -q $URL | tar xj) 2> /dev/null ||\ +(curl $URL | tar xj) 2> /dev/null +cd dvb-apps* 2> /dev/null || die "failed" +echo "done" # Copy to TVH +echo -n "moving into tvh data/ directory ... " rm -rf $TVH mkdir -p $TVH mv ./util/scan/* $TVH +echo "done" # Cleanup +echo -n "cleaning up ... " for f in $TVH/*; do [ -f $f ] && rm -f $f done rm -rf $TMP +echo "done" diff --git a/support/mkbundle b/support/mkbundle index 9bc114d0..8818c592 100755 --- a/support/mkbundle +++ b/support/mkbundle @@ -125,7 +125,7 @@ def add_entry ( ents, path = "", name = "", idx = -1, next = -1 ): for k in ents: # File - if not ents[k]: + if ents[k] is None: output_file(d, k, idx+1, p) p = idx = idx + 1 c = c + 1