Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 1998 23:42:43 -0800
From:      Studded <Studded@dal.net>
To:        FreeBSD-Hackers@FreeBSD.ORG
Subject:   Discussion about script to update /etc, etc.
Message-ID:  <3510CC73.307E199D@dal.net>

next in thread | raw e-mail | index | archive | help
One of the things that has been often requested is a method of
automatically updating the files installed by /usr/src/etc/Makefile for
the user. I have developed the following system based in part on the one
in Nik Clayton's make world tutorial.
http://www.nothing-going-on.demon.co.uk/FreeBSD/make-world/make-world.html

	Before I go on, yes I submitted a PR about this, however since this is
not a small change I thought it would be a good idea to throw it open
for discussion. The basic idea is simple. You use /usr/src/etc/Makefile
to install a temporary tree. My choice is /var/tmp/temproot. Then you cd
to that directory and run the script I submitted with the PR. The most
recent version can always be found at
http://home.san.rr.com/freebsd/comproot.

	The virtue of the script I submitted is that it is very simple, written
in Bourne shell so it should be platform independent. It uses find to
bring up all the files in the tree, not just the files in /etc,
therefore it will not need to be updated when new files are added. 

	The user has the option of unified or context diffs. By default the
script first compares the CVS $Id of the files if they have them. A
"strict" mode is also available to bypass this test. If the files have
the same $Id, the one in the temp environment is deleted. The theory
being that this way local changes will be ignored. If there are no
version $Id's, or if "strict" mode is being used the two files are then
compared with diff -q. If they are not different, the one in the
temproot directory is deleted. 

	If the files are different, the diff is displayed to the user (using
$PAGER if they have it set, more if not). The user is then given the
option to delete or install the temp version of the file. If they don't
chose either option the file remains for them to merge by hand after the
script has run through. 

	I started to think of plans to merge changes for the user but the
number of permutations gave me a huge headache. :)  I update regularly
and rarely have more than one or two files to check by hand when the
script is done running. On a -Stable system that hadn't been updated in
6 months there were maybe 7 or 8 such files. 

	This script has been thoroughly tested for several months by myself on
a number of different -Stable configurations and machines. It's also
been tested by several friends of mine who use -Current. I have thought
of at least two items that I will probably be adding, namely the
building and populating of the temproot environment (probably using
Nik's modified method of adding the date to the name of the directory)
and adding an option to keep the diff around for the user to examine
later. 

	I am open to questions, comments and suggestions of course. The script
already does what I need it to so my feelings won't be hurt if it's not
included in the distribution. However this request is made often and I
think I have a good method here. I'd propose that it live in
/usr/src/etc, and I would love for someone to come up with a more clever
name for it. :)  If y'all do choose to use this script, it's utility
could be greatly increased by giving each of the files installed by the
makefile a CVS $Id. I can provide details if anyone's interested. 

Hope this is useful,

Doug

-- 
***         Chief Operations Officer, DALnet IRC network       ***
*** Proud operator, designer and maintainer of the world's largest
*** Internet Relay Chat server.  5,328 clients and still growing.
*** Try spider.dal.net on ports 6662-4    (Powered by FreeBSD)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3510CC73.307E199D>