FreeBSD Bugzilla – Attachment 109000 Details for
Bug 149944
[maintainer update] devel/py-daemon fix API breakage caused by py-lockfile 0.8 -> 0.9
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.84 KB, created by
Jesse Kempf
on 2010-08-24 18:20:03 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Jesse Kempf
Created:
2010-08-24 18:20:03 UTC
Size:
2.84 KB
patch
obsolete
>diff -r 7c4277bef47a -r 2ab0812e456a py-daemon/Makefile >--- a/py-daemon/Makefile Tue Aug 24 15:39:31 2010 +0000 >+++ b/py-daemon/Makefile Tue Aug 24 17:05:52 2010 +0000 >@@ -16,7 +16,7 @@ > COMMENT= Well-behaved daemon framework for Python > > BUILD_DEPENDS=\ >- ${PYTHON_PKGNAMEPREFIX}lockfile>0:${PORTSDIR}/devel/py-lockfile >+ ${PYTHON_PKGNAMEPREFIX}lockfile>=0.9:${PORTSDIR}/devel/py-lockfile > > RUN_DEPENDS:= ${BUILD_DEPENDS} > >diff -r 7c4277bef47a -r 2ab0812e456a py-daemon/files/patch-daemon-pidlockfile.py >--- /dev/null Thu Jan 01 00:00:00 1970 +0000 >+++ b/py-daemon/files/patch-daemon-pidlockfile.py Tue Aug 24 17:05:52 2010 +0000 >@@ -0,0 +1,72 @@ >+--- daemon/pidlockfile.py.orig 2010-08-24 16:57:37.753374406 +0000 >++++ daemon/pidlockfile.py 2010-08-24 16:58:57.825989360 +0000 >+@@ -22,6 +22,7 @@ >+ NotLocked, NotMyLock, >+ ) >+ >++from lockfile.pidlockfile import PIDLockFile >+ >+ class PIDFileError(Exception): >+ """ Abstract base class for errors specific to PID files. """ >+@@ -30,61 +31,6 @@ >+ """ Raised when parsing contents of PID file fails. """ >+ >+ >+-class PIDLockFile(LinkFileLock, object): >+- """ Lockfile implemented as a Unix PID file. >+- >+- The PID file is named by the attribute `path`. When locked, >+- the file will be created with a single line of text, >+- containing the process ID (PID) of the process that acquired >+- the lock. >+- >+- The lock is acquired and maintained as per `LinkFileLock`. >+- >+- """ >+- >+- def read_pid(self): >+- """ Get the PID from the lock file. >+- """ >+- result = read_pid_from_pidfile(self.path) >+- return result >+- >+- def acquire(self, *args, **kwargs): >+- """ Acquire the lock. >+- >+- Locks the PID file then creates the PID file for this >+- lock. The `timeout` parameter is used as for the >+- `LinkFileLock` class. >+- >+- """ >+- super(PIDLockFile, self).acquire(*args, **kwargs) >+- try: >+- write_pid_to_pidfile(self.path) >+- except OSError, exc: >+- error = LockFailed("%(exc)s" % vars()) >+- raise error >+- >+- def release(self): >+- """ Release the lock. >+- >+- Removes the PID file then releases the lock, or raises an >+- error if the current process does not hold the lock. >+- >+- """ >+- if self.i_am_locking(): >+- remove_existing_pidfile(self.path) >+- super(PIDLockFile, self).release() >+- >+- def break_lock(self): >+- """ Break an existing lock. >+- >+- If the lock is held, breaks the lock and removes the PID >+- file. >+- >+- """ >+- super(PIDLockFile, self).break_lock() >+- remove_existing_pidfile(self.path) >+- >+- >+ class TimeoutPIDLockFile(PIDLockFile): >+ """ Lockfile with default timeout, implemented as a Unix PID file. >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 149944
: 109000