mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
don't touch symlinks
This commit is contained in:
parent
241f9e7eb9
commit
fd89d43863
1 changed files with 10 additions and 3 deletions
|
@ -4,6 +4,7 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import pwd
|
import pwd
|
||||||
|
import stat
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from itertools import filterfalse
|
from itertools import filterfalse
|
||||||
import queue
|
import queue
|
||||||
|
@ -405,9 +406,15 @@ class EventHandler(pyinotify.ProcessEvent):
|
||||||
# Touch the pacakge file so that we'll repo-add it again to include the
|
# Touch the pacakge file so that we'll repo-add it again to include the
|
||||||
# sig change later.
|
# sig change later.
|
||||||
pkg = path[:-4]
|
pkg = path[:-4]
|
||||||
if os.path.exists(pkg):
|
try:
|
||||||
logger.info('touching %s.', pkg)
|
st = os.lstat(pkg)
|
||||||
os.close(os.open(pkg, os.O_WRONLY))
|
print(pkg, st)
|
||||||
|
if stat.S_ISREG(st.st_mode):
|
||||||
|
logger.info('touching %s.', pkg)
|
||||||
|
os.close(os.open(pkg, os.O_WRONLY))
|
||||||
|
os.utime(pkg)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
if action == 'add':
|
if action == 'add':
|
||||||
self._db.execute('''insert or replace into sigfiles
|
self._db.execute('''insert or replace into sigfiles
|
||||||
|
|
Loading…
Add table
Reference in a new issue