On Sat, Sep 25, 2004 at 05:29:48AM +0200, Joey Hess wrote:
> Package: debconf
> Tags: patch
> 
> ----- Forwarded message from Miro <[EMAIL PROTECTED]> -----
> 
> From: Miro <[EMAIL PROTECTED]>
> Date: Fri, 24 Sep 2004 19:08:09 +0200
> To: Joey Hess <[EMAIL PROTECTED]>
> Subject: Debconf patch
> User-Agent: Mutt/1.4.2i
> 
> Hello,
> 
> I had problems with apt-get after patching perl source and recompiling
> it to permit flock by fcntl (webservers working with a NetApp).
> 
> I had this type of error from machines:
> web4:~# dpkg -i /var/cache/apt/archives/screen_4.0.2-3_i386.deb
> (Reading database ... 21690 files and directories currently installed.)
> Unpacking screen (from .../screen_4.0.2-3_i386.deb) ...
> debconf: DbDriver "configdb" error: /var/cache/debconf/config.dat is locked 
> by another process
> dpkg: error processing /var/cache/apt/archives/screen_4.0.2-3_i386.deb 
> (--install):
>  subprocess pre-installation script returned error exit status 1
> Errors were encountered while processing:
>  /var/cache/apt/archives/screen_4.0.2-3_i386.deb
> 
> In fact, the way flock is used in Directory.pm and File.pm doesn't
> work with fcntl calls.
> I have joined the patch with this mail.
> 
> Thanks
> Miroslaw KLABA
> ovh.com
> 
> diff -ru debconf-1.4.30.5.orig/Debconf/DbDriver/Directory.pm 
> debconf-1.4.30.5/Debconf/DbDriver/Directory.pm
> --- debconf-1.4.30.5.orig/Debconf/DbDriver/Directory.pm       2004-09-13 
> 11:55:39.000000000 +0200
> +++ debconf-1.4.30.5/Debconf/DbDriver/Directory.pm    2004-09-24 
> 18:58:25.000000000 +0200
> @@ -92,7 +92,7 @@
>               # dropped when this object is destroyed.
>               open ($this->{lock}, ">".$this->{directory}."/.lock") or
>                       $this->error("could not lock $this->{directory}: $!");
> -             flock($this->{lock}, LOCK_EX | LOCK_NB) or
> +             (flock($this->{lock}, LOCK_EX | LOCK_NB) < 0) and
>                       $this->error("$this->{directory} is locked by another 
> process");

Surely this is a perl bug, or a bug in your (Miro's) perl patch? The
perl flock() documentation is very clear on its return value:

               Calls flock(2), or an emulation of it, on FILEHANDLE.  Returns
               true for success, false on failure.

Cheers,

-- 
Colin Watson                                       [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to