Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs/files/, sys-fs/zfs/
Date: Wed, 07 Oct 2020 00:00:34
Message-Id: 1602028641.7446901e6d95c269957690ad0ded4a901bb2174f.gyakovlev@gentoo
1 commit: 7446901e6d95c269957690ad0ded4a901bb2174f
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 6 23:55:12 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 6 23:57:21 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7446901e
7
8 sys-fs/zfs: drop old rc
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.1
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 sys-fs/zfs/Manifest | 1 -
14 .../files/2.0.0_rc2-exports-d-permissions.patch | 189 -----------------
15 sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild | 232 ---------------------
16 3 files changed, 422 deletions(-)
17
18 diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
19 index e722910db54..238f7e1e23d 100644
20 --- a/sys-fs/zfs/Manifest
21 +++ b/sys-fs/zfs/Manifest
22 @@ -1,4 +1,3 @@
23 DIST zfs-0.8.4.tar.gz 9285838 BLAKE2B 776bcd6dfab8825c07d315085e288b29bf543d6957325d5d566b7b78c04505dde9bd25eb6684cb4a1b6a657de8a4e1290d04d2b9079d26d6b834a70f1ec3b569 SHA512 9086dc6a6262dd93ca6ec43f1b4c2e5c804deba708c8a7460b8531aa4802b0bf8cac0917a1a00e6af2e96d4a21cd68b85e226bf571bd94041d0325c457106eb1
24 DIST zfs-0.8.5.tar.gz 9196381 BLAKE2B 8376f360369c4657ff1fc040fb2bba780bbd5d6a98d149d2fa4ba39478588e213dbf6db218c7bd970839f015a69ae00ac951b90afc1c26b34aadf666b2976cab SHA512 3e6e70b76f7cc5b018adb78ce7c3009f88faf5b3da0a03170b03577cd84a2937b6056621c41fc819fd08bf59b28053caf8fec375cf375816a6786bb5646ed773
25 -DIST zfs-2.0.0-rc2.tar.gz 12854085 BLAKE2B 73cabd565c11eef1bebbc391f8c4ba18acd1610f98f1b8afb507bc844f4b6a64ba32d9727e634c7f26c48fe365a841bf071513df234b9b7a87e954610a6d7f3b SHA512 14b17d06124890efef15b3b073e103c9faeecaea761779fff9a8420e3ab72fa611df9875fa766a323d69646e9025f8b19f918ded4c6705af116cf9f14eea4f40
26 DIST zfs-2.0.0-rc3.tar.gz 12860212 BLAKE2B bd29ceb17938180ffda9a26cfee97f4b9b42752cd7a3bf5d72705d94967d219889cc84a71d4c0f59aaf718d596011ecdbf07000788aa39a424087eb7cf62a944 SHA512 c09bebb1d1b19079b51305eea1b3d1a428a46bf1301afc9dfa20871ac670d94dc9f7f9127384b2db501fd909f22a16fad0c1b7383eb9ce31a7c0e696e66a097f
27
28 diff --git a/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch b/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch
29 deleted file mode 100644
30 index 4acaf465a7b..00000000000
31 --- a/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch
32 +++ /dev/null
33 @@ -1,189 +0,0 @@
34 -From fe413a4d901a243d98cfef16ea330f7114a104ea Mon Sep 17 00:00:00 2001
35 -From: George Wilson <george.wilson@×××××××.com>
36 -Date: Tue, 15 Sep 2020 22:57:16 -0400
37 -Subject: [PATCH] zpool command complains about /etc/exports.d
38 -
39 -If the /etc/exports.d directory does not exist, then we should only
40 -create it when we're performing an action which already requires root
41 -privileges.
42 -
43 -This commit moves the directory creation to the enable/disable code
44 -path which ensures that we have the appropriate privileges.
45 -
46 -Signed-off-by: George Wilson <gwilson@×××××××.com>
47 -Closes #10785
48 ----
49 - lib/libshare/os/freebsd/nfs.c | 36 +++++++++++-------
50 - lib/libshare/os/linux/nfs.c | 71 ++++++++++++++++++++---------------
51 - 2 files changed, 64 insertions(+), 43 deletions(-)
52 -
53 -diff --git a/lib/libshare/os/freebsd/nfs.c b/lib/libshare/os/freebsd/nfs.c
54 -index 65f3b11bf9b..5951b9eafa2 100644
55 ---- a/lib/libshare/os/freebsd/nfs.c
56 -+++ b/lib/libshare/os/freebsd/nfs.c
57 -@@ -228,21 +228,33 @@ nfs_copy_entries(char *filename, const char *mountpoint)
58 - int error = SA_OK;
59 - char *line;
60 -
61 -- /*
62 -- * If the file doesn't exist then there is nothing more
63 -- * we need to do.
64 -- */
65 - FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r");
66 -- if (oldfp == NULL)
67 -- return (SA_OK);
68 --
69 - FILE *newfp = fopen(filename, "w+");
70 -+ if (newfp == NULL) {
71 -+ fprintf(stderr, "failed to open %s file: %s", filename,
72 -+ strerror(errno));
73 -+ fclose(oldfp);
74 -+ return (SA_SYSTEM_ERR);
75 -+ }
76 - fputs(FILE_HEADER, newfp);
77 -- while ((line = zgetline(oldfp, mountpoint)) != NULL)
78 -- fprintf(newfp, "%s\n", line);
79 -- if (ferror(oldfp) != 0) {
80 -- error = ferror(oldfp);
81 -+
82 -+ /*
83 -+ * The ZFS_EXPORTS_FILE may not exist yet. If that's the
84 -+ * case then just write out the new file.
85 -+ */
86 -+ if (oldfp != NULL) {
87 -+ while ((line = zgetline(oldfp, mountpoint)) != NULL)
88 -+ fprintf(newfp, "%s\n", line);
89 -+ if (ferror(oldfp) != 0) {
90 -+ error = ferror(oldfp);
91 -+ }
92 -+ if (fclose(oldfp) != 0) {
93 -+ fprintf(stderr, "Unable to close file %s: %s\n",
94 -+ filename, strerror(errno));
95 -+ error = error != 0 ? error : SA_SYSTEM_ERR;
96 -+ }
97 - }
98 -+
99 - if (error == 0 && ferror(newfp) != 0) {
100 - error = ferror(newfp);
101 - }
102 -@@ -252,8 +264,6 @@ nfs_copy_entries(char *filename, const char *mountpoint)
103 - filename, strerror(errno));
104 - error = error != 0 ? error : SA_SYSTEM_ERR;
105 - }
106 -- fclose(oldfp);
107 --
108 - return (error);
109 - }
110 -
111 -diff --git a/lib/libshare/os/linux/nfs.c b/lib/libshare/os/linux/nfs.c
112 -index a6a9b33d765..1efa321b7bc 100644
113 ---- a/lib/libshare/os/linux/nfs.c
114 -+++ b/lib/libshare/os/linux/nfs.c
115 -@@ -393,6 +393,14 @@ static char *
116 - nfs_init_tmpfile(void)
117 - {
118 - char *tmpfile = NULL;
119 -+ struct stat sb;
120 -+
121 -+ if (stat(ZFS_EXPORTS_DIR, &sb) < 0 &&
122 -+ mkdir(ZFS_EXPORTS_DIR, 0755) < 0) {
123 -+ fprintf(stderr, "failed to create %s: %s\n",
124 -+ ZFS_EXPORTS_DIR, strerror(errno));
125 -+ return (NULL);
126 -+ }
127 -
128 - if (asprintf(&tmpfile, "%s%s", ZFS_EXPORTS_FILE, ".XXXXXXXX") == -1) {
129 - fprintf(stderr, "Unable to allocate temporary file\n");
130 -@@ -481,36 +489,49 @@ nfs_copy_entries(char *filename, const char *mountpoint)
131 - size_t buflen = 0;
132 - int error = SA_OK;
133 -
134 -- /*
135 -- * If the file doesn't exist then there is nothing more
136 -- * we need to do.
137 -- */
138 - FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r");
139 -- if (oldfp == NULL)
140 -- return (SA_OK);
141 --
142 - FILE *newfp = fopen(filename, "w+");
143 -+ if (newfp == NULL) {
144 -+ fprintf(stderr, "failed to open %s file: %s", filename,
145 -+ strerror(errno));
146 -+ fclose(oldfp);
147 -+ return (SA_SYSTEM_ERR);
148 -+ }
149 - fputs(FILE_HEADER, newfp);
150 -- while ((getline(&buf, &buflen, oldfp)) != -1) {
151 -- char *space = NULL;
152 -
153 -- if (buf[0] == '\n' || buf[0] == '#')
154 -- continue;
155 --
156 -- if ((space = strchr(buf, ' ')) != NULL) {
157 -- int mountpoint_len = strlen(mountpoint);
158 -+ /*
159 -+ * The ZFS_EXPORTS_FILE may not exist yet. If that's the
160 -+ * case then just write out the new file.
161 -+ */
162 -+ if (oldfp != NULL) {
163 -+ while (getline(&buf, &buflen, oldfp) != -1) {
164 -+ char *space = NULL;
165 -
166 -- if (space - buf == mountpoint_len &&
167 -- strncmp(mountpoint, buf, mountpoint_len) == 0) {
168 -+ if (buf[0] == '\n' || buf[0] == '#')
169 - continue;
170 -+
171 -+ if ((space = strchr(buf, ' ')) != NULL) {
172 -+ int mountpoint_len = strlen(mountpoint);
173 -+
174 -+ if (space - buf == mountpoint_len &&
175 -+ strncmp(mountpoint, buf,
176 -+ mountpoint_len) == 0) {
177 -+ continue;
178 -+ }
179 - }
180 -+ fputs(buf, newfp);
181 - }
182 -- fputs(buf, newfp);
183 -- }
184 -
185 -- if (oldfp != NULL && ferror(oldfp) != 0) {
186 -- error = ferror(oldfp);
187 -+ if (ferror(oldfp) != 0) {
188 -+ error = ferror(oldfp);
189 -+ }
190 -+ if (fclose(oldfp) != 0) {
191 -+ fprintf(stderr, "Unable to close file %s: %s\n",
192 -+ filename, strerror(errno));
193 -+ error = error != 0 ? error : SA_SYSTEM_ERR;
194 -+ }
195 - }
196 -+
197 - if (error == 0 && ferror(newfp) != 0) {
198 - error = ferror(newfp);
199 - }
200 -@@ -521,8 +542,6 @@ nfs_copy_entries(char *filename, const char *mountpoint)
201 - filename, strerror(errno));
202 - error = error != 0 ? error : SA_SYSTEM_ERR;
203 - }
204 -- fclose(oldfp);
205 --
206 - return (error);
207 - }
208 -
209 -@@ -701,13 +720,5 @@ static const sa_share_ops_t nfs_shareops = {
210 - void
211 - libshare_nfs_init(void)
212 - {
213 -- struct stat sb;
214 --
215 - nfs_fstype = register_fstype("nfs", &nfs_shareops);
216 --
217 -- if (stat(ZFS_EXPORTS_DIR, &sb) < 0 &&
218 -- mkdir(ZFS_EXPORTS_DIR, 0755) < 0) {
219 -- fprintf(stderr, "failed to create %s: %s\n",
220 -- ZFS_EXPORTS_DIR, strerror(errno));
221 -- }
222 - }
223
224 diff --git a/sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild b/sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild
225 deleted file mode 100644
226 index 1f9d81f16e6..00000000000
227 --- a/sys-fs/zfs/zfs-2.0.0_rc2-r1.ebuild
228 +++ /dev/null
229 @@ -1,232 +0,0 @@
230 -# Copyright 1999-2020 Gentoo Authors
231 -# Distributed under the terms of the GNU General Public License v2
232 -
233 -EAPI=7
234 -
235 -DISTUTILS_OPTIONAL=1
236 -PYTHON_COMPAT=( python3_{6,7,8} )
237 -
238 -inherit autotools bash-completion-r1 distutils-r1 flag-o-matic linux-info pam systemd toolchain-funcs udev usr-ldscript
239 -
240 -DESCRIPTION="Userland utilities for ZFS Linux kernel module"
241 -HOMEPAGE="https://github.com/openzfs/zfs"
242 -
243 -if [[ ${PV} == "9999" ]] ; then
244 - inherit git-r3 linux-mod
245 - EGIT_REPO_URI="https://github.com/openzfs/zfs.git"
246 -else
247 - MY_P="${P/_rc/-rc}"
248 - SRC_URI="https://github.com/openzfs/${PN}/releases/download/${MY_P}/${MY_P}.tar.gz"
249 - KEYWORDS="~amd64 ~arm64 ~ppc64"
250 - S="${WORKDIR}/${P%_rc?}"
251 -fi
252 -
253 -LICENSE="BSD-2 CDDL MIT"
254 -SLOT="0"
255 -IUSE="custom-cflags debug kernel-builtin libressl minimal nls pam python +rootfs test-suite static-libs"
256 -
257 -DEPEND="
258 - net-libs/libtirpc[static-libs?]
259 - sys-apps/util-linux[static-libs?]
260 - sys-libs/zlib[static-libs(+)?]
261 - virtual/awk
262 - virtual/libudev[static-libs(-)?]
263 - libressl? ( dev-libs/libressl:0=[static-libs?] )
264 - !libressl? ( dev-libs/openssl:0=[static-libs?] )
265 - !minimal? ( ${PYTHON_DEPS} )
266 - pam? ( sys-libs/pam )
267 - python? (
268 - virtual/python-cffi[${PYTHON_USEDEP}]
269 - )
270 -"
271 -
272 -BDEPEND="virtual/awk
273 - virtual/pkgconfig
274 - nls? ( sys-devel/gettext )
275 - python? (
276 - dev-python/setuptools[${PYTHON_USEDEP}]
277 - )
278 -"
279 -
280 -RDEPEND="${DEPEND}
281 - !kernel-builtin? ( ~sys-fs/zfs-kmod-${PV} )
282 - !prefix? ( virtual/udev )
283 - sys-fs/udev-init-scripts
284 - rootfs? (
285 - app-arch/cpio
286 - app-misc/pax-utils
287 - !<sys-kernel/genkernel-3.5.1.1
288 - )
289 - test-suite? (
290 - sys-apps/kmod[tools]
291 - sys-apps/util-linux
292 - sys-devel/bc
293 - sys-block/parted
294 - sys-fs/lsscsi
295 - sys-fs/mdadm
296 - sys-process/procps
297 - )
298 -"
299 -
300 -REQUIRED_USE="
301 - !minimal? ( ${PYTHON_REQUIRED_USE} )
302 - python? ( !minimal )
303 - test-suite? ( !minimal )
304 -"
305 -
306 -RESTRICT="test"
307 -
308 -PATCHES=(
309 - "${FILESDIR}/bash-completion-sudo.patch"
310 - "${FILESDIR}/${PV}-exports-d-permissions.patch"
311 -)
312 -
313 -pkg_setup() {
314 - if use kernel_linux && use test-suite; then
315 - linux-info_pkg_setup
316 -
317 - if ! linux_config_exists; then
318 - ewarn "Cannot check the linux kernel configuration."
319 - else
320 - if use test-suite; then
321 - if linux_chkconfig_present BLK_DEV_LOOP; then
322 - eerror "The ZFS test suite requires loop device support enabled."
323 - eerror "Please enable it:"
324 - eerror " CONFIG_BLK_DEV_LOOP=y"
325 - eerror "in /usr/src/linux/.config or"
326 - eerror " Device Drivers --->"
327 - eerror " Block devices --->"
328 - eerror " [X] Loopback device support"
329 - fi
330 - fi
331 - fi
332 - fi
333 -}
334 -
335 -src_prepare() {
336 - default
337 -
338 - if [[ ${PV} == "9999" ]]; then
339 - eautoreconf
340 - else
341 - # Set revision number
342 - sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" META || die "Could not set Gentoo release"
343 - fi
344 -
345 - if use python; then
346 - pushd contrib/pyzfs >/dev/null || die
347 - distutils-r1_src_prepare
348 - popd >/dev/null || die
349 - fi
350 -
351 - # prevent errors showing up on zfs-mount stop, #647688
352 - # openrc will unmount all filesystems anyway.
353 - sed -i "/^ZFS_UNMOUNT=/ s/yes/no/" "etc/default/zfs.in" || die
354 -}
355 -
356 -src_configure() {
357 - use custom-cflags || strip-flags
358 - use minimal || python_setup
359 -
360 - local myconf=(
361 - --bindir="${EPREFIX}/bin"
362 - --enable-shared
363 - --enable-systemd
364 - --enable-sysvinit
365 - --localstatedir="${EPREFIX}/var"
366 - --sbindir="${EPREFIX}/sbin"
367 - --with-config=user
368 - --with-dracutdir="${EPREFIX}/usr/lib/dracut"
369 - --with-linux="${KV_DIR}"
370 - --with-linux-obj="${KV_OUT_DIR}"
371 - --with-udevdir="$(get_udevdir)"
372 - --with-pamconfigsdir="${EPREFIX}/unwanted_files"
373 - --with-pammoduledir="$(getpam_mod_dir)"
374 - --with-systemdunitdir="$(systemd_get_systemunitdir)"
375 - --with-systemdpresetdir="${EPREFIX}/lib/systemd/system-preset"
376 - --with-vendor=gentoo
377 - $(use_enable debug)
378 - $(use_enable nls)
379 - $(use_enable pam)
380 - $(use_enable python pyzfs)
381 - $(use_enable static-libs static)
382 - $(usex minimal --without-python --with-python="${EPYTHON}")
383 - )
384 -
385 - econf "${myconf[@]}"
386 -}
387 -
388 -src_compile() {
389 - default
390 - if use python; then
391 - pushd contrib/pyzfs >/dev/null || die
392 - distutils-r1_src_compile
393 - popd >/dev/null || die
394 - fi
395 -}
396 -
397 -src_install() {
398 - default
399 -
400 - gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
401 -
402 - use pam && { rm -rv "${ED}/unwanted_files" || die ; }
403 -
404 - use test-suite || { rm -r "${ED}/usr/share/zfs" || die ; }
405 -
406 - if ! use static-libs; then
407 - find "${ED}/" -name '*.la' -delete || die
408 - fi
409 -
410 - dobashcomp contrib/bash_completion.d/zfs
411 - bashcomp_alias zfs zpool
412 -
413 - # strip executable bit from conf.d file
414 - fperms 0644 /etc/conf.d/zfs
415 -
416 - if use python; then
417 - pushd contrib/pyzfs >/dev/null || die
418 - distutils-r1_src_install
419 - popd >/dev/null || die
420 - fi
421 -
422 - # enforce best available python implementation
423 - use minimal || python_fix_shebang "${ED}/bin"
424 -}
425 -
426 -pkg_postinst() {
427 - if use rootfs; then
428 - if ! has_version sys-kernel/genkernel && ! has_version sys-kernel/dracut; then
429 - elog "root on zfs requires initramfs to boot"
430 - elog "the following packages known to provide one and tested on regular basis:"
431 - elog " sys-kernel/dracut"
432 - elog " sys-kernel/genkernel"
433 - fi
434 - fi
435 -
436 - if ! use kernel-builtin && [[ ${PV} = "9999" ]]; then
437 - einfo "Adding ${P} to the module database to ensure that the"
438 - einfo "kernel modules and userland utilities stay in sync."
439 - update_moduledb
440 - fi
441 -
442 - if systemd_is_booted || has_version sys-apps/systemd; then
443 - einfo "Please refer to ${EROOT}/lib/systemd/system-preset/50-zfs.preset"
444 - einfo "for default zfs systemd service configuration"
445 - else
446 - [[ -e "${EROOT}/etc/runlevels/boot/zfs-import" ]] || \
447 - einfo "You should add zfs-import to the boot runlevel."
448 - [[ -e "${EROOT}/etc/runlevels/boot/zfs-mount" ]]|| \
449 - einfo "You should add zfs-mount to the boot runlevel."
450 - [[ -e "${EROOT}/etc/runlevels/default/zfs-share" ]] || \
451 - einfo "You should add zfs-share to the default runlevel."
452 - [[ -e "${EROOT}/etc/runlevels/default/zfs-zed" ]] || \
453 - einfo "You should add zfs-zed to the default runlevel."
454 - fi
455 -}
456 -
457 -pkg_postrm() {
458 - if ! use kernel-builtin && [[ ${PV} == "9999" ]]; then
459 - remove_moduledb
460 - fi
461 -}