[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] Another shell re-write of backup-files.
From: |
Jean Delvare |
Subject: |
Re: [Quilt-dev] Another shell re-write of backup-files. |
Date: |
Fri, 18 Mar 2011 21:27:00 +0100 |
User-agent: |
KMail/1.12.4 (Linux/2.6.32.29-0.3-pae; KDE/4.3.5; i686; ; ) |
On Friday 18 March 2011 09:15:18 pm Kaz Kylheku wrote:
> On Fri, 18 Mar 2011 20:43:52 +0100, Jean Delvare <address@hidden>
>
> wrote:
> > On Friday 18 March 2011 06:32:18 pm Kaz Kylheku wrote:
> >> Plus a few more fixes. It's behaving well for me now. I'm ready
> >> for stress-testing with big patch stacks.
> >
> > May I ask why you keep investing time in a task which I just told
> > you I have _already_ accomplished?
>
> Simply because it's not good to leave something 93% done
> (compared to, say, 100% or 40%, which are both good exit points,
> or even 99%). :)
>
> This may also have to do with schooling. Just because
> your classmate has done the homework assignment doesn't
> mean you don't have to. :)
>
> Before I started, I looked in the mailing list
> and GIT, but I didn't find the new script, unfortunately.
> This is something I need right away.
I would have sent it already if I didn't spend time today answering your
e-mails and reviewing your code :p
> I just took an extra few minutes to put in the link-breaking
> ``noop''.
>
> Breaking hard links is done easily using an in-place sed (sed -i):
>
> find "$opt_prefix" -type f -links +1 | xargs sed -i -s ''
Except that it doesn't do what you want. What the script must do when
passed -L alone is to break links on _original_ files, not _backed up_
files.
I told you that the semantics of backup-files are not trivial.
>
> I'm happy with the way it works now, so I can leave it alone!
>
> Index: quilt-hack/backup-files
> ===================================================================
> --- quilt-hack.orig/backup-files
> +++ quilt-hack/backup-files
> @@ -16,9 +16,8 @@
> # pass-through mode).
> # - Use tree-to-tree recursive cp to restore a backup (taking
> everything
> # in the backup, ignoring the file list).
> -# - We don't use hard linking when restoring files, because then we
> have
> -# to break the hard links anyway (quilt issues a noop -L
> operation). -# - To touch restored files, we can do a copy without
> preserving timestamps.
> +# - To touch files after restoring, we can do a copy without
> preserving
> +# timestamps, rather than hard linking.
> # - Added files (i.e. backups of nonexistent files) are represented
> as a
> # specially named file containing an explicit list, and not as
> # zero-length files. This eases the implementation, and lets us
> back @@ -221,9 +220,9 @@ R )
> fi
>
> if [ $opt_touch ] ; then
> - cp -dR --preserve=mode,ownership "$opt_prefix"/. .
> + cp -Rf --preserve=mode,ownership "$opt_prefix"/. .
> else
> - cp -a "$opt_prefix"/. .
> + cp -lRf "$opt_prefix"/. .
> fi
>
> find "$opt_prefix" -type f -size 0c \
> @@ -237,8 +236,15 @@ R )
> D )
> rm -rf "$opt_prefix"
> ;;
> -'' )
> - # noop
> +'' ) # noop
> + if [ $opt_nolink ] ; then
> + if [ -z $all_backup_files ] ; then
> + echo "Error: breaking individual links is not supported"
> + exit 1
> + fi
> +
> + find "$opt_prefix" . -type f -links +1 | xargs sed -i -s ''
I doubt you really wanted to run this on both "$opt_prefix" and .
Both are wrong anyway...
> + fi
> ;;
> * )
> # multiple operations were specified together, like -b and -r.
>
--
Jean Delvare
Suse L3
- [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/17
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Jean Delvare, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Jean Delvare, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files.,
Jean Delvare <=
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Jean Delvare, 2011/03/19
- Re: [Quilt-dev] Another shell re-write of backup-files., Jean Delvare, 2011/03/19
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/19
- Re: [Quilt-dev] Another shell re-write of backup-files., Jean Delvare, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/18
- Re: [Quilt-dev] Another shell re-write of backup-files., Jean Delvare, 2011/03/19
- Re: [Quilt-dev] Another shell re-write of backup-files., Kaz Kylheku, 2011/03/20
- Re: [Quilt-dev] Another shell re-write of backup-files., Jean Delvare, 2011/03/21