Your message dated Tue, 28 May 2013 10:33:53 +0000
with message-id <[email protected]>
and subject line Bug#705241: fixed in wajig 2.8
has caused the Debian Bug report #705241,
regarding wajig: 'wajig update' collects new packages data in a very 
inefficient way
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 this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
705241: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705241
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: wajig
Version: 2.7.3
Severity: important
Tags: patch

Hi,

The wajig update command (after apt-get update is finished) calls 'join
-v 1 | wc -l' command to get the number of newly available packages.
Just after that it uses very inefficient python code to actually save 
the list of new packages into .wajig/*/New file. 

On my system the first part, i.e. `join | wc pipe', takes less then
second, but the second part, namely double for loop in python, takes
a minute or more.

I'm attaching a patch that fixes the issue.

Regards,
Robert

-- System Information:
Debian Release: 7.0
  APT prefers unstable
  APT policy: (990, 'unstable'), (200, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.5-trunk-686-pae (SMP w/1 CPU core)
Locale: LANG=pl_PL, LC_CTYPE=pl_PL (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/dash

Versions of packages wajig depends on:
ii  apt          0.9.7.8
ii  aptitude     0.6.8.2-1
ii  dpkg         1.16.10
ii  python3      3.2.3-6
ii  python3-apt  0.8.8.2

wajig recommends no packages.

Versions of packages wajig suggests:
ii  alien              8.88
ii  apt-file           2.5.1
pn  apt-move           <none>
ii  apt-show-versions  0.20
ii  dctrl-tools        2.22.2
ii  debconf            1.5.49
ii  deborphan          1.7.28.8
ii  debsums            2.0.52
ii  dpkg-dev           1.16.10
ii  dpkg-repack        1.37
ii  fakeroot           1.18.4-2
ii  locales            2.17-0experimental2
ii  netselect-apt      0.3.ds1-25
ii  reportbug          6.4.4
ii  sudo               1.8.5p2-1+nmu1
ii  vrms               1.16

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/share/wajig/util.py (from wajig package)
--- util.py.old	2013-04-11 21:14:09.911740385 +0200
+++ util.py	2013-04-11 21:15:59.367737810 +0200
@@ -123,12 +123,18 @@
     previous_packages = open(previous_file).readlines()
     diff = len(available_packages) - len(previous_packages)
 
+    temporary_file = tempfile.mkstemp()[1]
     # 090425 Use langC=True to work with change from coreutils 6.10 to 7.2
-    command = "join -v 1 -t' '  {0} {1} | wc -l"
-    command = command.format(available_file, previous_file)
+    command = "join -v 1 -t' '  {0} {1} | cut -d' ' -f 1 | tee {2} | wc -l"
+    command = command.format(available_file, previous_file, temporary_file)
     newest = perform.execute(command, pipe=True, langC=True)
     newest = newest.readlines()[0].strip()
 
+    if newest != "0":
+      os.rename(temporary_file, new_file)
+    else:
+      os.remove(temporary_file)
+
     if not noreport:
         if diff < 0:
             direction = str(0 - diff) + " down on"
@@ -143,17 +149,6 @@
         else:
             print("packages.")
 
-    packages = [package.split()[0] for package in available_packages]
-    old_packages = [package.split()[0] for package in previous_packages]
-    new_packages = list()
-    for package in packages:
-        if package not in old_packages:
-            new_packages.append(package)
-    if new_packages:
-        with open(new_file, 'w') as f:
-            [f.write(package + '\n') for package in new_packages]
-
-
 def gen_installed_command_str():
     """Generate command to list installed packages and their status."""
     # Use sort --unique. See comment in update_available().

--- End Message ---
--- Begin Message ---
Source: wajig
Source-Version: 2.8

We believe that the bug you reported is fixed in the latest version of
wajig, which is due to be installed in the Debian FTP archive.

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.
Tshepang Lekhonkhobe <[email protected]> (supplier of updated wajig 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.8
Date: Tue, 28 May 2013 08:35:08 +0200
Source: wajig
Binary: wajig
Architecture: source all
Version: 2.8
Distribution: unstable
Urgency: low
Maintainer: Graham Williams <[email protected]>
Changed-By: Tshepang Lekhonkhobe <[email protected]>
Description: 
 wajig      - unified package management front-end for Debian
Closes: 705241
Changes: 
 wajig (2.8) unstable; urgency=low
 .
   * UPDATE: fix performance issue (patch by Robert Luberda); Closes: #705241
 .
   * improve package description:
     - simpler
     - less boastful
     - add a pointer to a guide
     - tis 'wajig', not 'Wajig'
 .
   * SEARCH:
     - make -v|--verbose match short package descriptions in addition to
       package names
     - add -vv, which also searches long package descriptions and displays them;
       the former was available as -v, and the latter is new;
       this functionality was suggested by Reuben Thomas
     - add debtags search; this happens if the string '::' is in the search term
 .
   * SEARCH, INSTALL: fix weird bugs where package '0ad' could not be searched
     for or installed; LP #1182264
 .
   * update TUTORIAL to reflect that allowing any case for commands has
     since been removed; LP #1033536
 .
   * PURGEORPHANS, REMOVEORPHANS:
     - remove --teach option
       + it would need to be too complex in order to be accurate since it
         runs 2 commands, the second one using output of the first
       + this also gets rid of an ugly (and broken) workaround
 .
   * PURGEORPHANS: remove --noauth option; it doesn't make sense here
 .
   * REMOVEORPHANS: add --yes option, for consistency with PURGEORPHANS
 .
   * replace internal function with a more thorough stdlib shutil.which()
     for checking if a particular executable exists;
     this bumps minimum Python dependency to 3.3
   * LISTLOG: add APTLOG as synonym, in place of an erroneously-added SYSLOG
Checksums-Sha1: 
 0d7e6f2a9253e9842bd69c8297cf496f84962829 917 wajig_2.8.dsc
 01a885bcaeb1eb1b7c1e7d2e0f28765a6b0fcff5 55095 wajig_2.8.tar.gz
 018727daa91af102330635009428fa3611a33a4a 56178 wajig_2.8_all.deb
Checksums-Sha256: 
 62b52d7eba6905126cf6a36965da874335133a80e56fd9c1d819d6e797f5344f 917 
wajig_2.8.dsc
 10cc426318d4f7a32959d1990775de8544816f97e2d13a920e1f0e97a1a464b7 55095 
wajig_2.8.tar.gz
 99173cc64921c88cf034c27fb880627048a351704e1c620f43abfb32d0a62b2d 56178 
wajig_2.8_all.deb
Files: 
 611f0c5ce70bb4ed610aa800bc5ffe0c 917 admin optional wajig_2.8.dsc
 2b129b2c6956de691614942254165851 55095 admin optional wajig_2.8.tar.gz
 8f62a7215f2048d919d4ebd51de1011a 56178 admin optional wajig_2.8_all.deb

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

iD8DBQFRpIXzCZSR95Gw07cRAiw8AJ4w6Czrt1M8CodmJ2kERSGXUJTF8ACfesA9
PUBcLnMCL0DD2D9Tyk+Lsqc=
=ozE0
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to