mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
add foreach so packages for different archs won't conflict
This commit is contained in:
parent
db2bf1c2ce
commit
c682569e43
1 changed files with 6 additions and 4 deletions
10
archreposrv
10
archreposrv
|
@ -144,6 +144,7 @@ class EventHandler(pyinotify.ProcessEvent):
|
||||||
pkgname text,
|
pkgname text,
|
||||||
pkgarch text,
|
pkgarch text,
|
||||||
pkgver text,
|
pkgver text,
|
||||||
|
forarch text,
|
||||||
owner text,
|
owner text,
|
||||||
mtime int,
|
mtime int,
|
||||||
state int)''')
|
state int)''')
|
||||||
|
@ -244,8 +245,9 @@ class EventHandler(pyinotify.ProcessEvent):
|
||||||
|
|
||||||
def _real_dispatch(self, d, act):
|
def _real_dispatch(self, d, act):
|
||||||
if act.action == 'add':
|
if act.action == 'add':
|
||||||
|
arch = os.path.split(d)[1]
|
||||||
def callback():
|
def callback():
|
||||||
self._db.execute('update pkginfo set state = 0 where pkgname = ? and pkgarch = ?', (act.name, act.arch))
|
self._db.execute('update pkginfo set state = 0 where pkgname = ? and forarch = ?', (act.name, arch))
|
||||||
stat = os.stat(act.path)
|
stat = os.stat(act.path)
|
||||||
mtime = int(stat.st_mtime)
|
mtime = int(stat.st_mtime)
|
||||||
try:
|
try:
|
||||||
|
@ -255,9 +257,9 @@ class EventHandler(pyinotify.ProcessEvent):
|
||||||
|
|
||||||
self._db.execute(
|
self._db.execute(
|
||||||
'''insert or replace into pkginfo
|
'''insert or replace into pkginfo
|
||||||
(filename, pkgname, pkgarch, pkgver, state, owner, mtime) values
|
(filename, pkgname, pkgarch, pkgver, forarch, state, owner, mtime) values
|
||||||
(?, ?, ?, ?, ?, ?, ?)''',
|
(?, ?, ?, ?, ?, ?, ?, ?)''',
|
||||||
(act.path, act.name, act.arch, act.fullversion, 1, owner, mtime))
|
(act.path, act.name, act.arch, act.fullversion, arch, 1, owner, mtime))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
res = self._db.execute('select state from pkginfo where filename = ? and state = 1 limit 1', (act.path,))
|
res = self._db.execute('select state from pkginfo where filename = ? and state = 1 limit 1', (act.path,))
|
||||||
|
|
Loading…
Add table
Reference in a new issue