Re: [gentoo-user] emerge default config

2015-01-25 Thread Rich Freeman
On Sun, Jan 25, 2015 at 9:57 AM,  cov...@ccs.covici.com wrote:
 Marc Joliet mar...@gmx.de wrote:

 The man page to cfg-update says that it needs diff3 for the automatic 
 three-way
 merge (STAGE2), which is part of diffutils.  Interestingly, cfg-update does 
 not
 depend on diffutils, so maybe you (Covici) just need to install it?

 And for manual three-way merges (STAGE3) there are, at the very least, Vim 
 and
 Emacs.

 I found that cfg-update rarely did its automatic merge (I do have
 diffutils) and so there was nothing to be gained between cfg-update and
 etc-update which seemed better as long as you were not relying on
 automatic merge.  It seemed to only do it on comments, but I can't say
 that was always true.


This might be as simple as a missing dependency.  I'd be interested in
more testing feedback in this area, and I might set up a container to
test this more myself.

I find that cfg-update correctly auto-merges config files probably 95%
of the time.  I'd happily keep it in portage if I were the only person
using it as a result. :)  However, if there are bugs preventing use by
others they ought to be fixed.

-- 
Rich



Re: [gentoo-user] emerge default config

2015-01-25 Thread covici
Marc Joliet mar...@gmx.de wrote:

 Am Fri, 23 Jan 2015 21:30:07 -0500
 schrieb Rich Freeman ri...@gentoo.org:
 
  On Fri, Jan 23, 2015 at 7:12 PM,  cov...@ccs.covici.com wrote:
   On Fri, Jan 23, 2015 at 5:45 PM, shawn wilson ag4ve...@gmail.com wrote:
Is there a way to have default config lines that emerge updates won't 
touch?
   
  
   I'd be interested in hearing about alternatives, but I switched to
   cfg-update from dispatch-conf and such because it does automatic 3-way
   merging.  It is pretty good about detecting stuff that you customized
   and auto-merging those lines as long as the upstream file doesn't
   change.  If it does, then you get a 3-way merge in meld or another
   tool to do the merge.  95% of the time it just automerges all config
   file updates without any interaction.
  
   I inherited maintaining this upstream, so feel free to submit
   improvements.  It is a fairly mature tool but we've had some great
   contributions to keep it up-to-date with portage/paludis apis.
  
   I was using that, but it didn't do any automatic 3-way merge for me, I
   do everything from a text console.  I am now using etc-update which is
   not too bad.
  
  I'd have to take another look, but I don't think the automatic merge
  works unless you're using a 3-way diff tool, and I think those are all
  X11.
 
 The man page to cfg-update says that it needs diff3 for the automatic 
 three-way
 merge (STAGE2), which is part of diffutils.  Interestingly, cfg-update does 
 not
 depend on diffutils, so maybe you (Covici) just need to install it?
 
 And for manual three-way merges (STAGE3) there are, at the very least, Vim and
 Emacs.

I found that cfg-update rarely did its automatic merge (I do have
diffutils) and so there was nothing to be gained between cfg-update and
etc-update which seemed better as long as you were not relying on
automatic merge.  It seemed to only do it on comments, but I can't say
that was always true.

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] emerge default config

2015-01-25 Thread Marc Joliet
Am Fri, 23 Jan 2015 21:30:07 -0500
schrieb Rich Freeman ri...@gentoo.org:

 On Fri, Jan 23, 2015 at 7:12 PM,  cov...@ccs.covici.com wrote:
  On Fri, Jan 23, 2015 at 5:45 PM, shawn wilson ag4ve...@gmail.com wrote:
   Is there a way to have default config lines that emerge updates won't 
   touch?
  
 
  I'd be interested in hearing about alternatives, but I switched to
  cfg-update from dispatch-conf and such because it does automatic 3-way
  merging.  It is pretty good about detecting stuff that you customized
  and auto-merging those lines as long as the upstream file doesn't
  change.  If it does, then you get a 3-way merge in meld or another
  tool to do the merge.  95% of the time it just automerges all config
  file updates without any interaction.
 
  I inherited maintaining this upstream, so feel free to submit
  improvements.  It is a fairly mature tool but we've had some great
  contributions to keep it up-to-date with portage/paludis apis.
 
  I was using that, but it didn't do any automatic 3-way merge for me, I
  do everything from a text console.  I am now using etc-update which is
  not too bad.
 
 I'd have to take another look, but I don't think the automatic merge
 works unless you're using a 3-way diff tool, and I think those are all
 X11.

The man page to cfg-update says that it needs diff3 for the automatic three-way
merge (STAGE2), which is part of diffutils.  Interestingly, cfg-update does not
depend on diffutils, so maybe you (Covici) just need to install it?

And for manual three-way merges (STAGE3) there are, at the very least, Vim and
Emacs.

-- 
Marc Joliet
--
People who think they know everything really annoy those of us who know we
don't - Bjarne Stroustrup


