Summary: | [NEW FEATURE] Support for RPM distributions in etc-update | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Michal Hrusecky (RETIRED) <miska> |
Component: | Enhancement/Feature Requests | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | suse |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 484436 | ||
Attachments: | RPM based distributions support for etc-update |
Description
Michal Hrusecky (RETIRED)
2013-02-08 09:54:05 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.
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 (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. |