Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 180334

Summary: sys-apps/findutils-4.3.6 (~x86) has upstream bug with -mtime
Product: Gentoo Linux Reporter: RB <aoz.syn>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: dan.dickey, it-knodel
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://savannah.gnu.org/bugs/?20005
Whiteboard:
Package list:
Runtime testing required: ---

Description RB 2007-05-30 11:54:26 UTC
'find -mtime +n' behaves like 'find -mtime n'

This bug bit my archival cron jobs; nothing serious, but since people expect consistent behavior out of find, it may be worth masking.  I know there was a bug submitted to get it in, but...
Comment 1 Dan A. Dickey 2007-05-30 16:09:38 UTC
-mtime -n also has this problem.
Comment 2 Oliver Knodel 2007-05-31 10:07:16 UTC
i am having the same problem, find -mtime -m does not work like expected.
I don't know if it does matter, but i am using reiserfs3.
Comment 3 RB 2007-05-31 12:24:10 UTC
Oliver -

It doesn't matter what filesystem you're using, the author of the utility has acknowledged a bug with handling -mtime in version 4.3.6.  Your best bet for the moment is to backlevel to a prior stable version, either by adding "=sys-apps/findutils-4.3.6" to /etc/portage/package.mask or "sys-apps/findutils -~x86" (or your architecture-specific ~keyword) to /etc/portage/package.keywords.  Unless the base-system team beats you to it and either hard-masks it or takes it out of portage.
Comment 4 SpanKY gentoo-dev 2007-06-01 14:32:07 UTC
someone who is experiencing the problem try this patch and let me know if it works:
http://savannah.gnu.org/support/download.php?file_id=12909
Comment 5 RB 2007-06-01 17:59:26 UTC
[root@tst ~] cd /tmp/findutils-4.3.6/
[root@tst findutils-4.3.6] ./find/find /var/log/everything -mtime 1
/var/log/everything/20070530
[root@tst findutils-4.3.6] ./find/find /var/log/everything -mtime +1
/var/log/everything/20070524.gz
/var/log/everything/20070525.gz
/var/log/everything/20070526.gz
/var/log/everything/20070527.gz
/var/log/everything/20070528.gz
/var/log/everything/20070522.gz
/var/log/everything/20070523.gz
/var/log/everything/20070529.gz
[root@tst findutils-4.3.6] ./find/find /var/log/everything -mtime -1
/var/log/everything
/var/log/everything/20070601
/var/log/everything/20070531
/var/log/everything/20070530
[root@tst findutils-4.3.6] ll -art /var/log/everything
total 316
-rw-------  1 root root   1780 May 22 23:50 20070522.gz
-rw-------  1 root root  15947 May 23 23:57 20070523.gz
-rw-------  1 root root   3467 May 24 23:57 20070524.gz
-rw-------  1 root root   3169 May 25 23:50 20070525.gz
-rw-------  1 root root   3163 May 26 23:50 20070526.gz
-rw-------  1 root root   3385 May 27 23:50 20070527.gz
-rw-------  1 root root   4639 May 28 23:50 20070528.gz
-rw-------  1 root root  16571 May 29 23:55 20070529.gz
-rw-------  1 root root 118456 May 30 23:55 20070530
-rw-------  1 root root  79472 May 31 23:55 20070531
drwx------  2 root root   4096 Jun  1 00:03 ./
drwxr-xr-x 10 root root   4096 Jun  1 03:10 ../
-rw-------  1 root root  39404 Jun  1 12:53 20070601
[root@tst findutils-4.3.6]


Looks good to me - one hunk failed, though:

[root@tst findutils-4.3.6] cat find/parser.c.rej
***************
*** 928,934 ****
  safe_atoi (const char *s)
  {
    long lval;
-   const char *end;

    errno = 0;
    lval = strtol(s, &end, 10);
--- 928,934 ----
  safe_atoi (const char *s)
  {
    long lval;
+   char *end;

    errno = 0;
    lval = strtol(s, &end, 10);
[root@tst findutils-4.3.6]
Comment 6 SpanKY gentoo-dev 2007-06-02 13:32:51 UTC
added to 4.3.6-r1 then, cheers