Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Portage Developer (http://www.linux-archive.org/gentoo-portage-developer/)
-   -   How to prevent dispatch-conf from reverting valid changes (http://www.linux-archive.org/gentoo-portage-developer/689485-how-prevent-dispatch-conf-reverting-valid-changes.html)

Pacho Ramos 08-01-2012 10:19 AM

How to prevent dispatch-conf from reverting valid changes
 
On every openrc update I get dispatch-conf wanting to revert all my
changes in /etc/conf.d files, like KEYMAP, clock...

Is there any way to prevent it from doing that?

Thanks a lot for the info

Duncan 08-01-2012 03:33 PM

How to prevent dispatch-conf from reverting valid changes
 
Pacho Ramos posted on Wed, 01 Aug 2012 12:19:20 +0200 as excerpted:

> On every openrc update I get dispatch-conf wanting to revert all my
> changes in /etc/conf.d files, like KEYMAP, clock...
>
> Is there any way to prevent it from doing that?
>
> Thanks a lot for the info

Interesting. I use etc-update here, and at least it (working with
portage) has a feature such that it takes the hash of the package's config
file, and as long as that doesn't change, it won't bother you again.

Of course if there's a change in the package's config file, it simply
diffs the files, thus returning hits for parts of the files that haven't
changed since the last time if they differ, because some other chunk of
the file is new (say one entirely new option in a file of dozens, the
rest of which haven't changed).

Between that and the auto-merge-trivial-changes (which would appear to be
comments in most cases) option, I don't get bothered /too/ often, tho it
/would/ be nice if it could check individual sections within the file,
spotting when they haven't changed, so it'd only bother me about the new
option, not the dozen old options I've already customized.


Another technique that I find helps with some files that I've changed a
lot, is to put all my changes (save for commenting the defaults where
necessary, if later changes won't override but instead accumulate) in a
section at the end. That way, the main config is identical to the
unchanged package config, so any changes to it immediately leap out, and
I can take those changes to the boilerplate section, then edit the file
afterward, making the corresponding changes to my custom section.

That tends to work pretty well, since I take all the changes upto the
point where it switches to my custom config, then I refuse the change
deleting it, and edit the file to make my custom changes based on the
boilerplate changes just called to my attention.

--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman

Zac Medico 08-01-2012 11:14 PM

How to prevent dispatch-conf from reverting valid changes
 
On 08/01/2012 03:19 AM, Pacho Ramos wrote:
> On every openrc update I get dispatch-conf wanting to revert all my
> changes in /etc/conf.d files, like KEYMAP, clock...
>
> Is there any way to prevent it from doing that?
>
> Thanks a lot for the info
>

Maybe we can trace the behavior back to the diff3 command that it's
using. Inside /usr/lib/portage/pym/portage/dispatch_conf.py we have this
command:

DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'"

Are you able to reproduce the problem by running this command manually?

Something like this:

diff3 -mR /etc/conf.d/hostname
/etc/config-archive/etc/conf.d/hostname.dist
/etc/conf.d/._cfg0000_hostname > /tmp/mrgconf
--
Thanks,
Zac

Zac Medico 08-01-2012 11:16 PM

How to prevent dispatch-conf from reverting valid changes
 
On 08/01/2012 08:33 AM, Duncan wrote:
> Pacho Ramos posted on Wed, 01 Aug 2012 12:19:20 +0200 as excerpted:
>
>> On every openrc update I get dispatch-conf wanting to revert all my
>> changes in /etc/conf.d files, like KEYMAP, clock...
>>
>> Is there any way to prevent it from doing that?
>>
>> Thanks a lot for the info
>
> Interesting. I use etc-update here, and at least it (working with
> portage) has a feature such that it takes the hash of the package's config
> file, and as long as that doesn't change, it won't bother you again.

This is actually a feature of portage's merge code, which can be
disabled by the emerge --noconfmem option.

> Of course if there's a change in the package's config file, it simply
> diffs the files, thus returning hits for parts of the files that haven't
> changed since the last time if they differ, because some other chunk of
> the file is new (say one entirely new option in a file of dozens, the
> rest of which haven't changed).

Unlike etc-update, dispatch-conf uses diff3.

--
Thanks,
Zac

Pacho Ramos 08-02-2012 06:36 AM

How to prevent dispatch-conf from reverting valid changes
 
El mié, 01-08-2012 a las 16:14 -0700, Zac Medico escribió:
> On 08/01/2012 03:19 AM, Pacho Ramos wrote:
> > On every openrc update I get dispatch-conf wanting to revert all my
> > changes in /etc/conf.d files, like KEYMAP, clock...
> >
> > Is there any way to prevent it from doing that?
> >
> > Thanks a lot for the info
> >
>
> Maybe we can trace the behavior back to the diff3 command that it's
> using. Inside /usr/lib/portage/pym/portage/dispatch_conf.py we have this
> command:
>
> DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'"
>
> Are you able to reproduce the problem by running this command manually?
>
> Something like this:
>
> diff3 -mR /etc/conf.d/hostname
> /etc/config-archive/etc/conf.d/hostname.dist
> /etc/conf.d/._cfg0000_hostname > /tmp/mrgconf

I will probably need to reemerge it as I already merged changes and
re-edited config files. Anyway, diff3 looks to not admit -R option:
$ diff3
-mR /etc/conf.d/hostname /etc/config-archive/etc/conf.d/hostname.dist /etc/conf.d/._cfg0000_hostname
diff3: opción inválida -- R
diff3: Pruebe `diff3 --help' para más información.

Zac Medico 08-02-2012 07:34 PM

How to prevent dispatch-conf from reverting valid changes
 
On 08/01/2012 11:36 PM, Pacho Ramos wrote:
> El mié, 01-08-2012 a las 16:14 -0700, Zac Medico escribió:
>> On 08/01/2012 03:19 AM, Pacho Ramos wrote:
>>> On every openrc update I get dispatch-conf wanting to revert all my
>>> changes in /etc/conf.d files, like KEYMAP, clock...
>>>
>>> Is there any way to prevent it from doing that?
>>>
>>> Thanks a lot for the info
>>>
>>
>> Maybe we can trace the behavior back to the diff3 command that it's
>> using. Inside /usr/lib/portage/pym/portage/dispatch_conf.py we have this
>> command:
>>
>> DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'"
>>
>> Are you able to reproduce the problem by running this command manually?
>>
>> Something like this:
>>
>> diff3 -mR /etc/conf.d/hostname
>> /etc/config-archive/etc/conf.d/hostname.dist
>> /etc/conf.d/._cfg0000_hostname > /tmp/mrgconf
>
> I will probably need to reemerge it as I already merged changes and
> re-edited config files. Anyway, diff3 looks to not admit -R option:
> $ diff3
> -mR /etc/conf.d/hostname /etc/config-archive/etc/conf.d/hostname.dist /etc/conf.d/._cfg0000_hostname
> diff3: opción inválida -- R
> diff3: Pruebe `diff3 --help' para más información.

Sorry, that -mR a typo. As you can see in the DIFF3_MERGE value above,
it's diff -mE.
--
Thanks,
Zac

Zac Medico 08-02-2012 10:56 PM

How to prevent dispatch-conf from reverting valid changes
 
On 08/01/2012 03:19 AM, Pacho Ramos wrote:
> On every openrc update I get dispatch-conf wanting to revert all my
> changes in /etc/conf.d files, like KEYMAP, clock...
>
> Is there any way to prevent it from doing that?
>
> Thanks a lot for the info
>

Maybe you want to add those config files to frozen-files in
/etc/dispatch-conf.conf.

--
Thanks,
Zac

Pacho Ramos 09-12-2012 08:03 PM

How to prevent dispatch-conf from reverting valid changes
 
El jue, 02-08-2012 a las 12:34 -0700, Zac Medico escribió:
> On 08/01/2012 11:36 PM, Pacho Ramos wrote:
> > El mié, 01-08-2012 a las 16:14 -0700, Zac Medico escribió:
> >> On 08/01/2012 03:19 AM, Pacho Ramos wrote:
> >>> On every openrc update I get dispatch-conf wanting to revert all my
> >>> changes in /etc/conf.d files, like KEYMAP, clock...
> >>>
> >>> Is there any way to prevent it from doing that?
> >>>
> >>> Thanks a lot for the info
> >>>
> >>
> >> Maybe we can trace the behavior back to the diff3 command that it's
> >> using. Inside /usr/lib/portage/pym/portage/dispatch_conf.py we have this
> >> command:
> >>
> >> DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'"
> >>
> >> Are you able to reproduce the problem by running this command manually?
> >>
> >> Something like this:
> >>
> >> diff3 -mR /etc/conf.d/hostname
> >> /etc/config-archive/etc/conf.d/hostname.dist
> >> /etc/conf.d/._cfg0000_hostname > /tmp/mrgconf
> >
> > I will probably need to reemerge it as I already merged changes and
> > re-edited config files. Anyway, diff3 looks to not admit -R option:
> > $ diff3
> > -mR /etc/conf.d/hostname /etc/config-archive/etc/conf.d/hostname.dist /etc/conf.d/._cfg0000_hostname
> > diff3: opción inválida -- R
> > diff3: Pruebe `diff3 --help' para más información.
>
> Sorry, that -mR a typo. As you can see in the DIFF3_MERGE value above,
> it's diff -mE.

Will try on next openrc update :)

Pacho Ramos 09-12-2012 08:05 PM

How to prevent dispatch-conf from reverting valid changes
 
El jue, 02-08-2012 a las 15:56 -0700, Zac Medico escribió:
> On 08/01/2012 03:19 AM, Pacho Ramos wrote:
> > On every openrc update I get dispatch-conf wanting to revert all my
> > changes in /etc/conf.d files, like KEYMAP, clock...
> >
> > Is there any way to prevent it from doing that?
> >
> > Thanks a lot for the info
> >
>
> Maybe you want to add those config files to frozen-files in
> /etc/dispatch-conf.conf.
>

The problem is that I don't really want to have that files frozen (as
they could need important changes in future versions). What I expect if
dispatch-conf to skip changes like changing an uncommented line with a
commented line, or changing "YES" to "NO"... but it's probably difficult
to detect :|

Pacho Ramos 09-23-2012 10:59 AM

How to prevent dispatch-conf from reverting valid changes
 
El mié, 12-09-2012 a las 22:05 +0200, Pacho Ramos escribió:
> El jue, 02-08-2012 a las 15:56 -0700, Zac Medico escribió:
> > On 08/01/2012 03:19 AM, Pacho Ramos wrote:
> > > On every openrc update I get dispatch-conf wanting to revert all my
> > > changes in /etc/conf.d files, like KEYMAP, clock...
> > >
> > > Is there any way to prevent it from doing that?
> > >
> > > Thanks a lot for the info
> > >
> >
> > Maybe you want to add those config files to frozen-files in
> > /etc/dispatch-conf.conf.
> >
>
> The problem is that I don't really want to have that files frozen (as
> they could need important changes in future versions). What I expect if
> dispatch-conf to skip changes like changing an uncommented line with a
> commented line,

This looks like could be done with:
# Automerge files comprising only whitespace and/or comments
# (yes or no)
replace-wscomments=no

, setting it to "yes" in dispatch-conf.conf

> or changing "YES" to "NO"... but it's probably difficult
> to detect :|


All times are GMT. The time now is 01:32 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.