Debian Bug report logs - #626072
findutils: find -regex ... -execdir mv ... inconsistent behavior

version graph

Package: findutils; Maintainer for findutils is Andreas Metzler <ametzler@debian.org>; Source for findutils is src:findutils (PTS, buildd, popcon).

Reported by: Alexandre Hoïde <alexandre.hoide@gmail.com>

Date: Sun, 8 May 2011 15:15:01 UTC

Severity: important

Tags: sid

Found in version findutils/4.4.2-1

Done: Andreas Metzler <ametzler@downhill.at.eu.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#626072; Package findutils. (Sun, 08 May 2011 15:15:04 GMT) (full text, mbox, link).


Acknowledgement sent to Alexandre Hoïde <alexandre.hoide@gmail.com>:
New Bug report received and forwarded. Copy sent to Andreas Metzler <ametzler@debian.org>. (Sun, 08 May 2011 15:15:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Alexandre Hoïde <alexandre.hoide@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: findutils: find -regex ... -execdir mv ... inconsistent behavior
Date: Sun, 08 May 2011 17:10:10 +0200
Package: findutils
Version: 4.4.2-1+b1
Severity: important
Tags: sid

Hello, i have the following problem with find:
________________________________________________________________________
$ tree -F --noreport
..
├── test/
└── TEST01
$ find . -regex ".*TEST01" -execdir mv '{}' test \;
$ tree -F --noreport
..
└── test/
    └── test
________________________________________________________________________

The expected result would be:
└── test/
    └── TEST01

I am not 100% sure this qualify as a bug, nevertheless:
I get the expected result in Squeeze and Slackware 13.37. And following
a discussion on debian-user-french list, at least one person has
confirmed the problem and another gets the expected result, both using
Sid with bash-4.1-3 (debian package). The persone getting the expected
result has the same findutils version as mine, while the person
confirming the problem has findutils 4.5.8-1.

We have not been abble to determine what difference in our systems could
cause the difference in "find" behavior, for the exact same command.

Some things I have tried which does not solve the problem:
1) $ LANG=en find . -regex...
2) run the same command under ZSH.
3) run the same command under a new and clean user account

Workarounds:
$ find . -regex ".*TEST01" -execdir mv -t test '{}' \;
$ find . -maxdepth 1 -regex ".*TEST01" -execdir mv '{}' test \;

Best regards,
Alexandre

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.38-2-686 (SMP w/2 CPU cores)
Locale: LANG=fr_CH.UTF-8, LC_CTYPE=fr_CH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages findutils depends on:
ii  dpkg                      1.16.0.3       Debian package management system
ii  install-info              4.13a.dfsg.1-6 Manage installed documentation in 
ii  libc6                     2.13-2         Embedded GNU C Library: Shared lib

findutils recommends no packages.

Versions of packages findutils suggests:
ii  mlocate                       0.23.1-1   quickly find files on the filesyst

-- no debconf information




Reply sent to Andreas Metzler <ametzler@downhill.at.eu.org>:
You have taken responsibility. (Sun, 08 May 2011 17:12:06 GMT) (full text, mbox, link).


Notification sent to Alexandre Hoïde <alexandre.hoide@gmail.com>:
Bug acknowledged by developer. (Sun, 08 May 2011 17:12:06 GMT) (full text, mbox, link).


Message #10 received at 626072-done@bugs.debian.org (full text, mbox, reply):

From: Andreas Metzler <ametzler@downhill.at.eu.org>
To: 626072-done@bugs.debian.org
Subject: Re: Bug#626072: findutils: find -regex ... -execdir mv ... inconsistent behavior
Date: Sun, 8 May 2011 19:09:25 +0200
On 2011-05-08 Alexandre Hoïde <alexandre.hoide@gmail.com> wrote:
> Package: findutils
> Version: 4.4.2-1+b1
> Severity: important
> Tags: sid

> Hello, i have the following problem with find:
> ________________________________________________________________________
> $ tree -F --noreport
> ..
> ├── test/
> └── TEST01
> $ find . -regex ".*TEST01" -execdir mv '{}' test \;
> $ tree -F --noreport
> ..
> └── test/
>     └── test
> ________________________________________________________________________

