This commit is contained in:
ville rantanen
2013-07-08 13:58:58 +03:00

View File

@@ -101,7 +101,11 @@ def add_recurse(options):
#if not is_listed(db,filename): #if not is_listed(db,filename):
if file not in db_files: if file not in db_files:
if options.add: if options.add:
add_single(conn,filename,change=False,minsize=options.minsize) try:
add_single(conn,filename,change=False,minsize=options.minsize)
except:
print('error adding file: '+filename)
sys.exit(1)
else: else:
if options.changed: if options.changed:
ftime=os.path.getmtime(filename) ftime=os.path.getmtime(filename)
@@ -109,7 +113,11 @@ def add_recurse(options):
#if not hash_match(db,filename,hash): #if not hash_match(db,filename,hash):
if not ftime_match(db,filename,ftime): if not ftime_match(db,filename,ftime):
#file content changed #file content changed
add_single(conn,filename,change=True,minsize=options.minsize) try:
add_single(conn,filename,change=True,minsize=options.minsize)
except:
print('error changing file: '+filename)
sys.exit(1)
# if file mentioned, and hash same, no need to change entry # if file mentioned, and hash same, no need to change entry
conn.commit() conn.commit()
return return