Viktor Dukhovni:
> > postconf_backup_command (default: empty)
> > 
> >     Optional external command that the postconf(1) command executes
> >     before it attempts to modify the main.cf or master.cf file. The
> >     macro "$file" is replaced by the absolute pathname of the file.
> > 
> >     Note: the command is subject to $name expansion. Specify "$$"
> >     to produce a single "$" character.
> > 
> >     Example:
> > 
> >     # This reuses the destination name when multiple edits are made
> >     # within the same second.
> >     backup_command = cp -p $file $file.saved.`date +%Y%m%d-%H%M%S`
> 
> I assume the backup command will run only once the appropriate lock
> is acquired. The documentation should probably include an example
> of use with RCS:
> 
>       backup_command = ci -u -m"Automatic backup" $file
> 
> Does the command get passed to a shell or executed directly? In
> either case the documentation needs to cover any quoting rules.

I did not plan to re-implement `command` evaluation :-) The only
quoting issue that remains concerns the "$" character and that is
already addressed in the text above.

The "backup before edit" feature does not work with revision control
systems that error out when the current version is already checked
in. For example, git and hg returns status 1 when a file has not
changed since it was checked in. Because of the exit status, postconf
would refuse to edit the file. That is undesirable.

Changing this feature into "do something after edit" would run into
similar problems when the edit did not change the file.

By the way I notice that "ci -u" leaves the file read-only, and
that the next "ci -u" errors out with "no lock set".

If it takes a ton of scripting to make this work with revision
control systems, then maybe we should not encourage such usage.

        Wietse

Reply via email to