quilt-dev
[Top][All Lists]
Advanced

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

Re: [Quilt-dev] Another shell re-write of backup-files.


From: Kaz Kylheku
Subject: Re: [Quilt-dev] Another shell re-write of backup-files.
Date: Mon, 21 Mar 2011 15:07:11 -0700
User-agent: Roundcube Webmail/0.4

On Mon, 21 Mar 2011 13:40:37 +0100, Jean Delvare <address@hidden>
wrote:
> Hi Kaz,

>> The command
>>
>>   backup-files -L -s -B $QUILT_PC/$patch/ -
>>
>> means "walk the backup directory $QUILT_PC/$patch,
>> and replace any file that has a link count > 1
>> with a clone of that file."
> 
> No, sorry, it doesn't mean that. See for yourself (with the original C 
> implementation of backup-files, which is the reference):

Ah wow, it does ensure that even when walking the backup
tree to determine which files to operate on, the semantics
of "backup" and "file" is still consistent within
the process_file function!

So it is actually orthogonal in this regard also
(more trivial than I thought).

> As you can see, backup-files -L broke the link of the original file, and 
> left the backup file untouched.

I see, and from this you are inferring that there is
some requirement which makes it important to preserve
the original inode in the backup, so that the ultimate
restore will put everything back.

Superficially it does look as if the program is
obsessive in insisting that this be done on the
original tree, suggesting that there may be some
deeper reason.

But in fact, this aspect of the behavior is
just an "onion in the varnish" type of thing,
which is revealed when we look at the history.

Firstly, if you do link-breaking restore (-r -L), this
is exactly the same as just copying the file"

        if (link_or_copy(backup, &st, file))
                return 1;

        if (opt_nolinks) {
                if (ensure_nolinks(file))
                        return 1;
        }

Now if you go back in the history of quilt, you will
find that quilt pop originally did this type of
restore at every level. I.e. quilt restored files by
a copy.

That changed in the following commit, which also
added the "noop" as well as the - argument feature
to make backup-files walk the backup directory:

http://git.savannah.gnu.org/cgit/quilt.git/commit/?id=eb1a6de33c1b631e4636ff26dde2945a0db8db74

The newly added noop case breaks the links on the
original tree side most likely for the sake of consistency with
backup and restore. The other two existing
ensure_nolinks calls take an argument of "file" not backup,
so this is just cut and paste.

Prior to this commit, quilt did not restore hard links.
All restored files were new objects with a link count of 1
and a fresh time stamp.

This commit failed to preserve that behavior, so it can
be regarded as buggy.




reply via email to

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