Skip to content

Commit

Permalink
sys-fs/lvm2: rework install logic
Browse files Browse the repository at this point in the history
This makes the logic more readable.

It also probably resolves a race condition by not passing both "install"
and "install_device-mapper" as targets.

Drop the "install_systemd_generators" target: this has been a noop for
several releases.

Closes: https://bugs.gentoo.org/913231
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
  • Loading branch information
floppym committed Oct 16, 2023
1 parent 6b6e345 commit d33ffb6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions sys-fs/lvm2/lvm2-2.03.22-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@ src_test() {
}

src_install() {
local INSTALL_TARGETS=(
# full LVM2
$(usev lvm "install install_tmpfiles_configuration")
# install systemd related files only when requested, bug #522430
$(usev $(usex lvm systemd lvm) "SYSTEMD_GENERATOR_DIR=$(systemd_get_systemgeneratordir) \
install_systemd_units install_systemd_generators")

# install dm unconditionally
install_device-mapper
)
emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
local targets=()
if use lvm; then
targets+=( install install_tmpfiles_configuration )
if use systemd; then
# install systemd related files only when requested, bug #522430
targets+=( install_systemd_units )
fi
else
targets+=( install_device-mapper )
fi
emake V=1 DESTDIR="${D}" "${targets[@]}"

newinitd "${FILESDIR}"/device-mapper.rc-r3 device-mapper
newconfd "${FILESDIR}"/device-mapper.conf-r4 device-mapper
Expand Down
22 changes: 11 additions & 11 deletions sys-fs/lvm2/lvm2-2.03.22-r2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@ src_test() {
}

src_install() {
local INSTALL_TARGETS=(
# full LVM2
$(usev lvm "install install_tmpfiles_configuration")
# install systemd related files only when requested, bug #522430
$(usev $(usex lvm systemd lvm) "SYSTEMD_GENERATOR_DIR=$(systemd_get_systemgeneratordir) \
install_systemd_units install_systemd_generators")

# install dm unconditionally
install_device-mapper
)
emake V=1 DESTDIR="${D}" "${INSTALL_TARGETS[@]}"
local targets=()
if use lvm; then
targets+=( install install_tmpfiles_configuration )
if use systemd; then
# install systemd related files only when requested, bug #522430
targets+=( install_systemd_units )
fi
else
targets+=( install_device-mapper )
fi
emake V=1 DESTDIR="${D}" "${targets[@]}"

newinitd "${FILESDIR}"/device-mapper.rc-r3 device-mapper
newconfd "${FILESDIR}"/device-mapper.conf-r4 device-mapper
Expand Down

0 comments on commit d33ffb6

Please sign in to comment.