Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/baselayout/
Date: Wed, 07 Feb 2018 19:51:17
Message-Id: 1518033063.587512e176c5ea13385e7f5ba5d2c23afe80a8c3.williamh@gentoo
1 commit: 587512e176c5ea13385e7f5ba5d2c23afe80a8c3
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 7 19:49:41 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 7 19:51:03 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=587512e1
7
8 sys-apps/baselayout: Live ebuild cleanups:
9
10 - run layout targets in src_install
11 - call multilib_layout only in pkg_setup
12 - remove some baselayout-1.x migration code from pkg_preinst/pkg_postinst
13
14 Package-Manager: Portage-2.3.19, Repoman-2.3.6
15
16 sys-apps/baselayout/baselayout-9999.ebuild | 49 ++++++++++--------------------
17 1 file changed, 16 insertions(+), 33 deletions(-)
18
19 diff --git a/sys-apps/baselayout/baselayout-9999.ebuild b/sys-apps/baselayout/baselayout-9999.ebuild
20 index 4622672eb5b..20a7143a742 100644
21 --- a/sys-apps/baselayout/baselayout-9999.ebuild
22 +++ b/sys-apps/baselayout/baselayout-9999.ebuild
23 @@ -18,11 +18,7 @@ fi
24
25 LICENSE="GPL-2"
26 SLOT="0"
27 -IUSE="build usrmerge kernel_linux"
28 -
29 -pkg_setup() {
30 - multilib_layout
31 -}
32 +IUSE="usrmerge kernel_linux"
33
34 # Create our multilib dirs - the Makefile has no knowledge of this
35 multilib_layout() {
36 @@ -136,31 +132,15 @@ multilib_layout() {
37 fi
38 }
39
40 -pkg_preinst() {
41 - # Bug #217848 - Since the remap_dns_vars() called by pkg_preinst() of
42 - # the baselayout-1.x ebuild copies all the real configs from the user's
43 - # /etc/conf.d into ${D}, it makes them all appear to be the default
44 - # versions. In order to protect them from being unmerged after this
45 - # upgrade, modify their timestamps.
46 - touch "${EROOT}"/etc/conf.d/* 2>/dev/null
47 +pkg_setup() {
48 + multilib_layout
49 +}
50
51 +pkg_preinst() {
52 # This is written in src_install (so it's in CONTENTS), but punt all
53 # pending updates to avoid user having to do etc-update (and make the
54 # pkg_postinst logic simpler).
55 rm -f "${EROOT}"/etc/._cfg????_gentoo-release
56 -
57 - # We need to install directories and maybe some dev nodes when building
58 - # stages, but they cannot be in CONTENTS.
59 - # Also, we cannot reference $S as binpkg will break so we do this.
60 - multilib_layout
61 - if use build ; then
62 - if ! use usrmerge; then
63 - emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout
64 - else
65 - emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout-usrmerge
66 - fi
67 - fi
68 - rm -f "${ED}"/usr/share/${PN}/Makefile
69 }
70
71 src_prepare() {
72 @@ -190,15 +170,22 @@ src_prepare() {
73 }
74
75 src_install() {
76 + if ! use usrmerge; then
77 + emake \
78 + OS=$(usex kernel_FreeBSD BSD Linux) \
79 + DESTDIR="${ED}" \
80 + layout
81 + else
82 + emake \
83 + OS=$(usex kernel_FreeBSD BSD Linux) \
84 + DESTDIR="${ED}" \
85 + layout-usrmerge
86 + fi
87 emake \
88 OS=$(usex kernel_FreeBSD BSD Linux) \
89 DESTDIR="${ED}" \
90 install
91 dodoc ChangeLog
92 -
93 - # need the makefile in pkg_preinst
94 - insinto /usr/share/${PN}
95 - doins Makefile
96 }
97
98 pkg_postinst() {
99 @@ -235,10 +222,6 @@ pkg_postinst() {
100 fi
101 fi
102
103 - # baselayout leaves behind a lot of .keep files, so let's clean them up
104 - find "${EROOT}"lib*/rcscripts/ -name .keep -exec rm -f {} + 2>/dev/null
105 - find "${EROOT}"lib*/rcscripts/ -depth -type d -exec rmdir {} + 2>/dev/null
106 -
107 # whine about users with invalid shells #215698
108 if [[ -e "${EROOT}"etc/passwd ]] ; then
109 local bad_shells=$(awk -F: 'system("test -e " $7) { print $1 " - " $7}' "${EROOT}"etc/passwd | sort)