bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gnu tar w/ --listed-incremental --files-from


From: Miek Gieben
Subject: Re: gnu tar w/ --listed-incremental --files-from
Date: Fri, 24 Jan 2003 18:45:46 +0100
User-agent: Vim/Mutt/Linux

[On 22 Jan, @15:26, Stepan wrote in "Re: gnu tar w/ --listed-increm ..."]
> Hello,
>       thank you for your bug report.
> 
> On Wed, Jan 15, 2003 at 10:44:41AM +0100, Miek Gieben wrote:
> > simular to this: tar --files-from FILELIST --listed-incremental INCLIST.
> > 
> > Now if I list directories in FILELIST, incremental backups work, but if I
> > list specific files in FILELIST, they are always stored in the archive.
> > 
> > Is this a bug?
> 
> last time I saw the source code, I noticed that tar will probably behave
> this way.  But the source seemed quite confusing to me and I thought
> noone will actually encounter the bug.
> 
> You did.  :-)
> 
> OK, I'd say this _is_ a bug.
> 
> But I'm not brave enough to fix it.  I don't know whether the tar
> maintainer has enough energy to work on it.

i've found something. In incremem.c line 623 or there about. it says:

      if (S_ISDIR (statbuf.st_mode))
        {
          name->found = 1;
          add_hierarchy_to_namelist (name->name, statbuf.st_dev);
        }

the add_hierarchy_to_namelist() will then take care to only include new files in
the archive.

If I change all that into:

      if (S_ISDIR (statbuf.st_mode))
        {
          name->found = 1;
          printf("adding to hierarchy\n");
          add_hierarchy_to_namelist (name->name, statbuf.st_dev);
          continue;
        }
      if (S_ISREG (statbuf.st_mode))
        {
                if ( statbuf.st_mtime > newer_mtime_option ) {

                /* check to see if this should be added as well */
          name->found = 1;
          printf("Adding file to namelist\n");
          name_add(name->name);
                } else {
                        printf("Too old: %s\n",name->name);
                }
        }

I get the desired result. It will only include files newer than
newer_mtime_option. Only questions that remain: it that i had to use 
statbuf.st_mtime > newer_mtime_option, whereas all the other comparisons
are done with < newer_mtime_option?

And I only use this simple comparison, not taking into consideration the
newer_date_option and stuff.

Could somebody confirm that I'm on the right track here? That way I can prepare
a patch.

grtz Miek




reply via email to

[Prev in Thread] Current Thread [Next in Thread]