> The expected result would be:
> └── test/
>     └── TEST01

> I am not 100% sure this qualify as a bug, nevertheless:
[...]

Hello,

What happens is this, which matches documented behavior.

1. mv ./TEST01 test
2. find continues its search. The (newly moved) TEST01 directory matches
the regex.
3. The execdir command is evalutated. find changes to the test directory
and runs mv ./TEST01 test.

Using -depth will get the expected behavior.

cu andreas




Information forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#626072; Package findutils. (Sun, 08 May 2011 19:42:03 GMT) (full text, mbox, link).


Acknowledgement sent to alexandre <ac007@bluewin.ch>:
Extra info received and forwarded to list. Copy sent to Andreas Metzler <ametzler@debian.org>. (Sun, 08 May 2011 19:42:03 GMT) (full text, mbox, link).


Message #15 received at 626072@bugs.debian.org (full text, mbox, reply):

From: alexandre <ac007@bluewin.ch>
To: 626072@bugs.debian.org
Subject: Re: Bug#626072 closed by Andreas Metzler <ametzler@downhill.at.eu.org> (Re: Bug#626072: findutils: find -regex ... -execdir mv ... inconsistent behavior)
Date: Sun, 8 May 2011 21:32:03 +0200
On Sun, May 08, 2011 at 05:12:06PM +0000, Debian Bug Tracking System wrote:
> #626072: findutils: find -regex ... -execdir mv ... inconsistent behavior
> 
> It has been closed by Andreas Metzler <ametzler@downhill.at.eu.org>.
> 
> Their explanation is attached below along with your original report.
> If this explanation is unsatisfactory and you have not received a
> better one in a separate message then please contact Andreas Metzler <ametzler@downhill.at.eu.org> by
> replying to this email.
> 
> -- 
> 626072: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626072
> Debian Bug Tracking System
> Contact owner@bugs.debian.org with problems

> Date: Sun, 8 May 2011 19:09:25 +0200
> From: Andreas Metzler <ametzler@downhill.at.eu.org>
> To: 626072-done@bugs.debian.org
> Subject: Re: Bug#626072: findutils: find -regex ... -execdir mv ...
>  inconsistent behavior
> User-Agent: Mutt/1.5.20 (2009-06-14)
> 
> On 2011-05-08 Alexandre Hoïde <alexandre.hoide@gmail.com> wrote:
> > Package: findutils
> > Version: 4.4.2-1+b1
> > Severity: important
> > Tags: sid
> 
> > Hello, i have the following problem with find:
> > ________________________________________________________________________
> > $ tree -F --noreport
> > ..
> > ├── test/
> > └── TEST01
> > $ find . -regex ".*TEST01" -execdir mv '{}' test \;
> > $ tree -F --noreport
> > ..
> > └── test/
> >     └── test
> > ________________________________________________________________________
> 
> > The expected result would be:
> > └── test/
> >     └── TEST01
> 
> > I am not 100% sure this qualify as a bug, nevertheless:
> [...]
> 
> Hello,
> 
> What happens is this, which matches documented behavior.
> 
> 1. mv ./TEST01 test
> 2. find continues its search. The (newly moved) TEST01 directory matches
> the regex.
> 3. The execdir command is evalutated. find changes to the test directory
> and runs mv ./TEST01 test.
> 
> Using -depth will get the expected behavior.
> 
> cu andreas
> 

Hello Andreas and thank you for your clear answer, which makes sense...
I should have RTFM better :) (Although  i get the same result with and
without -depth)

That still leaves a question opened then: why do some people with the
same setup as mine and why Squeeze -- which happens to provide the same
findutils version -- produce a different result ? Should I open a bug
for the Squeeze version ? This inconstistency between versions or
installations is confusing.

Anyway, my apologies for this "false positive" bug :)

Best regards,
Alexandre




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 06 Jun 2011 07:37:06 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Dec 23 16:21:01 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.