tech-userlevel archive

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

Re: Two improvements to etcupdate(8)



Le 29/01/2016 19:57, Edgar Fuss a écrit :
> I don't think so. man postinstall says (under ``fix''):
> 	Conflicts between existing files in the target file system
> 	and new files from the NetBSD distribution are resolved by
> 	replacing the existing file with the new file; there is no
> 	attempt to merge the files.  See etcupdate(8) for an
> 	alternative update method that is able to merge files.
> How should postinstall know about whether a file contains local modifications?
> It dosn't have any checksums of former NetBSD's etc files, does it?

It is done on a case by case basis, depending on what do_*() functions
want to do: move the files bluntly without checking, note the diff
between original and current and log an error to fix manually, or leave
the changed files untouched. TBH the "merge" quality depends on what the
developers coded in the postinstall(8) routine.

After some reflexion your case is different, etcupdate(8) is more
oriented towards an admin that updates the system rather than the dev
that updates etc/ because the OS evolved.
However, what you propose is from my PoV dangerous, you could completely
wreck the conf if you happen to play the wrong "autoanswer" file. At
least some form of rollback could be accessible: maybe use the
backup_rcs routines found in security.conf/rc.subr, and document a way
to rollback if it went wrong?

-- 
Jean-Yves Migeon



Home | Main Index | Thread Index | Old Index