On Thu, May 19, 2011 9:28:48 PM, Dominic Hargreaves wrote:


> The best fix is likely to be one which invalidates the cache
> if this situation is encountered

   Until the problem is fixed, users can remedy the situation by issuing,
as root, the command:
    # apt-show-versions -i
It could be that they should also 
    # rm -rf /var/cache/apt-show-versions
before that.  When properly working, that directory contains 3 files:
    $ ls -R /var/cache/apt-show-versions/
    /var/cache/apt-show-versions/:
    apackages  files  ipackages


> I would also recommend switching to nstore which will prevent this 
> happening again.

  A simple substitution of store with nstore in the program text seem to work.
I have found only 4 occurrences: 

--- apt-show-versions-0.17/apt-show-versions    2011-02-18 15:29:51.000000000 
+0200
+++ apt-show-versions-0.17+local/apt-show-versions      2011-05-20 
03:31:19.000000000 +0300
@@ -31,7 +31,7 @@

 use strict;
 use Getopt::Long;
-use Storable qw(store retrieve);
+use Storable qw(nstore retrieve);

 my $apackagescachefile="/var/cache/apt-show-versions/apackages";
 my $ipackagescachefile="/var/cache/apt-show-versions/ipackages";
@@ -189,7 +189,7 @@
 if (!-e $filescachefile or -M $list_dir < -M $filescachefile or 
!ref($filesref)) {
     opendir(DIR, $list_dir) or &die("Can't opendir $list_dir: $!\n");
     @files = map { $list_dir . $_} grep /Packages$/, readdir(DIR);
-    ($< == 0) and (store(\@files, $filescachefile) or
+    ($< == 0) and (nstore(\@files, $filescachefile) or
         warn "Can't write $filescachefile\n");

     closedir DIR ;
@@ -212,7 +212,7 @@
 }
 if (!-e $ipackagescachefile or -M $status_file < -M $ipackagescachefile or 
!ref($ipackages)) {
     ($ipackages, undef) = parse_file ($status_file, 1);
-    ($< == 0) and (store($ipackages, $ipackagescachefile) or
+    ($< == 0) and (nstore($ipackages, $ipackagescachefile) or
         warn "Can't write $ipackagescachefile\n");
 }

@@ -260,7 +260,7 @@
     }
 }
 # Store if we are root
-($< == 0) and (store($apackages, $apackagescachefile) or
+($< == 0) and (nstore($apackages, $apackagescachefile) or
                &die("Warning: Can't write to $apackagescachefile!\n"));
 # Exit if we are root and using the -i option
 ($< == 0) and (exists $opts{'initialize'}) and exit;



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to