From 1b898edf2cfe2d6e3c40ac524465402752d6dd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Thu, 26 Sep 2013 00:45:25 +0200 Subject: [PATCH] Fixed two bugs that cropped up in previous commit. --- dotpercent-files.py | 4 ++-- updatehash.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dotpercent-files.py b/dotpercent-files.py index d8f4d34..c971690 100755 --- a/dotpercent-files.py +++ b/dotpercent-files.py @@ -46,12 +46,12 @@ for arg in sys.argv[2:]: elif state == 'tri': if arg[-1:] == '/': tris.append(arg) - else + else: tris.append(arg + '/') elif state == 'vrac': if arg[-1:] == '/': vracs.append(arg) - else + else: vracs.append(arg + '/') else: help() diff --git a/updatehash.py b/updatehash.py index 438edb9..60058c2 100755 --- a/updatehash.py +++ b/updatehash.py @@ -85,7 +85,7 @@ def update(connection,cursor,path): print "commit!" print "cleaning up..." - likepath=('' + path).replace('%', '%%') + '%'; + likepath=((path + '') if (path[-1:] == '/') else (path + '/')).replace('%', '%%') + '%'; cursor.execute("create temp table deletedfiles(path)") cursor.execute("create index i_deletedfiles_path on deletedfiles(path)") cursor.execute("insert into deletedfiles(path) select path from files where path like ?", (likepath,));