Added some extra debug and protection when getting mux config.

This commit is contained in:
Adam Sutton 2012-10-04 21:36:46 +01:00
parent aa5c84eb8c
commit eb8a96cb60
2 changed files with 18 additions and 3 deletions

View file

@ -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"

View file

@ -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