pgpP4Zd0XqISN.pgp
Description: Digitale Signatur von OpenPGP


Re: [gentoo-user] emerge default config

2015-01-24 Thread Róbert Čerňanský
On Fri, 23 Jan 2015 18:30:52 -0500
Rich Freeman ri...@gentoo.org wrote:

 On Fri, Jan 23, 2015 at 5:45 PM, shawn wilson ag4ve...@gmail.com
 wrote:
  Is there a way to have default config lines that emerge updates
  won't touch?
 
 
 I'd be interested in hearing about alternatives, but I switched to
 cfg-update from dispatch-conf and such because it does automatic 3-way
 merging.  It is pretty good about detecting stuff that you customized
 and auto-merging those lines as long as the upstream file doesn't
 change.  If it does, then you get a 3-way merge in meld or another
 tool to do the merge.  95% of the time it just automerges all config
 file updates without any interaction.

dispatch-conf does automatic 3-way merge too, I guess.  At least it
offers me pre-merged file (that I have modified) from time to time
which I can just confirm (right there in the console).  But somehow it
does that less often than I think it could and most of the time offers
me just diffs.  Although it is not that bad since there is not much of
them (it does lot of full automatic merges without even asking for
confirmation), there are some files for which I get diffs over and over
again.  sshd_config is one of them, same as the OP.

Robert


-- 
Róbert Čerňanský
E-mail: ope...@tightmail.com
Jabber: h...@jabber.sk



[gentoo-user] emerge default config

2015-01-23 Thread shawn wilson
Is there a way to have default config lines that emerge updates won't touch?

For instance, my /etc/ssh/sshd_config differs from the default in some
places. I know this and upstream shows me the same diffs in that file
over and over again. But maybe upstream will add a new option - I'd
like to see that (obviously I'd miss out on new crypto types if I
ignored that line, but that's ok - I keep up on that anyway). There
are obviously other places in other files as well - logrotate
retention comes to mind as well.



Re: [gentoo-user] emerge default config

2015-01-23 Thread Rich Freeman
On Fri, Jan 23, 2015 at 5:45 PM, shawn wilson ag4ve...@gmail.com wrote:
 Is there a way to have default config lines that emerge updates won't touch?


I'd be interested in hearing about alternatives, but I switched to
cfg-update from dispatch-conf and such because it does automatic 3-way
merging.  It is pretty good about detecting stuff that you customized
and auto-merging those lines as long as the upstream file doesn't
change.  If it does, then you get a 3-way merge in meld or another
tool to do the merge.  95% of the time it just automerges all config
file updates without any interaction.

I inherited maintaining this upstream, so feel free to submit
improvements.  It is a fairly mature tool but we've had some great
contributions to keep it up-to-date with portage/paludis apis.

-- 
Rich



Re: [gentoo-user] emerge default config

2015-01-23 Thread shawn wilson
On Fri, Jan 23, 2015 at 7:12 PM,  cov...@ccs.covici.com wrote:
 Rich Freeman ri...@gentoo.org wrote:

 On Fri, Jan 23, 2015 at 5:45 PM, shawn wilson ag4ve...@gmail.com wrote:
  Is there a way to have default config lines that emerge updates won't 
  touch?
 

 I'd be interested in hearing about alternatives, but I switched to
 cfg-update from dispatch-conf and such because it does automatic 3-way
 merging.  It is pretty good about detecting stuff that you customized
 and auto-merging those lines as long as the upstream file doesn't
 change.  If it does, then you get a 3-way merge in meld or another
 tool to do the merge.  95% of the time it just automerges all config
 file updates without any interaction.

 I inherited maintaining this upstream, so feel free to submit
 improvements.  It is a fairly mature tool but we've had some great
 contributions to keep it up-to-date with portage/paludis apis.

 I was using that, but it didn't do any automatic 3-way merge for me, I
 do everything from a text console.  I am now using etc-update which is
 not too bad.


Yeah, I guess I should've specified - I'm using etc-update. The best I
can do is merge specific parts of the diff with it. But, it always
hits on certain config files which is annoying.

cfg-update says it can be cli, so I'll check that out:
  Description: Easy to use GUI  CLI alternative for etc-update
with safe automatic updating functionality



Re: [gentoo-user] emerge default config

2015-01-23 Thread covici
Rich Freeman ri...@gentoo.org wrote:

 On Fri, Jan 23, 2015 at 5:45 PM, shawn wilson ag4ve...@gmail.com wrote:
  Is there a way to have default config lines that emerge updates won't touch?
 
 
 I'd be interested in hearing about alternatives, but I switched to
 cfg-update from dispatch-conf and such because it does automatic 3-way
 merging.  It is pretty good about detecting stuff that you customized
 and auto-merging those lines as long as the upstream file doesn't
 change.  If it does, then you get a 3-way merge in meld or another
 tool to do the merge.  95% of the time it just automerges all config
 file updates without any interaction.
 
 I inherited maintaining this upstream, so feel free to submit
 improvements.  It is a fairly mature tool but we've had some great
 contributions to keep it up-to-date with portage/paludis apis.

I was using that, but it didn't do any automatic 3-way merge for me, I
do everything from a text console.  I am now using etc-update which is
not too bad.

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] emerge default config

