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: Sun, 20 Mar 2011 11:43:45 -0700
User-agent: Roundcube Webmail/0.4

On Sat, 19 Mar 2011 13:55:05 +0100, Jean Delvare <address@hidden>
wrote:
> And the fact that the linked 
> copies have their timestamp updated as I work is not a problem at all in 
> practice.

Hi Jan,

But if a widely-included header file is touched in every
hard-linked tree, you could be looking at long incremental rebuilds.

The reason it works this way is obviously for speed.
Quilt restores files using "backup-files -r -t".
Files are restored by hard linking followed by
a touch. (In my script I chose to implement -r -t
as an inefficient copy; a decision I will revert
for the sake of compatibility and speed.)

Link + touch means that a "quilt pop -a" never has
to copy any files (except maybe in some corner cases),
making it very fast.

I do not believe that it's due to any intent
to preserve links. That is a naive interpretation
of what the program does, because such a requirement
would be totally nonsensical. Rather, it's all about
speed.

"quilt pop" performs a just-in-case link breaking
pass in the case when not all the patches are popped.
This evidently covers some corner cases when it is
suspected that there may be a link between the backup
directory at the current patch level, and some
of the working files. When all patches are popped,
there is no backup directory, so this suspicion doesn't
exist.

Note that this just-in-case breaking is done
in the backup directory, not in the tree:

  # code from pop
  patch="$(top_patch)"
  if [ -z "$patch" ]
  then
    printf $"No patches applied\n"
  else
    # Ensure that the files in the topmost patch have a link count
    # of one: This will automatically be the case in the usual
    # situations, but we don't want to risk file corruption in weird
    # corner cases such as files added to a patch but not modified.
    $QUILT_LIB/backup-files -L -s -B $QUILT_PC/$patch/ -
    printf $"Now at patch %s\n" "$(print_patch $patch)"
  fi

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."




reply via email to

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