$(ROOTDIR)/data/dvb-scan/.stamp:
@echo "Receiving data/dvb-scan from https://github.com/tvheadend/dtv-scan-tables.git#tvheadend"
@rm -rf $(ROOTDIR)/data/dvb-scan/*
- @$(ROOTDIR)/support/getmuxlist $(ROOTDIR)/data/dvb-scan
+ sh -x $(ROOTDIR)/support/getmuxlist $(ROOTDIR)/data/dvb-scan
@touch $@
.PHONY: check_dvb_scan
#
# Arguments
-DIR=$1
-[ -z "$DIR" ] && DIR=$(dirname "$0")/../data/dvb-scan
+[ -z "$BRANCH" ] && BRANCH=tvheadend
+[ -z "$URL" ] && URL=https://github.com/tvheadend/dtv-scan-tables.git
+DIR="$1" && [ -z "$DIR" ] && DIR=$(dirname "$0")/../data/dvb-scan
# Update
if [ -d "${DIR}/.git" ]; then
cd "${DIR}" || exit 1
git fetch --tags > /dev/null 2>&1 || exit 1
hash1=$(git rev-parse HEAD)
- hash2=$(git rev-parse origin/tvheadend)
+ hash2=$(git rev-parse origin/${BRANCH})
if [ "$hash1" != "$hash2" ]; then
git reset --hard origin/master > /dev/null 2>&1 || exit 1
git pull > /dev/null 2>&1 || exit 1
+ else
+ if [ ! -r README ]; then
+ git reset --hard > /dev/null 2>&1 || exit 1
+ fi
fi
+ pwd
+ ls -la *
+ ls -la .git/
+ cat .git/config
cd "${LAST}" || exit 1
# Fetch
elif [ ! -d "${DIR}" ]; then
- URL=https://github.com/tvheadend/dtv-scan-tables.git
- BRANCH=tvheadend
- git clone -b $BRANCH $URL "${DIR}" > /dev/null 2>&1 || exit 1
+ git clone -b "${BRANCH}" "${URL}" "${DIR}" > /dev/null 2>&1 || exit 1
fi
# Note: will not update existing set (if not .git)