On 18 Feb 2001, at 11:14, Jarkko Hietaniemi wrote:
> On Sat, Feb 17, 2001 at 10:44:44PM -0500, [EMAIL PROTECTED] wrote:
> > PS I'm not sure of how you delete a file in a patch.
>
> In a patch, you don't. With makepatch you can.
Well, `man patch` has this to say to GNU patch:
-E or --remove-empty-files
Remove output files that are empty after the patches
have been applied. Normally this option is unneces
sary, since patch can examine the time stamps on the
header to determine whether a file should exist after
patching. However, if the input is not a context diff
or if patch is conforming to POSIX, patch does not
remove empty patched files unless this option is given.
When patch removes a file, it also attempts to remove
any empty ancestor directories.
...
You can create a file by sending out a diff that compares
/dev/null or an empty file dated the Epoch (1970-01-01
00:00:00 UTC) to the file you want to create. This only
works if the file you want to create doesn't exist already
in the target directory. Conversely, you can remove a
file by sending out a context diff that compares the file
to be deleted with an empty file dated the Epoch. The
file will be removed unless patch is conforming to POSIX
and the -E or --remove-empty-files option is not given.
An easy way to generate patches that create and remove
files is to use GNU diff's -N or --new-file option.
and `man diff` for GNU diff says:
-N
--new-file
In directory comparison, if a file is found in only
one directory, treat it as present but empty in the
other directory.
Not all the world's a GNU, but at least some implementations of patch
appear able to delete files.
Cheers,
Philip
--
Philip Newton <[EMAIL PROTECTED]>
I appreciate copies of replies to my messages to Perl5 lists.