Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 591460 - sys-apps/portage-2.3.0 - dispatch-conf sometimes merges garbage
Summary: sys-apps/portage-2.3.0 - dispatch-conf sometimes merges garbage
Status: RESOLVED DUPLICATE of bug 591044
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-17 12:13 UTC by Thomas Deutschmann (RETIRED)
Modified: 2016-08-17 12:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Demo files (dispatch-conf-problem_src.tar.xz,3.53 KB, application/x-xz-compressed)
2016-08-17 12:13 UTC, Thomas Deutschmann (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2016-08-17 12:13:15 UTC
Created attachment 443584 [details]
Demo files

Hi,

sometimes when dispatch-conf merges config files the resulting file gets broken.

I saw that first while working on bug 480018 where I implemented support for the config protection feature (i.e. instead of changing the real file I am creating a new "._cfgxxxx_filename" file which should be merge afterwards; see https://github.com/Whissi/lm-sensors/commit/769789e4eb2e6e61d60d598b7d501f12da5470dd#diff-5a2228f2da9369e14c66dcbacc8195c8R7252 for implementation details).

While testing I noticed that sometimes "/etc/conf.d/modules" was destroyed after calling "dispatch-conf" after the file was already modified once, i.e.

1. You have a default "/etc/conf.d/modules" file

2. You run "sensors-detect" for the first time; The script will add something like

> # BEGIN sys-apps/lm_sensors
> # Generated by sensors-detect on Wed Aug 17 14:08:43 2016
> modules="$modules coretemp"
> # END sys-apps/lm_sensors

to your "/etc/conf.d/modules" file.

3. When you now re-run sensors-detect and tell the script to overwrite the previous modification i.e. replacing the previous added lines with

> # BEGIN sys-apps/lm_sensors
> # Generated by sensors-detect on Wed Aug 17 14:08:53 2016
> modules="$modules coretemp"
> # END sys-apps/lm_sensors

(because nothing changed on my system, only a new timestamp...) and call "dispatch-conf" the new "/etc/conf.d/modules" file will look like:

> [...]
> # You should consult your kernel documentation and configuration
> # for a list of modules and their options.
> 
> # BEGIN sys-apps/lm_sensors
> n define a list modules for a specific kernel version,
> # amodules="$modules coretemp"
> # END sys-apps/lm_sensors



I didn't reported this yet because I thought maybe this is related how Perl creates the file or something else. But now I hit the same problem after "emerge" modified "/etc/portage/package.use".

See the attached archive which contains my original "/etc/portage/package.use" and "/etc/portage/._cfg0000_package.use" file with the changes emerge wants to apply. In tmp you can find a diff (which looks right) and a diff how "dispatch-conf" sees the merged file, which is already broken). My dispatch-conf.conf is also included.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2016-08-17 12:26:43 UTC
I am not longer able to reproduce the problem with =sys-apps/diffutils-3.4-r1 (when I reported the issue I was using =sys-apps/diffutils-3.4).

*** This bug has been marked as a duplicate of bug 591044 ***