From 63e907404bc9fdb5f3d47e360a0a58318e696d6d Mon Sep 17 00:00:00 2001
From: ExpoOnServer <devnull@localhost>
Date: Thu, 14 Jul 2011 03:13:06 +0100
Subject: [PATCH] updates to scripts surveytable needs tobe moved to new
 section of repo tools and scripts should be separated somehow

---
 Makefile                                      | 33 ++++++++++++++-----
 noinfo/create_dplong_table.py                 |  6 ++--
 .../make-prospectingguide-new.py              |  2 +-
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index 9dd091f95..350bee4c6 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,8 @@ svxtrace_cmd = ./svxtrace.py
 
 ###########
 
-everything: autogen_pages folklist 3dfiles tarfiles surveytable qmlists prospecting_guide
+#everything: autogen_pages folklist 3dfiles tarfiles surveytable qmlists prospecting_guide
+everything: autogen_pages folklist 3dfiles tarfiles qmlists prospecting_guide
 
 ###########
 
@@ -23,14 +24,18 @@ autogen_pages: indxal.htm
 # cavestats should be BUILT AUTOMATICALLY rather than having to be
 # built manually in a survex build tree.
 indxal.htm: noinfo/CAVETAB2.CSV noinfo/all.pos noinfo/make-indxal4.pl noinfo/areapage_skeletons/*.html noinfo/lengths.dat
-	python noinfo/make-areaindices.py
-	-(cd noinfo && perl ./make-indxal4.pl CAVETAB2.CSV)
+	python noinfo/make-areaindices.py noinfo/cavestats
+	cd noinfo; perl ./make-indxal4.pl -q CAVETAB2.CSV
 
 noinfo/lengths.dat:
-	-python noinfo/create_dplong_table.py || echo "Carry on and build other targets anyway"
+	python noinfo/create_dplong_table.py
 
 noinfo/all.pos: noinfo/all.3d
 	3dtopos noinfo/all.3d noinfo/all.pos
+	
+noinfo/cavestats:
+	# This needs a built copy of survex sources. See
+        # noinfo/cavestats.build for details
 
 ###########
 
@@ -41,8 +46,9 @@ folk/index.htm: noinfo/folk.csv noinfo/make-folklist.py
 
 ###########
 
-surveytable:
-	cd $(surveydir_path); perl tablize-csv.pl Surveys.csv; perl tablizebyname-csv.pl Surveys.csv --quiet
+#This is now part of separate repo and should be built separately 
+#surveytable:
+#	cd $(surveydir_path); perl tablize-csv.pl Surveys.csv; perl tablizebyname-csv.pl Surveys.csv --quiet
 
 
 
@@ -86,10 +92,21 @@ noinfo/alltracks.3d: $(shell $(svxtrace_cmd) $(dataset_path)/fixedpts/gps/tracks
 
 ###########
 
-prospecting_guide: 3dfiles
+#this requires ttf-freefont package to be installed
+#And dump3d from survex
+prospecting_guide: 3dfiles freefont dump3d
 	cd noinfo/prospecting_guide_scripts && python make-prospectingguide-new.py
 	cd noinfo/prospecting_guide_scripts && python make-prospectingguide-new.py --white
 
+freefont: /usr/share/fonts/truetype/freefont/FreeSans.ttf
+        # ttf-freefont needs to be installed (or MS corefonts) 
+
+
+dump3d: noinfo/prospecting_guide_scripts/dump3d
+       # apt-get source survex && sudo apt-get build-dep survex
+       # cd survex-* && debuild
+       # make dump3d && cp dump3d $(pwd)/noinfo/prospecting_guide_scripts/dump3d
+
 ###########
 
 tarfiles: noinfo/all.tgz smkridge/204/surveydata.tgz smkridge/234/surveydata.tgz plateau/76/surveydata.tgz
@@ -118,7 +135,7 @@ clean:
 	rm -f smkridge/204/surveydata.tgz smkridge/234/surveydata.tgz plateau/76/surveydata.tgz noinfo/all.tgz
 	rm -f $(surveydir_path)/surveytable.html
 	rm -f report.html
-	find . -name ".cvsignore" | xargs rm
+	find . -name ".cvsignore" | xargs rm -f
 
 ###########
 
diff --git a/noinfo/create_dplong_table.py b/noinfo/create_dplong_table.py
index 0e3fbfa95..c6b8e7b68 100644
--- a/noinfo/create_dplong_table.py
+++ b/noinfo/create_dplong_table.py
@@ -87,9 +87,9 @@ def parse_csvfile():
 
 # Main routine:
 
-if (not os.access('CS_BINARY', os.X_OK)): 
-	print "%s not executable - skipping %s" % (CS_BINARY, __file__)
-	exit(1)
+#if (not os.access('CS_BINARY', os.X_OK)): 
+#	print "CS_BINARY not executable - skipping %s" % __file__
+#	exit(1)
 	
 caveslist = parse_csvfile()
 
diff --git a/noinfo/prospecting_guide_scripts/make-prospectingguide-new.py b/noinfo/prospecting_guide_scripts/make-prospectingguide-new.py
index a755f2f2a..d42a714c1 100644
--- a/noinfo/prospecting_guide_scripts/make-prospectingguide-new.py
+++ b/noinfo/prospecting_guide_scripts/make-prospectingguide-new.py
@@ -315,7 +315,7 @@ surfacecolour = "#808080"
 repath = re.compile(r'^(?:182to(?:tc|184)|tctocol|82to97|vd1to161d|161ftod|161etof|161etog|40entlink2|surfnr161|surf161|kansurf)$')
 for fnm in ("all.3d", "alltracks.3d"):
 	for mapcode in draws.keys():
-		file3d = os.popen("dump3d ../" + fnm)
+		file3d = os.popen("./dump3d ../" + fnm)
 		draw = draws[mapcode]
 		lastx, lasty = 0, 0
 		for l in file3d: