mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
multiple actions to same package, let's do latter
That is, existing + add + remove = removed
This commit is contained in:
parent
7fea77f5ae
commit
36623c805e
1 changed files with 4 additions and 6 deletions
|
@ -198,16 +198,14 @@ class RepoMan:
|
|||
actiondict[act.name] = act
|
||||
else:
|
||||
oldact = actiondict[act.name]
|
||||
if oldact == act and oldact.action != act.action:
|
||||
# same package, opposite actions, do nothing
|
||||
del actiondict[act.name]
|
||||
else:
|
||||
# take the later action, but record the former
|
||||
if oldact != act:
|
||||
# different packages, do the latter, but record the former
|
||||
try:
|
||||
actiondict[act.name].callback(state=0)
|
||||
except:
|
||||
logger.exception('failed to run action %r.', actiondict[act.name])
|
||||
actiondict[act.name] = act
|
||||
# same package, do the latter, and discard the forter
|
||||
actiondict[act.name] = act
|
||||
toadd = [(x.path, x.callback) for x in actiondict.values() if x.action == 'add']
|
||||
toremove = [(x.name, x.callback) for x in actiondict.values() if x.action == 'remove']
|
||||
self._do_add(toadd)
|
||||
|
|
Loading…
Add table
Reference in a new issue