Your message dated Thu, 23 Aug 2007 16:32:06 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#324855: fixed in mini-dinstall 0.6.21-0.2
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: mini-dinstall
Version: 0.6.21
Severity: wishlist
Tags: patch

Hi,
regenerating the packages file can take up to several (>30) seconds when
there are lots of packages in an archive. 
During this time every "apt-get update" fails (there are several errors,
most of the time apt-get complains a about a bad Packages.gz, since it's
not a valid gzipped file). The attached patch now generates the
Packages{,.gz} as Packages.new.{,.gz} and moves them into place after
the regeneration.  This has the advantage that apt-get doesn't run into
an error code. 
If you have several hundred or thousand machines each of them pulling
from a repository via cron the chances of several machines hitting the
Packges.gz during the update process is quiet high...I've seen this
many times. Does the patch look o.k.?
Cheers,
 -- Guido


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13-rc3-agx0
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages mini-dinstall depends on:
ii  apt-utils                     0.6.40.1   APT utility programs
ii  python                        2.3.5-3    An interactive high-level object-o
ii  python-apt                    0.6.13.1   Python interface to libapt-pkg

mini-dinstall recommends no packages.

-- no debconf information
--- mini-dinstall.agx   2005-08-24 13:49:06.000000000 +0200
+++ mini-dinstall       2005-08-24 14:13:35.000000000 +0200
@@ -19,7 +19,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 import os, sys, re, glob, getopt, time, traceback, gzip, getpass, socket
-import signal, threading, select, Queue, SocketServer
+import shutil, signal, threading, select, Queue, SocketServer
 import logging, logging.handlers
 #logging.basicConfig()
 import apt_pkg
@@ -1047,19 +1047,25 @@
             os.exit(1)
         os.close(outfd)
         stdout = os.fdopen(infd)
-        packagesfile = open(os.path.join(dir, name), 'w')
-        zpackagesfile = gzip.GzipFile(os.path.join(dir, name + '.gz'), 'w')
+        packagesfilename = os.path.join(dir, name)
+        newpackagesfilename = packagesfilename + '.new'
+        zpackagesfilename = packagesfilename + '.gz'
+        newzpackagesfilename = newpackagesfilename + '.gz'
+        newpackagesfile = open(newpackagesfilename, 'w')
+        newzpackagesfile = gzip.GzipFile(newzpackagesfilename, 'w')
         buf = stdout.read(8192)
         while buf != '':
-            packagesfile.write(buf)
-            zpackagesfile.write(buf)
+            newpackagesfile.write(buf)
+            newzpackagesfile.write(buf)
             buf = stdout.read(8192)
         stdout.close()
         (pid, status) = os.waitpid(pid, 0)
         if not (status is None or (os.WIFEXITED(status) and 
os.WEXITSTATUS(status) == 0)):
             raise DinstallException("apt-ftparchive exited with status code 
%d" % (status,))
-        packagesfile.close()
-        zpackagesfile.close()
+        newpackagesfile.close()
+        newzpackagesfile.close()
+        shutil.move(newpackagesfilename, packagesfilename)
+        shutil.move(newzpackagesfilename, zpackagesfilename)
 
     def _make_packagesfile(self, dir):
         self._make_indexfile(dir, 'packages', 'Packages')

--- End Message ---
--- Begin Message ---
Source: mini-dinstall
Source-Version: 0.6.21-0.2

We believe that the bug you reported is fixed in the latest version of
mini-dinstall, which is due to be installed in the Debian FTP archive:

mini-dinstall_0.6.21-0.2.dsc
  to pool/main/m/mini-dinstall/mini-dinstall_0.6.21-0.2.dsc
mini-dinstall_0.6.21-0.2.tar.gz
  to pool/main/m/mini-dinstall/mini-dinstall_0.6.21-0.2.tar.gz
mini-dinstall_0.6.21-0.2_all.deb
  to pool/main/m/mini-dinstall/mini-dinstall_0.6.21-0.2_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guido Guenther <[EMAIL PROTECTED]> (supplier of updated mini-dinstall package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 23 Aug 2007 15:51:12 +0200
Source: mini-dinstall
Binary: mini-dinstall
Architecture: source all
Version: 0.6.21-0.2
Distribution: unstable
Urgency: low
Maintainer: Thomas Viehmann <[EMAIL PROTECTED]>
Changed-By: Guido Guenther <[EMAIL PROTECTED]>
Description: 
 mini-dinstall - daemon for updating Debian packages in a repository
Closes: 324855
Changes: 
 mini-dinstall (0.6.21-0.2) unstable; urgency=low
 .
   * NMU with maintainers approval
   * update packages files atomically (Closes: #324855)
Files: 
 b1f17401eb4b1895ee706f3125b1ae00 574 devel optional 
mini-dinstall_0.6.21-0.2.dsc
 32a4a1645bc941116ab7798fa0c9dcda 43141 devel optional 
mini-dinstall_0.6.21-0.2.tar.gz
 6d6b486940ece0925f10f4055396fb5e 40678 devel optional 
mini-dinstall_0.6.21-0.2_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGzaQVn88szT8+ZCYRAsRgAJ9xo9w/ZBtsCGB1OCnWeEBTfb24TgCfV46I
G2m0fS0Pgzb/jSvvergK5KA=
=2apK
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to