[Lsb-messages] /var/www/bzr/lsb/devel/specdb r1255: Add sanity check to makefile.

Jeff Licquia licquia at linuxfoundation.org
Tue Jan 22 02:57:09 UTC 2013


------------------------------------------------------------
revno: 1255
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: specdb
timestamp: Mon 2013-01-21 21:57:09 -0500
message:
  Add sanity check to makefile.
  
  This cross-checks the embedded table lists with the data in the repository,
  and reports on any unusual situations.
modified:
  makefile
-------------- next part --------------
=== modified file 'makefile'
--- a/makefile	2013-01-22 02:00:26 +0000
+++ b/makefile	2013-01-22 02:57:09 +0000
@@ -35,6 +35,11 @@
 	JavaInterface RILMBuiltin RLibDeps RLibLink RLibRClass RLibRInt RawClass RawCommand RawILModule \
 	RawInterface RawLibSoname RawLibrary WeakSymbol
 
+# Used by the sanity checker for SQL scripts that don't correspond to
+# tables that should exist.
+SANITY_CHECKER_SQL=create_alias_detector create_cache_tables \
+	create_stored_procs create_triggers dbperms setupdb tmpdbperms
+
 ifeq (yes,$(DO_COPY))
 LOAD_LOCATION=$(TMPDIR)
 else
@@ -151,5 +156,23 @@
 
 dump_apps: $(APP_TABLES_DUMP)
 
+# Sanity-check table lists against the data in the repository.  For now,
+# we don't consider a missing .init file to be a problem.
+
+sanitycheck:
+	@for table in $(ELEMENTS) $(COMMUNITY); do \
+	  if [ '!' -e $$table.sql ]; then \
+	    echo "$$table missing table structure file $$table.sql"; \
+	  fi; \
+	done
+	@for table in *.sql; do \
+	  tablename=$$(basename $$table .sql); \
+	  if [ $$(echo $(ELEMENTS) $(COMMUNITY) $(SANITY_CHECKER_SQL) | grep $$tablename | wc -l) -eq 0 ]; then \
+	    echo "unknown table data found: $$table"; \
+	  fi; \
+	done
+
+# clean up
+
 clean:
 	rm -f elements_list



More information about the lsb-messages mailing list