Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 932318 - sys-apps/portage-3.0.63: etc-update automerges lines starting with an hyphen or plus character
Summary: sys-apps/portage-3.0.63: etc-update automerges lines starting with an hyphen ...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-20 18:20 UTC by Ryoto Yayame
Modified: 2024-05-20 18:20 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryoto Yayame 2024-05-20 18:20:40 UTC
============================================================

# printf -- '-foo' >| /etc/foobar
# printf -- '-bar' >| /etc/._cfg0000_foobar

# etc-update
Scanning Configuration files...
Automerging trivial changes in: /etc/foobar
Exiting: Nothing left to do; exiting. :)

# cat /etc/foobar
-bar

============================================================

Same with '+'. But not '=', for example, or if absent.


This is even despite:

/etc/etc-update.conf
------------------------------------------------------------
# Whether trivial/comment changes should be automerged
eu_automerge="no"


(No other change from default).

... Which for etc-update, should really simply mean "if there is a ._cfg* file, that's not strictly identical to the live version, don't check anything else, and systematically ask users for their decision"...


(Of course I notably have CONFIG_PROTECT="/etc", and nothing cancelling it in CONFIG_PROTECT_MASK).


For comparison, with dispatch-conf:
============================================================

# echo '-foo' >| /etc/foobar
# echo '-bar' >| /etc/._cfg0000_foobar

# dispatch-conf

--- /etc/foobar 2024-05-20 19:11:18.670740602 +0200
+++ /etc/._cfg0000_foobar       2024-05-20 19:11:23.009743173 +0200
@@ -1 +1 @@
--foo
+-bar

>> (1 of 1) -- /etc/foobar
>> q quit, h help, n next, e edit-new, z zap-new, u use-new
   m merge, t toggle-merge, l look-merge:

============================================================


Actual meaningful examples:

# grep -r --exclude='*~' '^-' /etc
============================================================

/etc/clang/gentoo-common.cfg:-include "/usr/include/gentoo/maybe-stddefs.h"
/etc/clang/gentoo-hardened-ld.cfg:-Wl,-z,relro
/etc/clang/gentoo-hardened-ld.cfg:-Wl,-z,now
/etc/clang/gentoo-gcc-install.cfg:--gcc-install-dir="/usr/lib/gcc/x86_64-pc-linux-gnu/13"
/etc/clang/gentoo-runtimes.cfg:--rtlib=libgcc
/etc/clang/gentoo-runtimes.cfg:--unwindlib=libgcc
/etc/clang/gentoo-runtimes.cfg:--stdlib=libstdc++
/etc/clang/gentoo-runtimes.cfg:-fuse-ld=bfd
/etc/clang/gentoo-cet.cfg:-Xarch_host -fcf-protection=full
/etc/clang/gentoo-hardened.cfg:-Xarch_host -fstack-clash-protection
/etc/clang/gentoo-hardened.cfg:-Xarch_host -fstack-protector-strong
/etc/clang/gentoo-hardened.cfg:-fPIE
/etc/clang/gentoo-hardened.cfg:-include "/usr/include/gentoo/fortify.h"
/etc/clang/gentoo-hardened.cfg:-D_GLIBCXX_ASSERTIONS
/etc/clang/gentoo-hardened.cfg:-D_LIBCPP_ENABLE_ASSERTIONS=1

/etc/mplayer/input.conf:- audio_delay -0.100  # Binding the hyphen key.

============================================================


So it's particularly problematic for Clang (sys-devel/clang-common here), at least... (and I tested that the problem does appear for these files).


I suppose there is some regex issue, while checking some diff, in /usr/bin/etc-update, confusing the diff format, with lines actually starting with '-' or '+'...?


(I'm not actually using etc-update, I just noticed while experimenting with stuffs related to dispatch-conf... But I suppose some people still do use it...)