Gentoo Archives: gentoo-commits

From: Yuta SATOH <nigoro@×××××××××.jp>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoo-bsd:master commit in: dev-util/catalyst/, dev-util/catalyst/files/
Date: Sat, 09 Dec 2017 22:29:56
Message-Id: 1512858547.577e2305cbb5ee32eb808b3728dd84b291f02db2.yuta_satoh@gentoo
1 commit: 577e2305cbb5ee32eb808b3728dd84b291f02db2
2 Author: Yuta SATOH <nigoro.dev <AT> gmail <DOT> com>
3 AuthorDate: Sat Dec 9 22:29:07 2017 +0000
4 Commit: Yuta SATOH <nigoro <AT> gentoo <DOT> gr <DOT> jp>
5 CommitDate: Sat Dec 9 22:29:07 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/gentoo-bsd.git/commit/?id=577e2305
7
8 dev-util/catalyst: add the patches for Gentoo/FreeBSD.
9
10 dev-util/catalyst/Manifest | 5 ++-
11 dev-util/catalyst/catalyst-2.0.18-r4.ebuild | 21 +++++++--
12 .../catalyst-2.0.18-fbsd-add-tmpfs-support.patch | 48 ++++++++++++++++++++
13 .../files/catalyst-2.0.18-fbsd-fix-linux32.patch | 22 +++++++++
14 .../files/catalyst-2.0.18-fbsd-fix-sed.patch | 52 ++++++++++++++++++++++
15 5 files changed, 143 insertions(+), 5 deletions(-)
16
17 diff --git a/dev-util/catalyst/Manifest b/dev-util/catalyst/Manifest
18 index 3ba594e..40152ac 100644
19 --- a/dev-util/catalyst/Manifest
20 +++ b/dev-util/catalyst/Manifest
21 @@ -1,7 +1,10 @@
22 AUX catalyst-2.0.18-Do-notuntarwith--acls.patch 6156 SHA256 2b8160bba1207cf45412a8133b6ed3b039d6705f76074651b6d42c4488b9bc1e SHA512 500d72f7e11f99eb53275aac3e1b94394826cfa271312ee268092d12a70128b46455c5da1122fb70e21459f56ded3e3ad2752c33516cd3dc4ea4ac70cd0ec32f WHIRLPOOL f348eb0507d9fed5d5e05ba27b4b662fa1fd25e5d87afd886732a45173d2c3b27fee18ad4435c0fdefdb92d6606d0b11a9c54dff459692eff5db3aeb05f2c459
23 +AUX catalyst-2.0.18-fbsd-add-tmpfs-support.patch 1916 SHA256 a917386049e8a6dc9ac7656a2ebcb6ae909c2528994f93dce0df10cbacd3787a SHA512 90bdb046b348d6c661c8321443b65041f8ccfd0e9834f4a76a73dc8136d632a7641b9c394db1bbf4f49b07c20572d82f24f4c76c812d400386b09f773c9463ce WHIRLPOOL 43c7d81ec56c44e76f9e6fbee98c06c3b3b673f6ba6cc529b4cd9b926f585abb7930767da9b6091bcb46c703eadf82c296c5cf51924931baefc0eb405041f19f
24 +AUX catalyst-2.0.18-fbsd-fix-linux32.patch 1008 SHA256 633abcdb6fc1b36a1335c7b203d9db7fd14e4efdd1d45907c63c56fcdbfb5757 SHA512 d10d96bba17be410b88a38e3d341617d7a9a27e6439106dfb907347fcdcaf6d47d2e15fe3ec63f1fa52f773d69bab5fe94825090959bd4364e43d35c16d83a71 WHIRLPOOL a35ca75490b453e4952b996b4c52ec10b75c7b7b11c0f7c7c8ae0bbbb5638380885c9e678e37e093069f02bfe9947e4b976eb13c0b0e0b7d5b6943f91c3ed905
25 +AUX catalyst-2.0.18-fbsd-fix-sed.patch 1878 SHA256 cec0e2edc73a021a28e700465e752ce576e70a9a8d21719bd89fe2be06332a54 SHA512 7abd0aec481c2c32b9fc0664d3db968f6447d77cc7533808d4f122ccd8515b86b90343b8455a964793694a3bf4c7a1c2d38b19e9aeaa0b5e75735925ff975e28 WHIRLPOOL 4443334e2bf791c2a30a98fe76a6b56198a28b11e06973c0be6f7e17f2b1c2520f84407880d5cd8b582fc50ea95440feff528227f59140aa4c8eb6cf1fedb6a0
26 AUX catalyst-2.0.18-fix-quotes.patch 1663 SHA256 5d99b200bef45e3a69003687d00a1939e9ab696bd1d2653f7a76f7ea66972c88 SHA512 185705eba562dfeb52740ad3a0c3ea611648d508079ad54c9e5680d318888cc5123c5ff365b1c575a5348ddfd8210763277daed226b564ed3a59e15f18bff205 WHIRLPOOL 7b9434459c31207e8d36bcbf57df7751739848b2c8e5e081b7b219029deb7257f33652027ca22a94fa0452439e6e97e16467554423435a5bd17cdb293d1942a2
27 AUX catalyst-2.0.18-remove-machine-id.patch 778 SHA256 dc40a3c469a80e40eed68c46ea61ce6ac802aa56ade300eee372c3eb79741d33 SHA512 7e5230eacc6ca7b535d416cd2dd846fa9fbc58951ef4cbdb14108afcbcd63f2d8a7b082920d04dc51b9eb47a6d44eeb5a07d704b14e71b6a972d96ca79f807d6 WHIRLPOOL 1645f5ccf29272d2cb97c86dbd638021d452051e167231807bbf5ecc75f9c059230e3009ff1adc3224694901a392104ad0418b591ce474ef03b96866d247b7af
28 AUX catalyst-2.0.18-stage1-export-ROOT.patch 1274 SHA256 bfd9470df1b53c0313731c22d740a4f0ce613326037144808cf37e2c3c280690 SHA512 6372917d395d8129c49c4dd8de7e6a8e7797f6c535e39713fa68059d82f398aa1fb0ffb1b6a65c91f9b5a4861f29cffd4717b7a612276e78d22ac1985ee32113 WHIRLPOOL b3f4b7678ff196ee00e65961894b19ec58868c2e769bc573ab4cb0570fbbbbebb7b5ca0b5f2e3534bc4582db872e4da4f49d9d98fc9d82c473a627194bd63c0b
29 DIST catalyst-2.0.18.tar.bz2 861398 SHA256 f3c2583fb8da425a9c57d3a00aac559e6bfde5951f1c7ef30ddf4fa00d6bedbd SHA512 5a1408ffe06ce5c06a6bca8f0e3ecd91c17cdc36e2dfa37881d843432bdfe987fd2cfd988cd5719bdf378c18c2e79ee59e281c3b4dba4ae9edfc2dd654b8ee4a WHIRLPOOL 73abb541bd9984e26e43dbeee3156ca84104aedfe16a027b97790274aaffa8678a29677da4ada908fe9c2184268eb9c266a8961a5e0681fccc463c47a6d83542
30 -EBUILD catalyst-2.0.18-r4.ebuild 3297 SHA256 5dba6296b5cb985f89946b1575d9e2ce07fda0820ee47ce346abecbbbfcd14ac SHA512 e397fb7205d4bf4823b5d328fb9059aa37ed8ad97deb2fa0fd7a7b1cafe694daa2f9f5705ff1a83905101b9679755b875a79063039a63743f6ef2e96dce4efea WHIRLPOOL f78adcfbac9738183d489c2f59992fce333b77f98b46e757731342660454de1bb342b3483a096d820601ea5e8cdba5093cb1872ecbbd3e3f4426102e1e8f6218
31 +EBUILD catalyst-2.0.18-r4.ebuild 3958 SHA256 6041422e3dfe0a210ad4ab10404965af161c79f7f58937fffb95508c9c32e076 SHA512 11ac663fd9fba8222ac1450ad693f32d4dd51f26a4ff5154b60a4461b80a25953c77d0e52c9fec55b191096fa159e7919a59edaa39b62d5fec8a8f4e63f16cdc WHIRLPOOL 0bbad9897ef184195549bdafc93182e3ec547fb99a25de9b16dfe24b50a3066b87b569d9ee5c7272b3c74703e90f0d1deddc0fad71395179587778a54bcedb5c
32 MISC metadata.xml 417 SHA256 7368ace310e6ad01b264004c144e7c690f0f3106c851514190df206122ceb357 SHA512 ba623747ea22b2e886740d771dcd80ac54df9b29762d1d1f3eb46701e9463d245a2e310eb03695dc9342a57da486a9a8d56892da709727476a2d6afed5e63cb8 WHIRLPOOL 32a9aa02498e87b255aab36b0195bec07d95ecc9cb10eb3f5eb8393cc3a5910263ef2e4cb507924a29b822845b5ccc54af25ac5e226e3900bdc379d72e1d2cc6
33
34 diff --git a/dev-util/catalyst/catalyst-2.0.18-r4.ebuild b/dev-util/catalyst/catalyst-2.0.18-r4.ebuild
35 index 45b66c3..08d2610 100644
36 --- a/dev-util/catalyst/catalyst-2.0.18-r4.ebuild
37 +++ b/dev-util/catalyst/catalyst-2.0.18-r4.ebuild
38 @@ -14,7 +14,7 @@ else
39 https://dev.gentoo.org/~mattst88/distfiles/${P}.tar.bz2
40 https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.bz2
41 https://dev.gentoo.org/~dolsen/releases/catalyst/${P}.tar.bz2"
42 - KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd"
43 + KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd"
44 fi
45
46 PYTHON_COMPAT=( python2_7 )
47 @@ -26,7 +26,7 @@ HOMEPAGE="https://wiki.gentoo.org/wiki/Catalyst"
48
49 LICENSE="GPL-2"
50 SLOT="0"
51 -IUSE="ccache kernel_linux"
52 +IUSE="ccache kernel_linux kernel_FreeBSD"
53
54 DEPEND="
55 app-text/asciidoc
56 @@ -35,13 +35,12 @@ DEPEND="
57 RDEPEND="
58 app-arch/lbzip2
59 app-crypt/shash
60 - app-arch/tar[xattr]
61 virtual/cdrtools
62 amd64? ( >=sys-boot/syslinux-3.72 )
63 ia64? ( sys-fs/dosfstools )
64 x86? ( >=sys-boot/syslinux-3.72 )
65 ccache? ( dev-util/ccache )
66 - kernel_linux? ( app-misc/zisofs-tools >=sys-fs/squashfs-tools-2.1 )
67 + kernel_linux? ( app-arch/tar[xattr] app-misc/zisofs-tools >=sys-fs/squashfs-tools-2.1 )
68 ${PYTHON_DEPS}
69 "
70
71 @@ -52,6 +51,9 @@ PATCHES=(
72 "${FILESDIR}/catalyst-2.0.18-fix-quotes.patch"
73 "${FILESDIR}/catalyst-2.0.18-remove-machine-id.patch"
74 "${FILESDIR}/catalyst-2.0.18-stage1-export-ROOT.patch"
75 + "${FILESDIR}/catalyst-2.0.18-fbsd-add-tmpfs-support.patch"
76 + "${FILESDIR}/catalyst-2.0.18-fbsd-fix-linux32.patch"
77 + "${FILESDIR}/catalyst-2.0.18-fbsd-fix-sed.patch"
78 )
79
80 pkg_setup() {
81 @@ -75,6 +77,17 @@ pkg_setup() {
82
83 src_prepare() {
84 epatch "${PATCHES[@]}"
85 +
86 + if use kernel_FreeBSD ; then
87 + # FreeBSD's tar doesn't support the --xattrs and -I lbzip2 options.
88 + sed -i 's:--xattrs::g' "${S}"/modules/catalyst_support.py
89 + sed -i 's:tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux:tar:g' \
90 + "${S}"/modules/generic_stage_target.py
91 + for f in modules/catalyst_support.py modules/generic_stage_target.py modules/snapshot_target.py
92 + do
93 + sed -i 's:-I lbzip2:-j:g' "${S}/${f}"
94 + done
95 + fi
96 }
97
98 src_install() {
99
100 diff --git a/dev-util/catalyst/files/catalyst-2.0.18-fbsd-add-tmpfs-support.patch b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-add-tmpfs-support.patch
101 new file mode 100644
102 index 0000000..dee3183
103 --- /dev/null
104 +++ b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-add-tmpfs-support.patch
105 @@ -0,0 +1,48 @@
106 +https://bugs.gentoo.org/show_bug.cgi?id=363577
107 +
108 +diff --git a/catalyst-2.0.18/modules/generic_stage_target.py b/catalyst-2.0.18/modules/generic_stage_target.py
109 +index cc24c63..75101e7 100644
110 +--- a/catalyst-2.0.18/modules/generic_stage_target.py
111 ++++ b/catalyst-2.0.18/modules/generic_stage_target.py
112 +@@ -911,25 +911,26 @@ class generic_stage_target(generic_target):
113 + src=self.mountmap[x]
114 + if "SNAPCACHE" in self.settings and x == "/usr/portage":
115 + self.snapshot_lock_object.read_lock()
116 +- if os.uname()[0] == "FreeBSD":
117 +- if src == "/dev":
118 +- retval=os.system("mount -t devfs none "+\
119 +- self.settings["chroot_path"]+x)
120 +- else:
121 +- retval=os.system("mount_nullfs "+src+" "+\
122 ++ if src == "tmpfs":
123 ++ if "var_tmpfs_portage" in self.settings:
124 ++ retval=os.system("mount -t tmpfs -o size="+\
125 ++ self.settings["var_tmpfs_portage"]+"G "+src+" "+\
126 + self.settings["chroot_path"]+x)
127 + else:
128 +- if src == "tmpfs":
129 +- if "var_tmpfs_portage" in self.settings:
130 +- retval=os.system("mount -t tmpfs -o size="+\
131 +- self.settings["var_tmpfs_portage"]+"G "+src+" "+\
132 ++ if os.uname()[0] == "FreeBSD":
133 ++ if src == "/dev":
134 ++ retval=os.system("mount -t devfs none "+\
135 ++ self.settings["chroot_path"]+x)
136 ++ else:
137 ++ retval=os.system("mount_nullfs "+src+" "+\
138 + self.settings["chroot_path"]+x)
139 +- elif src == "shmfs":
140 +- retval=os.system("mount -t tmpfs -o noexec,nosuid,nodev shm "+\
141 +- self.settings["chroot_path"]+x)
142 + else:
143 +- retval=os.system("mount --bind "+src+" "+\
144 +- self.settings["chroot_path"]+x)
145 ++ if src == "shmfs":
146 ++ retval=os.system("mount -t tmpfs -o noexec,nosuid,nodev shm "+\
147 ++ self.settings["chroot_path"]+x)
148 ++ else:
149 ++ retval=os.system("mount --bind "+src+" "+\
150 ++ self.settings["chroot_path"]+x)
151 + if retval!=0:
152 + self.unbind()
153 + raise CatalystError,"Couldn't bind mount "+src
154
155 diff --git a/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-linux32.patch b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-linux32.patch
156 new file mode 100644
157 index 0000000..8a394f2
158 --- /dev/null
159 +++ b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-linux32.patch
160 @@ -0,0 +1,22 @@
161 +https://bugs.gentoo.org/show_bug.cgi?id=363577
162 +
163 +diff --git a/catalyst-2.0.18/arch/x86.py b/catalyst-2.0.18/arch/x86.py
164 +index 0391b79..2b67dba 100644
165 +--- a/catalyst-2.0.18/arch/x86.py
166 ++++ b/catalyst-2.0.18/arch/x86.py
167 +@@ -7,9 +7,12 @@ class generic_x86(builder.generic):
168 + def __init__(self,myspec):
169 + builder.generic.__init__(self,myspec)
170 + if self.settings["buildarch"]=="amd64":
171 +- if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"):
172 +- raise CatalystError,"required executable linux32 not found (\"emerge setarch\" to fix.)"
173 +- self.settings["CHROOT"]="linux32 chroot"
174 ++ if os.uname()[0] == "Linux":
175 ++ if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"):
176 ++ raise CatalystError,"required executable linux32 not found (\"emerge setarch\" to fix.)"
177 ++ self.settings["CHROOT"]="linux32 chroot"
178 ++ else:
179 ++ self.settings["CHROOT"]="chroot"
180 + self.settings["crosscompile"] = False;
181 + else:
182 + self.settings["CHROOT"]="chroot"
183
184 diff --git a/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch
185 new file mode 100644
186 index 0000000..33e5325
187 --- /dev/null
188 +++ b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch
189 @@ -0,0 +1,52 @@
190 +https://bugs.gentoo.org/show_bug.cgi?id=363577
191 +
192 +diff --git a/catalyst-2.0.18/modules/generic_stage_target.py b/catalyst-2.0.18/modules/generic_stage_target.py
193 +index cc24c63..ad8138d 100644
194 +--- a/catalyst-2.0.18/modules/generic_stage_target.py
195 ++++ b/catalyst-2.0.18/modules/generic_stage_target.py
196 +@@ -1124,11 +1124,17 @@ class generic_stage_target(generic_target):
197 + self.settings["chroot_path"]+"/etc/hosts",\
198 + "Could not replace /etc/hosts",env=self.env)
199 +
200 ++ """ GNU sed should be used on Gentoo/FreeBSD """
201 ++ if os.uname()[0] == "FreeBSD":
202 ++ self.settings["sed"]="gsed"
203 ++ else:
204 ++ self.settings["sed"]="sed"
205 ++
206 + """ Remove our overlay """
207 + if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
208 + cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
209 + "Could not remove /usr/local/portage",env=self.env)
210 +- cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
211 ++ cmd(self.settings["sed"]+" -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
212 + "/etc/portage/make.conf",\
213 + "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
214 +
215 +diff --git a/catalyst-2.0.18/targets/support/chroot-functions.sh b/catalyst-2.0.18/targets/support/chroot-functions.sh
216 +index 67874a0..983a3a7 100755
217 +--- a/catalyst-2.0.18/targets/support/chroot-functions.sh
218 ++++ b/catalyst-2.0.18/targets/support/chroot-functions.sh
219 +@@ -422,5 +422,22 @@ Comment=This is a link to the local copy of the Gentoo Linux Handbook.
220 + Icon=text-editor" > /usr/share/applications/gentoo-handbook.desktop
221 + }
222 +
223 ++# GNU sed wrapper
224 ++sed(){
225 ++ if [ -e /usr/bin/gsed ]
226 ++ then
227 ++ /usr/bin/gsed "$@"
228 ++ elif [ -e /bin/sed ]
229 ++ then
230 ++ /bin/sed "$@"
231 ++ elif [ -e /usr/bin/sed ]
232 ++ then
233 ++ /usr/bin/sed "$@"
234 ++ else
235 ++ echo "ERROR: Failed to select sed."
236 ++ exit 1
237 ++ fi
238 ++}
239 ++
240 + # We do this everywhere, so why not put it in this script
241 + run_default_funcs