[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: My Wishlist

On Sat, Nov 09, 2002 at 06:46:50PM +0100, Josip Rodin wrote:
> On Sat, Nov 09, 2002 at 01:13:43PM +0000, Colin Watson wrote:
> > Oh, one other thing: should we release debbugs 2.4 (to experimental, I
> > guess) before going too much further with this? This seems like a good
> > point to tag.
> > 
> > (I'll do the legwork if nobody else has time or inclination.)
> The package will be broken, because db-h support has been committed, so
> anyone upgrading to it will find their BTS entirely broken... but if you
> want to handle such an upgrade, sure :)

Well, we could provide a script that looks something like this:

  #! /usr/bin/perl -w
  use strict;
  use File::Copy;

  my ($db, $dbh) = @ARGV[0, 1];
  opendir DB, $db or die "Can't opendir $db";
  mkdir $dbh or die "Can't mkdir $dbh";
  for my $i (0..99) {
    mkdir sprintf('%s/%02d', $dbh, $i) or die "Can't mkdir $dbh/$i";
  while (my $file = readdir DB) {
    next if $file =~ /^\.\.?$/;
    my $oldfile = "$db/$file";
    my $newfile;
    if ($file =~ /(\d+)(\d\d)\.(.*)/) {
      $newfile = "$dbh/$2/$1$2.$3";
    } else {
      warn "Not hashing $file.\n";
      $newfile = "$dbh/$file";
    copy $oldfile, $newfile or warn "Can't copy $oldfile to $newfile";
  closedir DB;

(untested, typos excepted, etc.) and tell people in the preinst that
they're going to need to run this on upgrade. Good enough?

Colin Watson                                  [cjwatson@flatline.org.uk]

Reply to: