Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 456128

Summary: [NEW FEATURE] Support for RPM distributions in etc-update
Product: Portage Development Reporter: Michal Hrusecky (RETIRED) <miska>
Component: Enhancement/Feature RequestsAssignee: Portage team <dev-portage>
Severity: enhancement CC: suse
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 484436    
Attachments: RPM based distributions support for etc-update

Description Michal Hrusecky (RETIRED) gentoo-dev 2013-02-08 09:54:05 UTC
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
Comment 1 Michal Hrusecky (RETIRED) gentoo-dev 2013-02-08 09:55:40 UTC
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.
Comment 2 Zac Medico gentoo-dev 2013-02-08 17:53:50 UTC
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"
  basename_find_opts() {
    echo \-name "._cfg????_${1}"
Comment 3 Theo Chatzimichos (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2013-02-23 12:09:31 UTC
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)
Comment 4 Theo Chatzimichos (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2014-11-08 16:52:00 UTC
Comment 5 Zac Medico gentoo-dev 2014-11-08 18:54:18 UTC
(In reply to Theo Chatzimichos from comment #4)

Looks good to me, except $name_opt needs quotes (may contain whitespace or special shell characters).
Comment 6 Zac Medico gentoo-dev 2014-11-08 19:02:15 UTC
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}"
	get_live_file() {
		echo "${cfg_file%.rpmnew}"

I think that's better because it separates the implementation-specific details.
Comment 7 Theo Chatzimichos (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2014-11-08 19:44:15 UTC
both done
Comment 9 Zac Medico gentoo-dev 2017-08-11 21:11:58 UTC
Fixed in 2.2.15.