Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
a435f3ac
Commit
a435f3ac
authored
Nov 21, 2011
by
JINMEI Tatuya
Browse files
[master] Merge branch 'trac1404'
parents
77d69c99
6dd27022
Changes
5
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
a435f3ac
SUBDIRS
=
doc src tests
SUBDIRS
=
compatcheck
doc src tests
USE_LCOV
=
@USE_LCOV@
LCOV
=
@LCOV@
GENHTML
=
@GENHTML@
...
...
compatcheck/Makefile.am
0 → 100644
View file @
a435f3ac
noinst_SCRIPTS
=
sqlite3-difftbl-check.py
# We're going to abuse install-data-local for a pre-install check.
# This is to be considered a short term hack and is expected to be removed
# in a near future version.
install-data-local
:
$(PYTHON)
sqlite3-difftbl-check.py
\
$(localstatedir)
/
$(PACKAGE)
/zone.sqlite3
compatcheck/README
0 → 100644
View file @
a435f3ac
This directory is a collection of compatibility checker programs.
They will be run before any other installation attempts on 'make install'
to see if the installation causes any substantial compatibility problems
with existing configuratons. If any checker program finds an issue,
'make install' will stop at that point.
compatcheck/sqlite3-difftbl-check.py.in
0 → 100755
View file @
a435f3ac
#!@PYTHON@
# Copyright (C) 2011 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import os, sqlite3, sys
from optparse import OptionParser
usage = 'usage: %prog [options] db_file'
parser = OptionParser(usage=usage)
parser.add_option("-u", "--upgrade", action="store_true",
dest="upgrade", default=False,
help="Upgrade the database file [default: %default]")
(options, args) = parser.parse_args()
if len(args) == 0:
parser.error('missing argument')
db_file = args[0]
# If the file doesn't exist, there's nothing to do
if not os.path.exists(db_file):
sys.exit(0)
conn = sqlite3.connect(db_file)
cur = conn.cursor()
try:
# This can be anything that works iff the "diffs" table exists
cur.execute('SELECT name FROM diffs DESC LIMIT 1')
except sqlite3.OperationalError as ex:
# If it fails with 'no such table', create a new one or fail with
# warning depending on the --upgrade command line option.
if str(ex) == 'no such table: diffs':
if options.upgrade:
cur.execute('CREATE TABLE diffs (id INTEGER PRIMARY KEY, ' +
'zone_id INTEGER NOT NULL, ' +
'version INTEGER NOT NULL, ' +
'operation INTEGER NOT NULL, ' +
'name STRING NOT NULL COLLATE NOCASE, ' +
'rrtype STRING NOT NULL COLLATE NOCASE, ' +
'ttl INTEGER NOT NULL, rdata STRING NOT NULL)')
else:
sys.stdout.write('Found an older version of SQLite3 DB file: ' +
db_file + '\n' + "Peform '" + os.getcwd() +
"/sqlite3-difftbl-check.py --upgrade " +
db_file + "'\n" +
'before continuing install.\n')
sys.exit(1)
conn.close()
configure.ac
View file @
a435f3ac
...
...
@@ -816,6 +816,7 @@ AM_CONDITIONAL(INSTALL_CONFIGURATIONS, test x$install_configurations = xyes || t
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/guide/Makefile
compatcheck/Makefile
src/Makefile
src/bin/Makefile
src/bin/bind10/Makefile
...
...
@@ -937,6 +938,7 @@ AC_CONFIG_FILES([Makefile
tests/tools/badpacket/tests/Makefile
])
AC_OUTPUT([doc/version.ent
compatcheck/sqlite3-difftbl-check.py
src/bin/cfgmgr/b10-cfgmgr.py
src/bin/cfgmgr/tests/b10-cfgmgr_test.py
src/bin/cmdctl/cmdctl.py
...
...
@@ -1016,6 +1018,7 @@ AC_OUTPUT([doc/version.ent
tests/system/ixfr/in-3/setup.sh
tests/system/ixfr/in-4/setup.sh
], [
chmod +x compatcheck/sqlite3-difftbl-check.py
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
chmod +x src/bin/xfrin/run_b10-xfrin.sh
chmod +x src/bin/xfrout/run_b10-xfrout.sh
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment