Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408109 - sys-fs/lvm2: improve src_install sed for editing installed init.d files
Summary: sys-fs/lvm2: improve src_install sed for editing installed init.d files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-14 03:05 UTC by Kevin Pyle
Modified: 2012-03-15 02:32 UTC (History)
2 users (show)

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 Kevin Pyle 2012-03-14 03:05:45 UTC
All presently available versions of sys-fs/lvm2 contain the following line in src_install, intended to make the init scripts resilient against systems that do not write the rcscripts under /lib:

    sed -e "s-/lib/rcscripts/-/$(get_libdir)/rcscripts/-" -i "${D}"/etc/init.d/*

However, there are two problems with this.  First, there is no ||die, so a failed sed results in silently installing an unmodified copy of the relevant init.d files.  Second, the choice of dash as a separator is suboptimal.  I am presently experimenting with a system that has a multiarch-aware LIBDIR (LIBDIR_amd64="lib/x86_64-pc-linux-gnu", specifically).  This caused the sed to fail, since the string returned by $(get_libdir) contained dashes.  I suggest changing the sed expression to the below, which I am currently using via a local overlay:

    sed -e "s|/lib/rcscripts/|/$(get_libdir)/rcscripts/|" -i "${ED}"/etc/init.d/* || die

Although no character is absolutely safe when dealing with filenames, I think a vertical bar is sufficiently unlikely that no one will stumble across it by accident.

A system with the standard LIBDIR_amd64 is not affected.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-03-14 05:57:31 UTC
Fixed in 2.02.93, not doing in the other versions or a revbump, as this is really weird setup you have.
Comment 2 Kevin Pyle 2012-03-15 02:32:11 UTC
Yes, it is weird (for now).  It was inspired by an LWN article about multiarch work in Debian <http://lwn.net/Articles/482952/>.  Skipping the revbump is fine, since I already have it fixed locally and explicit rebuilds are needed for conversion to this layout.  I am happy not to carry such a trivial change long term.