Lots of good input... thanks.

I did try `cfg-update' but I thought it was really slow.  Ditto for
etc-update which I tried some time ago.

What made me ask about this was that I was beginning to think my home
made perl script was too slow and wondered if there was something a
little more sophisticated and fast.

Mostly because I'm used to using it I suppose, but the homely little
script seems much faster and convenient to me.

Here is what it does:

1) finds the new config files when fed a directory

2) presents them to the user like this:

  ---------- 8< ---------- 8< ---------- 8< ----------


  [...] snipped other built in explanatory dialog

   Incoming </etc/._cfg0000_wgetrc>
   Shall we install it as described; overwriting the existing one?
 
   Anything but <y> will rename the new conf listed above to 
   /etc/START_STOP/NOUSE._cfg0000_wgetrc-111508_165416 
   for reference
 
   **Take a look at the diffs before deciding if you need to**
   diff /etc/._cfg0000_wgetrc /etc/wgetrc

     [y/n] > 

  ---------- 8< ---------- 8< ---------- 8< ----------

   So the program itself does no work on comparing and simply presents
   a ready made diff command to be used in a separate terminal.

3) if you say `y' then the old config is overwritten, but first backed 
   up like this:
   STOP-USE_whois.conf-111508_104703 (<= my own file dating system)
                                       [date +"%m%d%y_%H%M%S"]
   (Of course the date is arrived at a little differently in perl)
   And the incoming new config is also backed up like:
   START-USE._cfg0000_whois.conf-111508_104703

   The backups all go into a directory `START_STOP' created by the
   program in whatever directory the config is in.

   [ so I do end up with that directory sprinkled around in a few
   places ] 

   If you say `n'
   the new config is dated and stored like:
   NOUSE._cfg0000_syslog.conf_010107_202225
  
4) There is also a routine for when there is no old config.

This script is probably as poorly written as humanly possible since I'm
far from a perl programmer, and it is not sophisticated at all.

I wrote it quite a good while back and revised it a little a few times.
So I've used it quite a lot, and so far it hasn't eaten `/' or leveled
all /etc configs....

I find that the majority of new configs are either the
`*.example' variety or else a diff shows the changed lines are all
commented in both old or new, so a simple yes and move on.

A three pane merge in xxdiff like cfg-update does by default, seems
really clunky and somewhat overkill.  Not to mention painfully slow.

With configs that need intervention, I'm usually able to get it done with a
simple diff and some hand work carried out in a different xterm or if
in text mode I'll be using `screen' and switch to a different terminal to do
the hand work, or even break out emacs and use its `ediff' tools on
the two files.

The perl script will have made backups of both for the advent of
mistakes. 

Others here probably have vastly more complicated config files than
me, but with this little perl script I'm usually able to blaze thru
15-20 new configs in very short order.  
I may have to do something by hand with 2-3 and occasionally I'll skip a
complicated one and deal with it after disposing all the easy ones.

I'm too embarrassed to post the script, but if someone really wants to
try it I will make it available.  Be advised though that I haven't
paid much attention to security or other dangers... 
  




Reply via email to