hook. Because we reject pushes to tags in the update hook, no push
can ever take out a lock on any tags.
- I'm sure that long description gives you great confidence in teh
+ I'm sure that long description gives you great confidence in the
legitimacy of my reasoning.
"""
- if config.build.pockets[pocket].get('allow_backtracking', False):
+ if not config.build.pockets[pocket].get('allow_backtracking', False):
env = dict(os.environ)
branch = b.pocketToGit(pocket)
version = b.getVersion(package, ref)
@contextlib.contextmanager
-def packageWorkdir(package):
+def packageWorkdir(package, commit):
"""Checkout the package in a temporary working directory.
This context manager returns that working directory. The requested
# do the build ourselves
else:
db.failed_stage = 'checking out package source'
- with packageWorkdir(package) as workdir:
+ with packageWorkdir(package, commit) as workdir:
db.failed_stage = 'preparing source package'
packagedir = os.path.join(workdir, package)
uploadBuild(pocket, workdir)
db.failed_stage = 'cleaning up'
-
- # Finally, now that everything is done, remove the
- # build queue item
- os.unlink(os.path.join(b._QUEUE_DIR, build))
except:
db.traceback = traceback.format_exc()
else:
database.session.save_or_update(db)
database.session.commit()
+ # Finally, now that everything is done, remove the
+ # build queue item
+ os.unlink(os.path.join(b._QUEUE_DIR, build))
+
reportBuild(db)
class Invirtibuilder(pyinotify.ProcessEvent):
"""Process inotify triggers to build new packages."""
- def process_IN_CREATE(self, event):
- """Handle a created file or directory.
+ def process_default(self, event):
+ """Handle an inotify event.
- When an IN_CREATE event comes in, trigger the builder.
+ When an inotify event comes in, trigger the builder.
"""
build()
invirtibuilder = Invirtibuilder()
notifier = pyinotify.Notifier(watch_manager, invirtibuilder)
watch_manager.add_watch(b._QUEUE_DIR,
- pyinotify.EventsCodes.ALL_FLAGS['IN_CREATE'])
+ pyinotify.EventsCodes.ALL_FLAGS['IN_CREATE'] |
+ pyinotify.EventsCodes.ALL_FLAGS['IN_MOVED_TO'])
# Before inotifying, run any pending builds; otherwise we won't
# get notified for them.