file text,
binary_id integer,
UNIQUE(file,binary_id))""" )
-
+
c.execute("""ALTER TABLE ONLY bin_contents
ADD CONSTRAINT bin_contents_bin_fkey
FOREIGN KEY (binary_id) REFERENCES binaries(id)
c.execute("""CREATE INDEX ind_bin_contents_binary ON bin_contents(binary_id);""" )
- self.db.commit()
+ c.execute("UPDATE config SET value = '17' WHERE name = 'db_revision'")
+ self.db.commit()
except psycopg2.ProgrammingError, msg:
self.db.rollback()
################################################################################
-#default_config = "/etc/dak/dak.conf"
-default_config = "/home/stew/etc/dak/dak.conf" #: default dak config, defines host properties
+default_config = "/etc/dak/dak.conf" #: default dak config, defines host properties
def which_conf_file(Cnf):
res = socket.gethostbyaddr(socket.gethostname())
for fullpath in fullpaths:
if fullpath.startswith( './' ):
fullpath = fullpath[2:]
-
+
session.execute( "INSERT INTO bin_contents ( file, binary_id ) VALUES ( :filename, :id )", { 'filename': fullpath, 'id': binary_id} )
session.commit()
try:
try:
file_handle = open_file(f)
-
+
# Check for the hash entry, to not trigger a KeyError.
if not files[f].has_key(hash_key(hashname)):
rejmsg.append("%s: misses %s checksum in %s" % (f, hashname,
where))
continue
-
+
# Actually check the hash for correctness.
if hashfunc(file_handle) != files[f][hash_key(hashname)]:
rejmsg.append("%s: %s check failed in %s" % (f, hashname,