Your message dated Wed, 19 Jan 2005 00:02:14 -0500
with message-id <[EMAIL PROTECTED]>
and subject line Bug#287465: fixed in debmirror 20050118
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)

--------------------------------------
Received: (at submit) by bugs.debian.org; 27 Dec 2004 21:22:23 +0000
>From [EMAIL PROTECTED] Mon Dec 27 13:22:23 2004
Return-path: <[EMAIL PROTECTED]>
Received: from dag.ddkom.net [212.80.224.51] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1Cj2Jq-000803-00; Mon, 27 Dec 2004 13:22:23 -0800
Received: from 205.255.ddkom.net ([212.80.255.205] helo=daniel.localdomain)
        by dag.ddkom.net with esmtps (TLS-1.0:RSA_ARCFOUR_SHA:16)
        (Exim 4.43)
        id 1Cj2Jo-0001lQ-Dy; Mon, 27 Dec 2004 22:22:21 +0100
Received: from pada by daniel.localdomain with local (Exim 4.34)
        id 1Cj2Jn-0003ki-2m; Mon, 27 Dec 2004 22:22:19 +0100
Date: Mon, 27 Dec 2004 22:22:18 +0100
From: Daniel Parthey <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: debmirror: post cleanup does not work, chdir() missing
Message-ID: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw"
Content-Disposition: inline
X-Reportbug-Version: 3.2
User-Agent: Mutt/1.5.6+20040907i
Sender: Daniel Parthey <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 


--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: debmirror
Version: 20041209
Severity: normal
Tags: patch

debmirror --postcleanup does not work,
old *.deb files which disappeared from the Packages file
are not being deleted.

The reason is that debmirror changes to the .temp directory
and looks for obsolete files there. Instead it should enter
the mirrordir before executing the find command for cleanup.

The same bug causes the cleanup of empty directories to fail.

While fixing this bug I took the liberty to put some duplicate
cleanup code into the subroutine cleanup_unknown_files().

Attached are two patches which need to be applied in sequence:

001_debmirror_add-cleanup-subroutine
  simplifies the duplicate code

002_debmirror_cleanup-chdir-bugfix
  This is the actual bugfix for both the *.deb and empty directory cleanup.
  The subroutine cleanup_unknown_files() saves the current working directory,
  changes into the mirrordir, does the cleanup and returns to the previously
  saved directory.
  Before directory cleanup the patch changes again to the mirrordir.

Daniel.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (i586)
Kernel: Linux 2.4.27-1-k6
Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1)

Versions of packages debmirror depends on:
ii  bzip2                         1.0.2-1    A high-quality block-sorting file 
ii  libcompress-zlib-perl         1.33-3     Perl module for creation and manip
ii  liblockfile-simple-perl       0.2.5-4    Simple advisory file locking
ii  libnet-perl                   1:1.19-1   Implementation of Internet protoco
ii  libwww-perl                   5.800-2    WWW client/server library for Perl
ii  perl [libdigest-md5-perl]     5.8.4-3    Larry Wall's Practical Extraction 
ii  perl-modules [libnet-perl]    5.8.4-3    Core Perl modules
ii  rsync                         2.6.3-2    fast remote file copy program (lik

-- no debconf information

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=001_debmirror_add-cleanup-subroutine

--- debmirror.orig      2004-12-16 17:45:31.000000000 +0100
+++ debmirror.code-cleaned      2004-12-27 19:09:39.000000000 +0100
@@ -693,22 +693,8 @@
   }
 }
 
-if ($cleanup && ! $post_cleanup) {
-  say("Cleanup mirror.");
-  my $ignore;
-  $ignore = "(".join("|", @ignores).")" if @ignores;
-  # Remove all files in the mirror that we don't know about
-  foreach my $file (`find . -type f`) {
-    chomp $file;
-    $file=~s:^\./::;
-    unless (exists $files{$file} or (defined($ignore) && $file=~/$ignore/o)) {
-      say("deleting $file") if ($verbose);
-      if (! $dry_run) {
-       unlink $file or die "unlink $file: $!";
-      }
-    }
-  }
-}
+# Pre mirror cleanup
+cleanup_unknown_files() if ($cleanup && ! $post_cleanup);
 
 say("Download all files that we need to get 
(".int(1+$bytes_to_get/1024/1024)." MiB).");
 # Download all files that we need to get.
@@ -903,22 +889,7 @@
     die("Failed to move some meta files.");
   }
   # Post mirror cleanup
-  if ($post_cleanup) {
-    say("Cleanup mirror.");
-    my $ignore;
-    $ignore = "(".join("|", @ignores).")" if @ignores;
-    # Remove all files in the mirror that we don't know about
-    foreach my $file (`find . -type f`) {
-      chomp $file;
-      $file=~s:^\./::;
-      unless (exists $files{$file} or (defined($ignore) && $file=~/$ignore/o)) 
{
-       say("deleting $file") if ($verbose);
-       if (! $dry_run) {
-         unlink $file or die "unlink $file: $!";
-       }
-      }
-    }
-  }
+  cleanup_unknown_files() if ($post_cleanup);
 }
 
 # mirror cleanup for directories
@@ -1316,6 +1287,26 @@
   }
 }
 
