# Checks Debian packages from Incoming
# Copyright (C) 2000, 2001, 2002, 2003 James Troup <james@nocrew.org>
-# $Id: jennifer,v 1.31 2003-02-07 14:53:42 troup Exp $
+# $Id: jennifer,v 1.33 2003-03-14 19:06:02 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
################################################################################
-import FCNTL, errno, fcntl, gzip, os, re, shutil, stat, sys, time, traceback;
+import errno, fcntl, gzip, os, re, shutil, stat, sys, time, traceback;
import apt_inst, apt_pkg;
import db_access, katie, logging, utils;
################################################################################
# Globals
-jennifer_version = "$Revision: 1.31 $";
+jennifer_version = "$Revision: 1.33 $";
Cnf = None;
Options = None;
print "Sending new ack.";
Subst["__SUMMARY__"] = summary;
new_ack_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/jennifer.new");
- utils.send_mail(new_ack_message,"");
+ utils.send_mail(new_ack_message);
# Finally remove the originals.
os.chdir (pkg.directory);
if not Options["No-Action"]:
lock_fd = os.open(Cnf["Dinstall::LockFile"], os.O_RDWR | os.O_CREAT);
- fcntl.lockf(lock_fd, FCNTL.F_TLOCK);
+ try:
+ fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB);
+ except IOError, e:
+ if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EAGAIN':
+ utils.fubar("Couldn't obtain lock; assuming another jennifer is already running.");
+ else:
+ raise;
Logger = Katie.Logger = logging.Logger(Cnf, "jennifer");
# debian-{devel-,}-changes@lists.debian.org toggles writes access based on this header