etc-update is a really helpfull tool that Gentoo has. Let's let other distributions (RPM based) use it as well. Reproducible: Always Steps to Reproduce: 1. Install for example openSUSE 2. Modify configuration files 3. Update Actual Results: Try to figure out what files need merging and merge them one by one Expected Results: Run etc-update and let it take care of everything
Created attachment 338306 [details, diff] RPM based distributions support for etc-update Providing patch that implements the requested functionality. Tested on openSUSE and so far works.
I think there needs to be a better way to detect the rpm-based distro than lack of portageq. I would like it to die if portageq is not found and an rpm-based distro is not detected. I don't want it check for /etc/gentoo-release at all, since we may have derived distros like funtoo. Anything that's different between portage and rpm based distros should be split out into functions that behave differently depending on the distro type. For example: if ${RPM_DISTRO} ; then basename_find_opts() { echo \-name "${1}.rpmnew" } else basename_find_opts() { echo \-name "._cfg????_${1}" } fi
The best way to check for operating system information is to check /etc/*-version. As a reference, the same logic is followed by facter (a tool used by puppet to get system information) https://github.com/puppetlabs/facter/blob/master/lib/facter/operatingsystem.rb
https://github.com/gentoo/portage/pull/7
(In reply to Theo Chatzimichos from comment #4) > https://github.com/gentoo/portage/pull/7 Looks good to me, except $name_opt needs quotes (may contain whitespace or special shell characters).
Also, since function calls inherit local variables from the calling function, get_live_file can use the local variables from where the function was called. So, get_live_file can have no arguments, and the function can use the local variables like this: if [[ $OS_FAMILY == 'gentoo' ]]; then get_live_file() { echo "${rpath}/${rfile:10}" } else get_live_file() { echo "${cfg_file%.rpmnew}" } fi I think that's better because it separates the implementation-specific details.
both done
Thanks, it's merged: https://github.com/gentoo/portage/commit/59471df7a8d05bd060f3b4eb0c25d806cc4883a4
Fixed in 2.2.15.