+# Mirror cleanup for unknown files that cannot be found in Packages files.
+# This subroutine is called on pre- and post-cleanup and takes no arguments.
+# It uses some global variables like $files, $mirrordir, @ignores
+sub cleanup_unknown_files {
+  say("Cleanup mirror.");
+  my $ignore;
+  $ignore = "(".join("|", @ignores).")" if @ignores;
+  # Remove all files in the mirror that we don't know about
+  foreach my $file (`find . -type f`) {
+    chomp $file;
+    $file=~s:^\./::;
+    unless (exists $files{$file} or (defined($ignore) && $file=~/$ignore/o)) {
+      say("deleting $file") if ($verbose);
+      if (! $dry_run) {
+       unlink $file or die "unlink $file: $!";
+      }
+    }
+  }
+}
+
 sub say {
   print join(' ', @_)."\n" if ($verbose or $progress);
 }

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=002_debmirror_cleanup-chdir-bugfix

--- debmirror.code-cleaned      2004-12-27 19:09:39.000000000 +0100
+++ debmirror   2004-12-27 19:27:26.000000000 +0100
@@ -898,6 +898,7 @@
   # to prevent race problems with pool download code, which
   # makes directories.. Sort so they are removable in bottom-up
   # order.
+  chdir($mirrordir) or die "unable to chdir($mirrordir): $!\n";
   system("find . -type d -depth ! -name . ! -name .. -print0 | xargs -0 rmdir 
2>/dev/null") if (! $dry_run);
 }
 
@@ -1292,9 +1293,11 @@
 # It uses some global variables like $files, $mirrordir, @ignores
 sub cleanup_unknown_files {
   say("Cleanup mirror.");
+  my $cwd = cwd();
   my $ignore;
   $ignore = "(".join("|", @ignores).")" if @ignores;
   # Remove all files in the mirror that we don't know about
+  chdir($mirrordir) or die "unable to chdir($mirrordir): $!\n";
   foreach my $file (`find . -type f`) {
     chomp $file;
     $file=~s:^\./::;
@@ -1305,6 +1308,8 @@
       }
     }
   }
+  # return to the previous working directory
+  chdir($cwd) or die "unable to chdir($cwd): $!\n";
 }
 
 sub say {

--GvXjxJ+pjyke8COw--

---------------------------------------
Received: (at 287465-close) by bugs.debian.org; 19 Jan 2005 05:07:02 +0000
>From [EMAIL PROTECTED] Tue Jan 18 21:07:02 2005
Return-path: <[EMAIL PROTECTED]>
Received: from newraff.debian.org [208.185.25.31] (mail)
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1Cr83a-0002zP-00; Tue, 18 Jan 2005 21:07:02 -0800
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
        id 1Cr7yw-00039s-00; Wed, 19 Jan 2005 00:02:14 -0500
From: Goswin von Brederlow <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
X-Katie: $Revision: 1.55 $
Subject: Bug#287465: fixed in debmirror 20050118
Message-Id: <[EMAIL PROTECTED]>
Sender: Archive Administrator <[EMAIL PROTECTED]>
Date: Wed, 19 Jan 2005 00:02:14 -0500
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-2.3 required=4.0 tests=BAYES_00,DATING,
        HAS_BUG_NUMBER,SUBJ_HAS_UNIQ_ID autolearn=no 
        version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 
X-CrossAssassin-Score: 2

Source: debmirror
Source-Version: 20050118

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

debmirror_20050118.dsc
  to pool/main/d/debmirror/debmirror_20050118.dsc
debmirror_20050118.tar.gz
  to pool/main/d/debmirror/debmirror_20050118.tar.gz
debmirror_20050118_all.deb
  to pool/main/d/debmirror/debmirror_20050118_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.
Goswin von Brederlow <[EMAIL PROTECTED]> (supplier of updated debmirror 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: Tue, 18 Jan 2005 02:59:34 +0200
Source: debmirror
Binary: debmirror
Architecture: source all
Version: 20050118
Distribution: unstable
Urgency: low
Maintainer: Goswin von Brederlow <[EMAIL PROTECTED]>
Changed-By: Goswin von Brederlow <[EMAIL PROTECTED]>
Description: 
 debmirror  - Debian partial mirror script, with ftp and package pool support
Closes: 286575 287465 287732 288814 288973 289286 289752
Changes: 
 debmirror (20050118) unstable; urgency=low
 .
   * Add --no-tty option to gpg (Closes: #289286)
     reported by Holger Ruckdeschel <[EMAIL PROTECTED]>
   * Move cleanup code into function and add missing chdir (Closes: #287465)
     adapted patch by Daniel Parthey <[EMAIL PROTECTED]>
   * Unlink hardlinks before system calls with redirected IO (Closes: #288814)
     adapted patch by Mirko Parthey <[EMAIL PROTECTED]>
   * Unlink metafiles later (Closes: #289752)
     patch by Ingo Saitz <[EMAIL PROTECTED]>
   * Typo fixes as found by Martin Kourim <[EMAIL PROTECTED]>
     (Closes: #287732)
   * Add --ignore-small-errors to allow updating inconsistent upstream
     mirrors (Closes: #288973)
   * Hide gpg signature check output if !verbose (Closes: #286575)
Files: 
 721036b68f9c9e221d43edc0632980e6 494 net extra debmirror_20050118.dsc
 c609fb5d618a180157b88bbbbc71b1d1 16085 net extra debmirror_20050118.tar.gz
 6959c3a591021792521759b1644b755c 23356 net extra debmirror_20050118_all.deb

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

iD8DBQFB7eZf78o9R9NraMQRAg97AJ9eYpxRe/ztR/15ghRVwbZ8txY/eQCfSWNr
geBs2nxyMprsNXMFf3/XerM=
=iySD
-----END PGP SIGNATURE-----


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

Reply via email to