Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Change getmuxlist back to bash script and make python soft dep. Also …

…some minor improvements to bundle code.
  • Loading branch information...
commit 4f5f23a6d75943189f99fa1ef2c9a9b6c8389eaa 1 parent ebf95d7
Adam Sutton authored September 03, 2012
9  Makefile
@@ -35,6 +35,13 @@ CFLAGS  += -I${BUILDDIR} -I${CURDIR}/src -I${CURDIR}
35 35
 LDFLAGS += -lrt -ldl -lpthread
36 36
 
37 37
 #
  38
+# Other config
  39
+#
  40
+
  41
+BUNDLE_FLAGS-${CONFIG_ZLIB} = -z
  42
+BUNDLE_FLAGS = ${BUNDLE_FLAGS-yes}
  43
+
  44
+#
38 45
 # Binaries/Scripts
39 46
 #
40 47
 
@@ -243,4 +250,4 @@ $(BUILDDIR)/bundle.o: $(BUILDDIR)/bundle.c
243 250
 
244 251
 $(BUILDDIR)/bundle.c:
245 252
 	@mkdir -p $(dir $@)
246  
-	$(MKBUNDLE) -o $@ -d ${BUILDDIR}/bundle.d -z $(BUNDLES)
  253
+	$(MKBUNDLE) -o $@ -d ${BUILDDIR}/bundle.d $(BUNDLE_FLAGS) $(BUNDLES)
16  configure
@@ -47,10 +47,8 @@ check_cc_option sse2
47 47
 #
48 48
 # Python
49 49
 #
50  
-check_py || die 'No PYTHON binary found'
51  
-check_py_import zlib pyzlib || die "Python module missing: zlib"
52  
-check_py_import tarfile pytar || die "Python module missing: tarfile"
53  
-# Note: the above could/should be made optional
  50
+check_py || echo 'WARN: no python binary found'
  51
+check_py_import gzip pygzip
54 52
 
55 53
 #
56 54
 # SSL
@@ -75,11 +73,9 @@ fi
75 73
 #
76 74
 # Bundling
77 75
 #
78  
-if enabled_or_auto bundle; then
79  
-  if enabled zlib; then
80  
-    enable bundle
81  
-  elif enabled bundle; then
82  
-    die "Zlib development support not found (use --disable-bundle)"
  76
+if enabled bundle; then
  77
+  if enabled zlib && ! enabled pygzip; then
  78
+    die "Python gzip module not found (use --disable-zlib or --disable-bundle)"
83 79
   fi
84 80
 fi
85 81
 
@@ -100,7 +96,7 @@ fi
100 96
 if enabled linuxdvb && enabled dvbscan; then
101 97
   if [ ! -d ${ROOTDIR}/data/dvb-scan ]; then
102 98
     echo -n "Fetching dvb-scan files... "
103  
-    ${PYTHON} ${ROOTDIR}/support/getmuxlist &> /dev/null || die "Failed to fetch dvb-scan files (use --disable-dvbscan to skip)"
  99
+    ${ROOTDIR}/support/getmuxlist &> /dev/null || die "Failed to fetch dvb-scan files (use --disable-dvbscan to skip)"
104 100
     echo "done"
105 101
   fi
106 102
 fi
2  src/filebundle.c
@@ -364,7 +364,7 @@ fb_file *fb_open2
364 364
 
365 365
       /* Inflate the file */
366 366
       if (fb->f.orig != -1 && decompress) {
367  
-#if ENABLE_BUNDLE
  367
+#if (ENABLE_ZLIB && ENABLE_BUNDLE)
368 368
         ret->gzip = 0;
369 369
         ret->size = fb->f.orig;
370 370
         ret->buf  = _fb_inflate(fb->f.data, fb->f.size, fb->f.orig);
36  support/getmuxlist
... ...
@@ -1,30 +1,26 @@
1  
-#!/usr/bin/env python
  1
+#!/bin/bash
2 2
 #
3 3
 # Retrieve the latest dvb-apps scan files
4 4
 #
5 5
 
6  
-import os, sys, shutil, glob, urllib2, tarfile
7  
-
8  
-url = 'http://linuxtv.org/hg/dvb-apps/archive/tip.tar.bz2'
9  
-tmp = '/tmp/getmuxlist.%d' % os.getpid()
10  
-out = os.path.abspath(os.path.dirname(sys.argv[0]) + '/../data/dvb-scan')
  6
+URL=http://linuxtv.org/hg/dvb-apps/archive/tip.tar.bz2
  7
+TMP=/tmp/getmuxlist.$$
  8
+TVH=$(cd $(dirname $0)/..; pwd)/data/dvb-scan
11 9
 
12 10
 # Get files
13  
-if os.path.exists(tmp):
14  
-  shutil.rmtree(tmp)
15  
-os.makedirs(tmp)
16  
-tbz = tmp + '/dvb-apps.tar.bz2'
17  
-open(tbz, 'w').write(urllib2.urlopen(url).read())
18  
-tp = tarfile.open(tbz)
19  
-tp.extractall(tmp)
  11
+rm -rf $TMP
  12
+mkdir -p $TMP
  13
+cd $TMP
  14
+(wget -O - -q $URL | tar xj) || (curl $URL | tar xj)
  15
+cd dvb-apps*
20 16
 
21 17
 # Copy to TVH
22  
-if os.path.exists(out):
23  
-  shutil.rmtree(out)
24  
-os.makedirs(out)
25  
-for d in glob.glob('%s/dvb-apps*/util/scan/*' % tmp):
26  
-  if os.path.isdir(d):
27  
-    shutil.move(d, out)
  18
+rm -rf $TVH
  19
+mkdir -p $TVH
  20
+mv ./util/scan/* $TVH
28 21
 
29 22
 # Cleanup
30  
-shutil.rmtree(tmp)
  23
+for f in $TVH/*; do
  24
+  [ -f $f ] && rm -f $f
  25
+done
  26
+rm -rf $TMP

0 notes on commit 4f5f23a

Please sign in to comment.
Something went wrong with that request. Please try again.