2015-01-23 Thread Rich Freeman
On Fri, Jan 23, 2015 at 7:12 PM,  cov...@ccs.covici.com wrote:
 On Fri, Jan 23, 2015 at 5:45 PM, shawn wilson ag4ve...@gmail.com wrote:
  Is there a way to have default config lines that emerge updates won't 
  touch?
 

 I'd be interested in hearing about alternatives, but I switched to
 cfg-update from dispatch-conf and such because it does automatic 3-way
 merging.  It is pretty good about detecting stuff that you customized
 and auto-merging those lines as long as the upstream file doesn't
 change.  If it does, then you get a 3-way merge in meld or another
 tool to do the merge.  95% of the time it just automerges all config
 file updates without any interaction.

 I inherited maintaining this upstream, so feel free to submit
 improvements.  It is a fairly mature tool but we've had some great
 contributions to keep it up-to-date with portage/paludis apis.

 I was using that, but it didn't do any automatic 3-way merge for me, I
 do everything from a text console.  I am now using etc-update which is
 not too bad.

I'd have to take another look, but I don't think the automatic merge
works unless you're using a 3-way diff tool, and I think those are all
X11.  That doesn't make sense to me - the automatic part at least
should be attempted with only a 2-way tool.

I need to see if there is anything I can do about that.  Also, if you
haven't used it in the last year or two try it again.  When I took it
over we had a flurry of patches which fixed a bunch of little things
with it, but it has been quiet for a while.

-- 
Rich



Re: [gentoo-user] emerge default config

2015-01-23 Thread covici
Rich Freeman ri...@gentoo.org wrote:

 On Fri, Jan 23, 2015 at 7:12 PM,  cov...@ccs.covici.com wrote:
  On Fri, Jan 23, 2015 at 5:45 PM, shawn wilson ag4ve...@gmail.com wrote:
   Is there a way to have default config lines that emerge updates won't 
   touch?
  
 
  I'd be interested in hearing about alternatives, but I switched to
  cfg-update from dispatch-conf and such because it does automatic 3-way
  merging.  It is pretty good about detecting stuff that you customized
  and auto-merging those lines as long as the upstream file doesn't
  change.  If it does, then you get a 3-way merge in meld or another
  tool to do the merge.  95% of the time it just automerges all config
  file updates without any interaction.
 
  I inherited maintaining this upstream, so feel free to submit
  improvements.  It is a fairly mature tool but we've had some great
  contributions to keep it up-to-date with portage/paludis apis.
 
  I was using that, but it didn't do any automatic 3-way merge for me, I
  do everything from a text console.  I am now using etc-update which is
  not too bad.
 
 I'd have to take another look, but I don't think the automatic merge
 works unless you're using a 3-way diff tool, and I think those are all
 X11.  That doesn't make sense to me - the automatic part at least
 should be attempted with only a 2-way tool.
 
 I need to see if there is anything I can do about that.  Also, if you
 haven't used it in the last year or two try it again.  When I took it
 over we had a flurry of patches which fixed a bunch of little things
 with it, but it has been quiet for a while.

Let me know, about the operation of this using a console and I will try
it again, sounds good.

Thanks.

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

 John Covici
 cov...@ccs.covici.com



Re: [gentoo-user] emerge default config

2015-01-23 Thread Tomas Mozes

On 2015-01-23 23:45, shawn wilson wrote:
Is there a way to have default config lines that emerge updates won't 
touch?


For instance, my /etc/ssh/sshd_config differs from the default in some
places. I know this and upstream shows me the same diffs in that file
over and over again. But maybe upstream will add a new option - I'd
like to see that (obviously I'd miss out on new crypto types if I
ignored that line, but that's ok - I keep up on that anyway). There
are obviously other places in other files as well - logrotate
retention comes to mind as well.


1) you have a fresh /etc/ssh/sshd_config
2) describe and apply the changes you want to make, like:
ensure PermitRootLogin is without-password
ensure AllowUsers is admin1 admin2

After some time, you have a shiny new OpenSSH version installed that 
adds some lines, so you have a ._cfg to deal with. What do you do?


- mv ._cfg to sshd_config
- do 2) as before

Your configuration is updated and your changes stay there too. I also 
keep a virgin copy of the configuration so that anybody comes to the 
server can directly diff between the original file and the changes done.


This can be both down in shell scripts or an easier way is to use 
configuration management. For example with ansible, you can use the 
lineinfile module:

http://docs.ansible.com/lineinfile_module.html