mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-02 19:11:20 +02:00
Update util-linux to 2.37.2
This commit is contained in:
parent
6efc0de2bc
commit
faf115acde
@ -1,3 +1,3 @@
|
|||||||
DIST util-linux-2.32.tar.xz 4550128 BLAKE2B 0ce22bf93f98ac9827632094b2c3d50280da40394b910e483bf697c8751d532fea7006195baeef0dbc14708edd1204db8e2c87b22bd9f799911c61144a531bb0 SHA512 320c8d364f014aba16483dd26564d7cb47804337567c3e9c2dc495f3865f524e7480d3fec7ef5a05b6e99763b0278da70fffe6d2b88f3f1a832ada5932556482
|
DIST util-linux-2.36.2.tar.xz 5348032 BLAKE2B 17e49515f8d0430f3ed26b80bf1d6e811d847141020d0dae1340dc92887549b7b711f3db6e3913120871fc912435def73586a7aef09d8d9cc6ff7ca331b2770f SHA512 6ab141f44ca4cb6b600081f10eae17e15d23abd122a37eb3ac6c845513a6a4396dc9dcff30b3032de80116ddde50e27dfbc86f92708c1051f84f0c919194664b
|
||||||
DIST util-linux-2.33.1.tar.xz 4650936 BLAKE2B 9ee6bc1a1b800e8537f5552c28cf608f32e89c8ab716434a2de6b4b5e257c53065b9c11cd355f2ef759f69069071ef930790ecd55806deef300ce77f31e38e98 SHA512 94ada47e472b62a612c26fd5a5b7423e09366690a8a96f777191a5d920981eb0f224474bc2f128e827299bf60062770011332757e1551a8cd3764b5c70ae4ba2
|
DIST util-linux-2.37.1.tar.xz 5628360 BLAKE2B 309ea7202f32c0ec750cb01486cf32c3e9dd457d83e5beab8d6b97a5e7f312332ecfcd1ddbb88ae5ec9ee483bb15452b8d58bce1f931f9dfa35be3ce042da3da SHA512 ec300c830869e10a0d7f8c0b99e9bb46e0b88fc51f3c6c6a4d9752a89f035e8d69d81f25fd103ef8d7d253e81440695ef3f5d72dccc94815ec8d5f6f949f7555
|
||||||
DIST util-linux-2.33.tar.xz 4663072 BLAKE2B df601f6aa6dd1e77c722d5e7350a3b14c6099057487384eb8cd7adee8693711c1d24663f76682c958884559fddf61cc4b6d987bdca70f88e6cb14109e328e8a9 SHA512 5eb419607c5a2634117a604d425d6413763d1e48910acabc7e19d574a4c3fb0ceb34a68671a8e4fe396a4c6d611932082f77cd669d009e218bf64095da0d5689
|
DIST util-linux-2.37.2.tar.xz 5621624 BLAKE2B 40ab80485781dfc58e6d0e98dae115b96f11ee0cc370524e1e13d3c4a4dfed3a5a4a248311f8ca645f6f84bbaf4785412ca8282b840af4e37a01312764885abe SHA512 38f0fe820445e3bfa79550e6581c230f98c7661566ccc4daa51c7208a5f972c61b4e57dfc86bed074fdbc7c40bc79f856be8f6a05a8860c1c0cecc4208e8b81d
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
From 3188ea9a9292604e537f06f11adddf474fc9e52d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Mon, 9 Apr 2018 12:11:36 +0200
|
|
||||||
Subject: [PATCH] build: Add missing -lintl linkage to lib{smartcols,uuid}
|
|
||||||
|
|
||||||
Addresses: https://github.com/karelzak/util-linux/pull/615
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
libsmartcols/src/Makemodule.am | 2 +-
|
|
||||||
libuuid/src/Makemodule.am | 2 +-
|
|
||||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libsmartcols/src/Makemodule.am b/libsmartcols/src/Makemodule.am
|
|
||||||
index 664aca30b..665b2aa7f 100644
|
|
||||||
--- a/libsmartcols/src/Makemodule.am
|
|
||||||
+++ b/libsmartcols/src/Makemodule.am
|
|
||||||
@@ -19,7 +19,7 @@ libsmartcols_la_SOURCES= \
|
|
||||||
libsmartcols/src/version.c \
|
|
||||||
libsmartcols/src/init.c
|
|
||||||
|
|
||||||
-libsmartcols_la_LIBADD = libcommon.la
|
|
||||||
+libsmartcols_la_LIBADD = $(LDADD) libcommon.la
|
|
||||||
|
|
||||||
libsmartcols_la_CFLAGS = \
|
|
||||||
$(AM_CFLAGS) \
|
|
||||||
diff --git a/libuuid/src/Makemodule.am b/libuuid/src/Makemodule.am
|
|
||||||
index 5122622a5..e58fa261c 100644
|
|
||||||
--- a/libuuid/src/Makemodule.am
|
|
||||||
+++ b/libuuid/src/Makemodule.am
|
|
||||||
@@ -31,7 +31,7 @@ libuuid_la_SOURCES = \
|
|
||||||
EXTRA_libuuid_la_DEPENDENCIES = \
|
|
||||||
libuuid/src/libuuid.sym
|
|
||||||
|
|
||||||
-libuuid_la_LIBADD = $(SOCKET_LIBS)
|
|
||||||
+libuuid_la_LIBADD = $(LDADD) $(SOCKET_LIBS)
|
|
||||||
|
|
||||||
libuuid_la_CFLAGS = \
|
|
||||||
$(AM_CFLAGS) \
|
|
@ -1,105 +0,0 @@
|
|||||||
From 8a12ab57755afc36546834f175ef0b9e9376ba59 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Frank Schaefer <kelledin@gmail.com>
|
|
||||||
Date: Tue, 10 Jul 2018 20:21:02 -0500
|
|
||||||
Subject: [PATCH] * break up large strings for PySys_WriteStdout()
|
|
||||||
|
|
||||||
---
|
|
||||||
libmount/python/fs.c | 56 ++++++++++++++++++++++++++++++++++++++++------------
|
|
||||||
1 file changed, 43 insertions(+), 13 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libmount/python/fs.c b/libmount/python/fs.c
|
|
||||||
index d6490d248..634a914ef 100644
|
|
||||||
--- a/libmount/python/fs.c
|
|
||||||
+++ b/libmount/python/fs.c
|
|
||||||
@@ -63,32 +63,62 @@ static PyObject *Fs_get_devno(FsObject *self)
|
|
||||||
return PyObjectResultInt(mnt_fs_get_devno(self->fs));
|
|
||||||
}
|
|
||||||
|
|
||||||
+static void _dump_debug_string(const char *lead, const char *s, char quote)
|
|
||||||
+{
|
|
||||||
+ /* PySys_WriteStdout() will automatically truncate any '%s' token
|
|
||||||
+ * longer than a certain length (documented as 1000 bytes, but we
|
|
||||||
+ * give ourselves some margin here just in case). The only way I
|
|
||||||
+ * know to get around this is to print such strings in bite-sized
|
|
||||||
+ * chunks.
|
|
||||||
+ */
|
|
||||||
+ static const unsigned int _PY_MAX_LEN = 900;
|
|
||||||
+ static const char *_PY_MAX_LEN_FMT = "%.900s";
|
|
||||||
+ unsigned int len;
|
|
||||||
+
|
|
||||||
+ if (lead != NULL)
|
|
||||||
+ PySys_WriteStdout("%s", lead);
|
|
||||||
+
|
|
||||||
+ if (quote != 0)
|
|
||||||
+ PySys_WriteStdout("%c", quote);
|
|
||||||
+
|
|
||||||
+ for (len = strlen(s); len > _PY_MAX_LEN; len -= _PY_MAX_LEN, s += _PY_MAX_LEN)
|
|
||||||
+ PySys_WriteStdout(_PY_MAX_LEN_FMT, s);
|
|
||||||
+
|
|
||||||
+ if (len > 0)
|
|
||||||
+ PySys_WriteStdout(_PY_MAX_LEN_FMT, s);
|
|
||||||
+
|
|
||||||
+ if (quote != 0)
|
|
||||||
+ PySys_WriteStdout("%c\n", quote);
|
|
||||||
+ else
|
|
||||||
+ PySys_WriteStdout("\n");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#define Fs_print_debug_HELP "print_debug()\n\n"
|
|
||||||
static PyObject *Fs_print_debug(FsObject *self)
|
|
||||||
{
|
|
||||||
PySys_WriteStdout("------ fs: %p\n", self->fs);
|
|
||||||
- PySys_WriteStdout("source: %s\n", mnt_fs_get_source(self->fs));
|
|
||||||
- PySys_WriteStdout("target: %s\n", mnt_fs_get_target(self->fs));
|
|
||||||
- PySys_WriteStdout("fstype: %s\n", mnt_fs_get_fstype(self->fs));
|
|
||||||
+ _dump_debug_string("source: ", mnt_fs_get_source(self->fs), 0);
|
|
||||||
+ _dump_debug_string("target: ", mnt_fs_get_target(self->fs), 0);
|
|
||||||
+ _dump_debug_string("fstype: ", mnt_fs_get_fstype(self->fs), 0);
|
|
||||||
|
|
||||||
if (mnt_fs_get_options(self->fs))
|
|
||||||
- PySys_WriteStdout("optstr: %s\n", mnt_fs_get_options(self->fs));
|
|
||||||
+ _dump_debug_string("optstr: ", mnt_fs_get_options(self->fs), 0);
|
|
||||||
if (mnt_fs_get_vfs_options(self->fs))
|
|
||||||
- PySys_WriteStdout("VFS-optstr: %s\n", mnt_fs_get_vfs_options(self->fs));
|
|
||||||
+ _dump_debug_string("VFS-optstr: ", mnt_fs_get_vfs_options(self->fs), 0);
|
|
||||||
if (mnt_fs_get_fs_options(self->fs))
|
|
||||||
- PySys_WriteStdout("FS-opstr: %s\n", mnt_fs_get_fs_options(self->fs));
|
|
||||||
+ _dump_debug_string("FS-opstr: ", mnt_fs_get_fs_options(self->fs), 0);
|
|
||||||
if (mnt_fs_get_user_options(self->fs))
|
|
||||||
- PySys_WriteStdout("user-optstr: %s\n", mnt_fs_get_user_options(self->fs));
|
|
||||||
+ _dump_debug_string("user-optstr: ", mnt_fs_get_user_options(self->fs), 0);
|
|
||||||
if (mnt_fs_get_optional_fields(self->fs))
|
|
||||||
- PySys_WriteStdout("optional-fields: '%s'\n", mnt_fs_get_optional_fields(self->fs));
|
|
||||||
+ _dump_debug_string("optional-fields: ", mnt_fs_get_optional_fields(self->fs), '\'');
|
|
||||||
if (mnt_fs_get_attributes(self->fs))
|
|
||||||
- PySys_WriteStdout("attributes: %s\n", mnt_fs_get_attributes(self->fs));
|
|
||||||
+ _dump_debug_string("attributes: ", mnt_fs_get_attributes(self->fs), 0);
|
|
||||||
|
|
||||||
if (mnt_fs_get_root(self->fs))
|
|
||||||
- PySys_WriteStdout("root: %s\n", mnt_fs_get_root(self->fs));
|
|
||||||
+ _dump_debug_string("root: ", mnt_fs_get_root(self->fs), 0);
|
|
||||||
|
|
||||||
if (mnt_fs_get_swaptype(self->fs))
|
|
||||||
- PySys_WriteStdout("swaptype: %s\n", mnt_fs_get_swaptype(self->fs));
|
|
||||||
+ _dump_debug_string("swaptype: ", mnt_fs_get_swaptype(self->fs), 0);
|
|
||||||
if (mnt_fs_get_size(self->fs))
|
|
||||||
PySys_WriteStdout("size: %jd\n", mnt_fs_get_size(self->fs));
|
|
||||||
if (mnt_fs_get_usedsize(self->fs))
|
|
||||||
@@ -97,7 +127,7 @@ static PyObject *Fs_print_debug(FsObject *self)
|
|
||||||
PySys_WriteStdout("priority: %d\n", mnt_fs_get_priority(self->fs));
|
|
||||||
|
|
||||||
if (mnt_fs_get_bindsrc(self->fs))
|
|
||||||
- PySys_WriteStdout("bindsrc: %s\n", mnt_fs_get_bindsrc(self->fs));
|
|
||||||
+ _dump_debug_string("bindsrc: ", mnt_fs_get_bindsrc(self->fs), 0);
|
|
||||||
if (mnt_fs_get_freq(self->fs))
|
|
||||||
PySys_WriteStdout("freq: %d\n", mnt_fs_get_freq(self->fs));
|
|
||||||
if (mnt_fs_get_passno(self->fs))
|
|
||||||
@@ -112,7 +142,7 @@ static PyObject *Fs_print_debug(FsObject *self)
|
|
||||||
if (mnt_fs_get_tid(self->fs))
|
|
||||||
PySys_WriteStdout("tid: %d\n", mnt_fs_get_tid(self->fs));
|
|
||||||
if (mnt_fs_get_comment(self->fs))
|
|
||||||
- PySys_WriteStdout("comment: '%s'\n", mnt_fs_get_comment(self->fs));
|
|
||||||
+ _dump_debug_string("comment: ", mnt_fs_get_comment(self->fs), '\'');
|
|
||||||
return UL_IncRef(self);
|
|
||||||
}
|
|
||||||
/*
|
|
@ -1,41 +0,0 @@
|
|||||||
From 8f93c8c71d264e90bdcecf98c9ac372bbcdc53aa Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thomas Deutschmann <whissi@gentoo.org>
|
|
||||||
Date: Sun, 11 Nov 2018 02:17:55 +0100
|
|
||||||
Subject: [PATCH] tests: run oids test only when uuidgen tool was built
|
|
||||||
|
|
||||||
oids test did not check if uuidgen was available.
|
|
||||||
|
|
||||||
oids test was also calling uuidgen from PATH which could result
|
|
||||||
in wrong results if uuidgen from a previous util-linux installation
|
|
||||||
was used.
|
|
||||||
|
|
||||||
With this commit we will check if uuidgen was built and make sure
|
|
||||||
that we only call the uuidgen binary we just built. If uuidgen is
|
|
||||||
not available we will skip this test.
|
|
||||||
---
|
|
||||||
tests/ts/uuid/oids | 10 ++++++----
|
|
||||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tests/ts/uuid/oids b/tests/ts/uuid/oids
|
|
||||||
index 3b005c5b2..77e010c1d 100755
|
|
||||||
--- a/tests/ts/uuid/oids
|
|
||||||
+++ b/tests/ts/uuid/oids
|
|
||||||
@@ -20,12 +20,14 @@ ts_init "$*"
|
|
||||||
|
|
||||||
: . > $TS_OUTPUT
|
|
||||||
|
|
||||||
-uuidgen --md5 --namespace @dns --name "www.widgets.com" >> $TS_OUTPUT
|
|
||||||
+ts_check_test_command "$TS_CMD_UUIDGEN"
|
|
||||||
|
|
||||||
-uuidgen --md5 --namespace @dns --name "www.example.com" >> $TS_OUTPUT
|
|
||||||
+$TS_CMD_UUIDGEN --md5 --namespace @dns --name "www.widgets.com" >> $TS_OUTPUT
|
|
||||||
|
|
||||||
-uuidgen --sha1 --namespace @dns --name "www.example.com" >> $TS_OUTPUT
|
|
||||||
+$TS_CMD_UUIDGEN --md5 --namespace @dns --name "www.example.com" >> $TS_OUTPUT
|
|
||||||
|
|
||||||
-uuidgen --sha1 --namespace @oid --hex --name "525400fc0f5e" >> $TS_OUTPUT
|
|
||||||
+$TS_CMD_UUIDGEN --sha1 --namespace @dns --name "www.example.com" >> $TS_OUTPUT
|
|
||||||
+
|
|
||||||
+$TS_CMD_UUIDGEN --sha1 --namespace @oid --hex --name "525400fc0f5e" >> $TS_OUTPUT
|
|
||||||
|
|
||||||
ts_finalize
|
|
@ -1,80 +0,0 @@
|
|||||||
From 3fa06e049012218d883d0e1251df86bafbc446bf Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Thu, 22 Nov 2018 11:03:35 +0100
|
|
||||||
Subject: [PATCH] setarch: fix obscure sparc32bash use-case
|
|
||||||
|
|
||||||
Reported-by: Carlos Santos <casantos@datacom.com.br>
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
sys-utils/setarch.c | 28 ++++++++++++++++++----------
|
|
||||||
1 file changed, 18 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
|
|
||||||
index a733f7b3c..7c0a63fbb 100644
|
|
||||||
--- a/sys-utils/setarch.c
|
|
||||||
+++ b/sys-utils/setarch.c
|
|
||||||
@@ -268,6 +268,7 @@ int main(int argc, char *argv[])
|
|
||||||
int c;
|
|
||||||
struct arch_domain *doms, *target;
|
|
||||||
unsigned long pers_value = 0;
|
|
||||||
+ char *shell = NULL, *shell_arg = NULL;
|
|
||||||
|
|
||||||
/* Options without equivalent short options */
|
|
||||||
enum {
|
|
||||||
@@ -310,14 +311,14 @@ int main(int argc, char *argv[])
|
|
||||||
archwrapper = strcmp(program_invocation_short_name, "setarch") != 0;
|
|
||||||
if (archwrapper) {
|
|
||||||
arch = program_invocation_short_name; /* symlinks to setarch */
|
|
||||||
-#if defined(__sparc64__) || defined(__sparc__)
|
|
||||||
+
|
|
||||||
+ /* Don't use ifdef sparc here, we get "Unrecognized architecture"
|
|
||||||
+ * error message later if necessary */
|
|
||||||
if (strcmp(arch, "sparc32bash") == 0) {
|
|
||||||
- if (set_arch(arch, 0L, 0))
|
|
||||||
- err(EXIT_FAILURE, _("Failed to set personality to %s"), arch);
|
|
||||||
- execl("/bin/bash", "", NULL);
|
|
||||||
- errexec("/bin/bash");
|
|
||||||
+ shell = "/bin/bash";
|
|
||||||
+ shell_arg = "";
|
|
||||||
+ goto set_arch;
|
|
||||||
}
|
|
||||||
-#endif
|
|
||||||
} else {
|
|
||||||
if (1 < argc && *argv[1] != '-') {
|
|
||||||
arch = argv[1];
|
|
||||||
@@ -391,6 +392,7 @@ int main(int argc, char *argv[])
|
|
||||||
argc -= optind;
|
|
||||||
argv += optind;
|
|
||||||
|
|
||||||
+set_arch:
|
|
||||||
/* get execution domain (architecture) */
|
|
||||||
if (arch) {
|
|
||||||
doms = init_arch_domains();
|
|
||||||
@@ -422,17 +424,23 @@ int main(int argc, char *argv[])
|
|
||||||
if (arch)
|
|
||||||
verify_arch_domain(target, arch);
|
|
||||||
|
|
||||||
+ if (!argc) {
|
|
||||||
+ shell = "/bin/sh";
|
|
||||||
+ shell_arg = "-sh";
|
|
||||||
+ }
|
|
||||||
if (verbose) {
|
|
||||||
- printf(_("Execute command `%s'.\n"), argc ? argv[0] : "/bin/sh");
|
|
||||||
+ printf(_("Execute command `%s'.\n"), shell ? shell : argv[0]);
|
|
||||||
/* flush all output streams before exec */
|
|
||||||
fflush(NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (!argc) {
|
|
||||||
- execl("/bin/sh", "-sh", NULL);
|
|
||||||
- errexec("/bin/sh");
|
|
||||||
+ /* Execute shell */
|
|
||||||
+ if (shell) {
|
|
||||||
+ execl(shell, shell_arg, NULL);
|
|
||||||
+ errexec(shell);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* Execute on command line specified command */
|
|
||||||
execvp(argv[0], argv);
|
|
||||||
errexec(argv[0]);
|
|
||||||
}
|
|
@ -0,0 +1,50 @@
|
|||||||
|
From 6eb1c01e9dd25a73100f06db37190c63fd57d4d9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Karel Zak <kzak@redhat.com>
|
||||||
|
Date: Fri, 30 Jul 2021 11:50:46 +0200
|
||||||
|
Subject: [PATCH] agetty: use CTRL+C to erase username
|
||||||
|
|
||||||
|
aggety(8) from the beginning ignores ^C (the small exception was
|
||||||
|
between 2.32 and 2.34 when this char has been misinterpreted).
|
||||||
|
|
||||||
|
This patch forces agetty to interpret ^C like ^U, it means to
|
||||||
|
erase the user's input and wait for a completely new username.
|
||||||
|
The small difference is that for ^C it does not set 'kill character'.
|
||||||
|
|
||||||
|
This change does not affect serial lines where ^C is still ignored like
|
||||||
|
in previous decades. I'd like to avoid any regression as I have
|
||||||
|
no clue if any serial lines do not send this control char in some
|
||||||
|
context ...
|
||||||
|
|
||||||
|
Fixes: https://github.com/karelzak/util-linux/issues/1399
|
||||||
|
References: https://github.com/karelzak/util-linux/issues/1046
|
||||||
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||||
|
---
|
||||||
|
term-utils/agetty.c | 8 +++++---
|
||||||
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
|
||||||
|
index 3b3d5101a..d072d64d3 100644
|
||||||
|
--- a/term-utils/agetty.c
|
||||||
|
+++ b/term-utils/agetty.c
|
||||||
|
@@ -2267,6 +2267,11 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
|
||||||
|
break;
|
||||||
|
case CTL('U'):
|
||||||
|
cp->kill = ascval; /* set kill character */
|
||||||
|
+ /* fallthrough */
|
||||||
|
+ case CTL('C'):
|
||||||
|
+ if (key == CTL('C') && !(op->flags & F_VCONSOLE))
|
||||||
|
+ /* Ignore CTRL+C on serial line */
|
||||||
|
+ break;
|
||||||
|
while (bp > logname) {
|
||||||
|
if ((tp->c_lflag & ECHO) == 0)
|
||||||
|
write_all(1, erase[cp->parity], 3);
|
||||||
|
@@ -2275,9 +2280,6 @@ static char *get_logname(struct issue *ie, struct options *op, struct termios *t
|
||||||
|
break;
|
||||||
|
case CTL('D'):
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
- case CTL('C'):
|
||||||
|
- /* Ignore */
|
||||||
|
- break;
|
||||||
|
default:
|
||||||
|
if ((size_t)(bp - logname) >= sizeof(logname) - 1)
|
||||||
|
log_err(_("%s: input overrun"), op->tty);
|
@ -0,0 +1,25 @@
|
|||||||
|
From 86d5de52d43501711586054e7b601fbc57403085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Karel Zak <kzak@redhat.com>
|
||||||
|
Date: Tue, 27 Jul 2021 11:58:31 +0200
|
||||||
|
Subject: [PATCH] sys-utils/ipcutils: be careful when call calloc() for uint64
|
||||||
|
nmembs
|
||||||
|
|
||||||
|
Fix: https://github.com/karelzak/util-linux/issues/1395
|
||||||
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||||
|
---
|
||||||
|
sys-utils/ipcutils.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/sys-utils/ipcutils.c b/sys-utils/ipcutils.c
|
||||||
|
index e784c4dcb9..18868cfd38 100644
|
||||||
|
--- a/sys-utils/ipcutils.c
|
||||||
|
+++ b/sys-utils/ipcutils.c
|
||||||
|
@@ -218,7 +218,7 @@ static void get_sem_elements(struct sem_data *p)
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
- if (!p || !p->sem_nsems || p->sem_perm.id < 0)
|
||||||
|
+ if (!p || !p->sem_nsems || p->sem_nsems > SIZE_MAX || p->sem_perm.id < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
p->elements = xcalloc(p->sem_nsems, sizeof(struct sem_elem));
|
@ -0,0 +1,38 @@
|
|||||||
|
From 420e914c4cc4c2ba34fd75790ea194d7f4a47d2c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Karel Zak <kzak@redhat.com>
|
||||||
|
Date: Thu, 29 Jul 2021 11:50:48 +0200
|
||||||
|
Subject: [PATCH] libmount: fix setgroups() use
|
||||||
|
|
||||||
|
* keep process in single supplementary group, which is the real group ID for the process
|
||||||
|
|
||||||
|
* make sure we have rights to call setgroups(), requires group permissions
|
||||||
|
|
||||||
|
Fixes: https://github.com/karelzak/util-linux/issues/1398
|
||||||
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||||
|
---
|
||||||
|
include/c.h | 6 ++++--
|
||||||
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/include/c.h b/include/c.h
|
||||||
|
index c1e4c5ffc..a4504e3ba 100644
|
||||||
|
--- a/include/c.h
|
||||||
|
+++ b/include/c.h
|
||||||
|
@@ -340,14 +340,16 @@ static inline size_t get_hostname_max(void)
|
||||||
|
|
||||||
|
static inline int drop_permissions(void)
|
||||||
|
{
|
||||||
|
+ gid_t newgid = getgid();
|
||||||
|
+
|
||||||
|
errno = 0;
|
||||||
|
|
||||||
|
/* drop supplementary groups */
|
||||||
|
- if (setgroups(0, NULL) != 0)
|
||||||
|
+ if (geteuid() == 0 && setgroups(1, &newgid) != 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
/* drop GID */
|
||||||
|
- if (setgid(getgid()) < 0)
|
||||||
|
+ if (setgid(newgid) < 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
|
/* drop UID */
|
@ -0,0 +1,50 @@
|
|||||||
|
From 0d7cef3ddbd2aacbea8c11e8524a3de68dfb8ff6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Karel Zak <kzak@redhat.com>
|
||||||
|
Date: Fri, 30 Jul 2021 14:35:25 +0200
|
||||||
|
Subject: [PATCH] lscpu: fix NULL dereference
|
||||||
|
|
||||||
|
Fixes: https://github.com/karelzak/util-linux/issues/1401
|
||||||
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||||
|
---
|
||||||
|
sys-utils/lscpu-cputype.c | 2 +-
|
||||||
|
sys-utils/lscpu.c | 6 +++---
|
||||||
|
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sys-utils/lscpu-cputype.c b/sys-utils/lscpu-cputype.c
|
||||||
|
index 795a4acf5..be16199e0 100644
|
||||||
|
--- a/sys-utils/lscpu-cputype.c
|
||||||
|
+++ b/sys-utils/lscpu-cputype.c
|
||||||
|
@@ -569,7 +569,7 @@ int lscpu_read_cpuinfo(struct lscpu_cxt *cxt)
|
||||||
|
/* Set the default type to CPUs which are missing (or not parsed)
|
||||||
|
* in cpuinfo */
|
||||||
|
ct = lscpu_cputype_get_default(cxt);
|
||||||
|
- for (i = 0; i < cxt->npossibles; i++) {
|
||||||
|
+ for (i = 0; ct && i < cxt->npossibles; i++) {
|
||||||
|
struct lscpu_cpu *cpu = cxt->cpus[i];
|
||||||
|
|
||||||
|
if (cpu && !cpu->type)
|
||||||
|
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
|
||||||
|
index 827e84a6d..e11b2f42f 100644
|
||||||
|
--- a/sys-utils/lscpu.c
|
||||||
|
+++ b/sys-utils/lscpu.c
|
||||||
|
@@ -991,7 +991,7 @@ static void print_summary(struct lscpu_cxt *cxt)
|
||||||
|
*(p - 2) = '\0';
|
||||||
|
add_summary_s(tb, sec, _("CPU op-mode(s):"), buf);
|
||||||
|
}
|
||||||
|
- if (ct->addrsz)
|
||||||
|
+ if (ct && ct->addrsz)
|
||||||
|
add_summary_s(tb, sec, _("Address sizes:"), ct->addrsz);
|
||||||
|
#if !defined(WORDS_BIGENDIAN)
|
||||||
|
add_summary_s(tb, sec, _("Byte Order:"), "Little Endian");
|
||||||
|
@@ -1033,9 +1033,9 @@ static void print_summary(struct lscpu_cxt *cxt)
|
||||||
|
sec = NULL;
|
||||||
|
|
||||||
|
/* Section: cpu type description */
|
||||||
|
- if (ct->vendor)
|
||||||
|
+ if (ct && ct->vendor)
|
||||||
|
sec = add_summary_s(tb, NULL, _("Vendor ID:"), ct->vendor);
|
||||||
|
- if (ct->bios_vendor)
|
||||||
|
+ if (ct && ct->bios_vendor)
|
||||||
|
add_summary_s(tb, sec, _("BIOS Vendor ID:"), ct->bios_vendor);
|
||||||
|
|
||||||
|
for (i = 0; i < cxt->ncputypes; i++)
|
@ -0,0 +1,37 @@
|
|||||||
|
https://github.com/karelzak/util-linux/commit/597ccb7bf564f65bb059bfe420224cab0fba46ac.patch
|
||||||
|
|
||||||
|
From 597ccb7bf564f65bb059bfe420224cab0fba46ac Mon Sep 17 00:00:00 2001
|
||||||
|
From: Chris Hofstaedtler <zeha@debian.org>
|
||||||
|
Date: Fri, 20 Aug 2021 10:30:50 +0000
|
||||||
|
Subject: [PATCH] tests: Skip lsns/ioctl_ns test if unshare fails
|
||||||
|
|
||||||
|
Some parts of the Debian build infrastructure uses unshare to run the
|
||||||
|
package build, and that appears to cause a "nested" unshare in the
|
||||||
|
lsns/ioctl_ns test to fail. Unfortunately the tests then hang at this
|
||||||
|
point.
|
||||||
|
|
||||||
|
Try running unshare before the actual test, and skip the test if unshare
|
||||||
|
already fails.
|
||||||
|
|
||||||
|
[kzak@redhat.com: - add --fork to the test
|
||||||
|
- don't write to stdout/err]
|
||||||
|
|
||||||
|
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
|
||||||
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
||||||
|
---
|
||||||
|
tests/ts/lsns/ioctl_ns | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/tests/ts/lsns/ioctl_ns b/tests/ts/lsns/ioctl_ns
|
||||||
|
index ef6360607..fa626bfda 100755
|
||||||
|
--- a/tests/ts/lsns/ioctl_ns
|
||||||
|
+++ b/tests/ts/lsns/ioctl_ns
|
||||||
|
@@ -34,6 +34,8 @@ ts_check_prog "mkfifo"
|
||||||
|
ts_check_prog "touch"
|
||||||
|
ts_check_prog "uniq"
|
||||||
|
|
||||||
|
+$TS_CMD_UNSHARE --user --pid --mount-proc --fork true &> /dev/null || ts_skip "no namespace support"
|
||||||
|
+
|
||||||
|
ts_cd "$TS_OUTDIR"
|
||||||
|
|
||||||
|
# The parent process receives namespaces ids via FIFO_DATA from bash
|
@ -1,16 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
|
||||||
<pkgmetadata>
|
<pkgmetadata>
|
||||||
<maintainer type="project">
|
<maintainer type="project">
|
||||||
<email>base-system@gentoo.org</email>
|
<email>base-system@gentoo.org</email>
|
||||||
<name>Gentoo Base System</name>
|
<name>Gentoo Base System</name>
|
||||||
</maintainer>
|
</maintainer>
|
||||||
<use>
|
<use>
|
||||||
|
<flag name="audit">Use <pkg>sys-process/audit</pkg> to emit audit messages about system changes</flag>
|
||||||
<flag name="caps">build setpriv helper (run programs with diff capabilities)</flag>
|
<flag name="caps">build setpriv helper (run programs with diff capabilities)</flag>
|
||||||
<flag name="cramfs">build mkfs/fsck helpers for cramfs filesystems</flag>
|
<flag name="cramfs">build mkfs/fsck helpers for cramfs filesystems</flag>
|
||||||
|
<flag name="cryptsetup">Use <pkg>sys-fs/cryptsetup</pkg> to have built-in dm-verity in libmount</flag>
|
||||||
<flag name="fdformat">build fdformat (floppy disk format)</flag>
|
<flag name="fdformat">build fdformat (floppy disk format)</flag>
|
||||||
|
<flag name="hardlink">build hardlink program</flag>
|
||||||
<flag name="kill">build the kill program</flag>
|
<flag name="kill">build the kill program</flag>
|
||||||
|
<flag name="logger">build the logger program</flag>
|
||||||
<flag name="pam">build runuser helper</flag>
|
<flag name="pam">build runuser helper</flag>
|
||||||
|
<flag name="su">build the su program</flag>
|
||||||
<flag name="suid">
|
<flag name="suid">
|
||||||
install mount/umount as setuid so non-root users may mount/umount devices,
|
install mount/umount as setuid so non-root users may mount/umount devices,
|
||||||
and wall/write as setgid so non-root users can notify other users
|
and wall/write as setgid so non-root users can notify other users
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
# Copyright 1999-2019 Gentoo Authors and others
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Copyright 2018 Sony Interactive Entertainment Inc.
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=6
|
EAPI=7
|
||||||
|
|
||||||
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
|
PYTHON_COMPAT=( python3_{7,8,9} )
|
||||||
|
|
||||||
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 \
|
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 usr-ldscript \
|
||||||
pam python-r1 multilib-minimal multiprocessing systemd
|
pam python-r1 multilib-minimal multiprocessing systemd
|
||||||
|
|
||||||
MY_PV="${PV/_/-}"
|
MY_PV="${PV/_/-}"
|
||||||
@ -17,57 +16,68 @@ if [[ ${PV} == 9999 ]] ; then
|
|||||||
EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
|
EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
|
||||||
else
|
else
|
||||||
[[ "${PV}" = *_rc* ]] || \
|
[[ "${PV}" = *_rc* ]] || \
|
||||||
KEYWORDS="~alpha amd64 ~arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESCRIPTION="Various useful Linux utilities"
|
DESCRIPTION="Various useful Linux utilities"
|
||||||
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
|
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
|
||||||
|
|
||||||
LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
|
LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="build caps +cramfs fdformat kill ncurses nls pam python +readline selinux slang static-libs +suid systemd test tty-helpers udev unicode userland_GNU"
|
IUSE="audit build caps +cramfs cryptsetup fdformat hardlink kill +logger magic ncurses nls pam python +readline selinux slang static-libs su +suid systemd test tty-helpers udev unicode userland_GNU"
|
||||||
|
|
||||||
# Most lib deps here are related to programs rather than our libs,
|
# Most lib deps here are related to programs rather than our libs,
|
||||||
# so we rarely need to specify ${MULTILIB_USEDEP}.
|
# so we rarely need to specify ${MULTILIB_USEDEP}.
|
||||||
RDEPEND="caps? ( sys-libs/libcap-ng )
|
RDEPEND="
|
||||||
|
virtual/libcrypt:=
|
||||||
|
audit? ( >=sys-process/audit-2.6:= )
|
||||||
|
caps? ( sys-libs/libcap-ng )
|
||||||
cramfs? ( sys-libs/zlib:= )
|
cramfs? ( sys-libs/zlib:= )
|
||||||
ncurses? ( >=sys-libs/ncurses-5.2-r2:0=[unicode?] )
|
cryptsetup? ( >=sys-fs/cryptsetup-2.1.0 )
|
||||||
|
hardlink? ( dev-libs/libpcre2:= )
|
||||||
|
ncurses? (
|
||||||
|
sys-libs/ncurses:=[unicode(+)?]
|
||||||
|
magic? ( sys-apps/file:0= )
|
||||||
|
)
|
||||||
nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
|
nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
|
||||||
pam? ( sys-libs/pam )
|
pam? ( sys-libs/pam )
|
||||||
|
ppc? ( sys-libs/librtas )
|
||||||
|
ppc64? ( sys-libs/librtas )
|
||||||
python? ( ${PYTHON_DEPS} )
|
python? ( ${PYTHON_DEPS} )
|
||||||
readline? ( sys-libs/readline:0= )
|
readline? ( sys-libs/readline:0= )
|
||||||
selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
|
selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
|
||||||
slang? ( sys-libs/slang )
|
slang? ( sys-libs/slang )
|
||||||
!build? ( systemd? ( sys-apps/systemd ) )
|
!build? ( systemd? ( sys-apps/systemd ) )
|
||||||
udev? ( virtual/libudev:= )"
|
udev? ( virtual/libudev:= )"
|
||||||
DEPEND="${RDEPEND}
|
BDEPEND="
|
||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
nls? ( sys-devel/gettext )
|
nls? ( sys-devel/gettext )
|
||||||
test? ( sys-devel/bc )
|
test? ( sys-devel/bc )
|
||||||
virtual/os-headers"
|
"
|
||||||
|
DEPEND="
|
||||||
|
${RDEPEND}
|
||||||
|
virtual/os-headers
|
||||||
|
"
|
||||||
RDEPEND+="
|
RDEPEND+="
|
||||||
|
hardlink? ( !app-arch/hardlink )
|
||||||
|
logger? ( !>=app-admin/sysklogd-2.0[logger] )
|
||||||
kill? (
|
kill? (
|
||||||
!sys-apps/coreutils[kill]
|
!sys-apps/coreutils[kill]
|
||||||
!sys-process/procps[kill]
|
!sys-process/procps[kill]
|
||||||
)
|
)
|
||||||
|
su? (
|
||||||
|
!<sys-apps/shadow-4.7-r2
|
||||||
|
!>=sys-apps/shadow-4.7-r2[su]
|
||||||
|
)
|
||||||
!net-wireless/rfkill
|
!net-wireless/rfkill
|
||||||
!sys-process/schedutils
|
|
||||||
!sys-apps/setarch
|
|
||||||
!<sys-apps/sysvinit-2.88-r7
|
|
||||||
!<sys-libs/e2fsprogs-libs-1.41.8
|
|
||||||
!<sys-fs/e2fsprogs-1.41.8
|
|
||||||
!<app-shells/bash-completion-2.7-r1"
|
!<app-shells/bash-completion-2.7-r1"
|
||||||
|
|
||||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||||
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
S="${WORKDIR}/${MY_P}"
|
S="${WORKDIR}/${MY_P}"
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}/util-linux-2.32.1-skip-oids-test-when-uuidgen-is-not-available.patch"
|
|
||||||
"${FILESDIR}/${P}-sparc-setarch.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
|
|
||||||
@ -88,12 +98,6 @@ src_prepare() {
|
|||||||
eautoreconf
|
eautoreconf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Undo bad ncurses handling by upstream. #601530
|
|
||||||
sed -i -E \
|
|
||||||
-e '/NCURSES_/s:(ncursesw?)[56]-config:$PKG_CONFIG \1:' \
|
|
||||||
-e 's:(ncursesw?)[56]-config --version:$PKG_CONFIG --exists --print-errors \1:' \
|
|
||||||
configure || die
|
|
||||||
|
|
||||||
elibtoolize
|
elibtoolize
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,6 +116,7 @@ lfs_fallocate_test() {
|
|||||||
|
|
||||||
python_configure() {
|
python_configure() {
|
||||||
local myeconfargs=(
|
local myeconfargs=(
|
||||||
|
"${commonargs[@]}"
|
||||||
--disable-all-programs
|
--disable-all-programs
|
||||||
--disable-bash-completion
|
--disable-bash-completion
|
||||||
--without-systemdsystemunitdir
|
--without-systemdsystemunitdir
|
||||||
@ -139,8 +144,17 @@ multilib_src_configure() {
|
|||||||
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
|
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
|
||||||
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
|
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
|
||||||
|
|
||||||
local myeconfargs=(
|
# Undo bad ncurses handling by upstream. Fall back to pkg-config. #601530
|
||||||
|
export NCURSES6_CONFIG=false NCURSES5_CONFIG=false
|
||||||
|
export NCURSESW6_CONFIG=false NCURSESW5_CONFIG=false
|
||||||
|
|
||||||
|
# configure args shared by python and non-python builds
|
||||||
|
local commonargs=(
|
||||||
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
||||||
|
)
|
||||||
|
|
||||||
|
local myeconfargs=(
|
||||||
|
"${commonargs[@]}"
|
||||||
--with-bashcompletiondir="$(get_bashcompdir)"
|
--with-bashcompletiondir="$(get_bashcompdir)"
|
||||||
--without-python
|
--without-python
|
||||||
$(multilib_native_use_enable suid makeinstall-chown)
|
$(multilib_native_use_enable suid makeinstall-chown)
|
||||||
@ -149,14 +163,16 @@ multilib_src_configure() {
|
|||||||
$(multilib_native_use_with slang)
|
$(multilib_native_use_with slang)
|
||||||
$(multilib_native_use_with systemd)
|
$(multilib_native_use_with systemd)
|
||||||
$(multilib_native_use_with udev)
|
$(multilib_native_use_with udev)
|
||||||
|
$(multilib_native_usex ncurses "$(use_with magic libmagic)" '--without-libmagic')
|
||||||
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
||||||
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
||||||
|
$(multilib_native_use_with audit)
|
||||||
$(tc-has-tls || echo --disable-tls)
|
$(tc-has-tls || echo --disable-tls)
|
||||||
$(use_enable nls)
|
$(use_enable nls)
|
||||||
$(use_enable unicode widechar)
|
$(use_enable unicode widechar)
|
||||||
$(use_enable static-libs static)
|
$(use_enable static-libs static)
|
||||||
$(use_with selinux)
|
|
||||||
$(use_with ncurses tinfo)
|
$(use_with ncurses tinfo)
|
||||||
|
$(use_with selinux)
|
||||||
)
|
)
|
||||||
# build programs only on GNU, on *BSD we want libraries only
|
# build programs only on GNU, on *BSD we want libraries only
|
||||||
if multilib_is_native_abi && use userland_GNU; then
|
if multilib_is_native_abi && use userland_GNU; then
|
||||||
@ -165,7 +181,6 @@ multilib_src_configure() {
|
|||||||
--disable-login
|
--disable-login
|
||||||
--disable-nologin
|
--disable-nologin
|
||||||
--disable-pylibmount
|
--disable-pylibmount
|
||||||
--disable-su
|
|
||||||
--enable-agetty
|
--enable-agetty
|
||||||
--enable-bash-completion
|
--enable-bash-completion
|
||||||
--enable-line
|
--enable-line
|
||||||
@ -178,10 +193,15 @@ multilib_src_configure() {
|
|||||||
$(use_enable caps setpriv)
|
$(use_enable caps setpriv)
|
||||||
$(use_enable cramfs)
|
$(use_enable cramfs)
|
||||||
$(use_enable fdformat)
|
$(use_enable fdformat)
|
||||||
|
$(use_enable hardlink)
|
||||||
|
$(use_enable kill)
|
||||||
|
$(use_enable logger)
|
||||||
|
$(use_enable ncurses pg)
|
||||||
|
$(use_enable su)
|
||||||
$(use_enable tty-helpers mesg)
|
$(use_enable tty-helpers mesg)
|
||||||
$(use_enable tty-helpers wall)
|
$(use_enable tty-helpers wall)
|
||||||
$(use_enable tty-helpers write)
|
$(use_enable tty-helpers write)
|
||||||
$(use_enable kill)
|
$(use_with cryptsetup)
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
@ -247,6 +267,7 @@ multilib_src_install() {
|
|||||||
python_foreach_impl python_install
|
python_foreach_impl python_install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# This needs to be called AFTER python_install call (#689190)
|
||||||
emake DESTDIR="${D}" install
|
emake DESTDIR="${D}" install
|
||||||
|
|
||||||
if multilib_is_native_abi && use userland_GNU; then
|
if multilib_is_native_abi && use userland_GNU; then
|
||||||
@ -257,6 +278,7 @@ multilib_src_install() {
|
|||||||
|
|
||||||
multilib_src_install_all() {
|
multilib_src_install_all() {
|
||||||
dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
|
dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
|
||||||
|
chmod -x "${ED}"/usr/share/doc/util-linux-${PVR}/getopt/getopt-parse* || die
|
||||||
|
|
||||||
# e2fsprogs-libs didnt install .la files, and .pc work fine
|
# e2fsprogs-libs didnt install .la files, and .pc work fine
|
||||||
find "${ED}" -name "*.la" -delete || die
|
find "${ED}" -name "*.la" -delete || die
|
||||||
@ -264,7 +286,7 @@ multilib_src_install_all() {
|
|||||||
if ! use userland_GNU; then
|
if ! use userland_GNU; then
|
||||||
# manpage collisions
|
# manpage collisions
|
||||||
# TODO: figure out a good way to keep them
|
# TODO: figure out a good way to keep them
|
||||||
rm "${ED%/}"/usr/share/man/man3/uuid* || die
|
rm "${ED}"/usr/share/man/man3/uuid* || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if use pam; then
|
if use pam; then
|
@ -1,12 +1,12 @@
|
|||||||
# Copyright 1999-2018 Gentoo Foundation
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=6
|
EAPI=7
|
||||||
|
|
||||||
PYTHON_COMPAT=( python2_7 )
|
PYTHON_COMPAT=( python3_{7..9} )
|
||||||
|
|
||||||
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 \
|
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 usr-ldscript \
|
||||||
pam python-single-r1 multilib-minimal multiprocessing systemd
|
pam python-r1 multilib-minimal multiprocessing systemd
|
||||||
|
|
||||||
MY_PV="${PV/_/-}"
|
MY_PV="${PV/_/-}"
|
||||||
MY_P="${PN}-${MY_PV}"
|
MY_P="${PN}-${MY_PV}"
|
||||||
@ -16,69 +16,92 @@ if [[ ${PV} == 9999 ]] ; then
|
|||||||
EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
|
EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
|
||||||
else
|
else
|
||||||
[[ "${PV}" = *_rc* ]] || \
|
[[ "${PV}" = *_rc* ]] || \
|
||||||
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESCRIPTION="Various useful Linux utilities"
|
DESCRIPTION="Various useful Linux utilities"
|
||||||
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
|
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
|
||||||
|
|
||||||
LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
|
LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="build caps +cramfs fdformat kill ncurses nls pam python +readline selinux slang static-libs +suid systemd test tty-helpers udev unicode userland_GNU"
|
IUSE="audit build caps +cramfs cryptsetup fdformat hardlink kill +logger magic ncurses nls pam python +readline selinux slang static-libs su +suid systemd test tty-helpers udev unicode userland_GNU"
|
||||||
|
|
||||||
# Most lib deps here are related to programs rather than our libs,
|
# Most lib deps here are related to programs rather than our libs,
|
||||||
# so we rarely need to specify ${MULTILIB_USEDEP}.
|
# so we rarely need to specify ${MULTILIB_USEDEP}.
|
||||||
RDEPEND="caps? ( sys-libs/libcap-ng )
|
RDEPEND="
|
||||||
|
virtual/libcrypt:=
|
||||||
|
audit? ( >=sys-process/audit-2.6:= )
|
||||||
|
caps? ( sys-libs/libcap-ng )
|
||||||
cramfs? ( sys-libs/zlib:= )
|
cramfs? ( sys-libs/zlib:= )
|
||||||
ncurses? ( >=sys-libs/ncurses-5.2-r2:0=[unicode?] )
|
cryptsetup? ( >=sys-fs/cryptsetup-2.1.0 )
|
||||||
|
hardlink? ( dev-libs/libpcre2:= )
|
||||||
|
ncurses? (
|
||||||
|
sys-libs/ncurses:=[unicode(+)?]
|
||||||
|
magic? ( sys-apps/file:0= )
|
||||||
|
)
|
||||||
nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
|
nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
|
||||||
pam? ( sys-libs/pam )
|
pam? ( sys-libs/pam )
|
||||||
|
ppc? ( sys-libs/librtas )
|
||||||
|
ppc64? ( sys-libs/librtas )
|
||||||
python? ( ${PYTHON_DEPS} )
|
python? ( ${PYTHON_DEPS} )
|
||||||
readline? ( sys-libs/readline:0= )
|
readline? ( sys-libs/readline:0= )
|
||||||
selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
|
selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
|
||||||
slang? ( sys-libs/slang )
|
slang? ( sys-libs/slang )
|
||||||
!build? ( systemd? ( sys-apps/systemd ) )
|
!build? ( systemd? ( sys-apps/systemd ) )
|
||||||
udev? ( virtual/libudev:= )"
|
udev? ( virtual/libudev:= )"
|
||||||
DEPEND="${RDEPEND}
|
BDEPEND="
|
||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
nls? ( sys-devel/gettext )
|
nls? ( sys-devel/gettext )
|
||||||
test? ( sys-devel/bc )
|
test? ( sys-devel/bc )
|
||||||
virtual/os-headers"
|
"
|
||||||
|
DEPEND="
|
||||||
|
${RDEPEND}
|
||||||
|
virtual/os-headers
|
||||||
|
"
|
||||||
RDEPEND+="
|
RDEPEND+="
|
||||||
|
hardlink? ( !app-arch/hardlink )
|
||||||
|
logger? ( !>=app-admin/sysklogd-2.0[logger] )
|
||||||
kill? (
|
kill? (
|
||||||
!sys-apps/coreutils[kill]
|
!sys-apps/coreutils[kill]
|
||||||
!sys-process/procps[kill]
|
!sys-process/procps[kill]
|
||||||
)
|
)
|
||||||
|
su? (
|
||||||
|
!<sys-apps/shadow-4.7-r2
|
||||||
|
!>=sys-apps/shadow-4.7-r2[su]
|
||||||
|
)
|
||||||
!net-wireless/rfkill
|
!net-wireless/rfkill
|
||||||
!sys-process/schedutils
|
!<app-shells/bash-completion-2.7-r1
|
||||||
!sys-apps/setarch
|
"
|
||||||
!<sys-apps/sysvinit-2.88-r7
|
|
||||||
!<sys-libs/e2fsprogs-libs-1.41.8
|
# Required for man-page generation
|
||||||
!<sys-fs/e2fsprogs-1.41.8
|
if [[ "${PV}" == 9999 ]] ; then
|
||||||
!<app-shells/bash-completion-2.7-r1"
|
BDEPEND+="
|
||||||
|
dev-ruby/asciidoctor
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||||
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
S="${WORKDIR}/${MY_P}"
|
S="${WORKDIR}/${MY_P}"
|
||||||
|
|
||||||
pkg_setup() {
|
PATCHES=(
|
||||||
use python && python-single-r1_pkg_setup
|
"${FILESDIR}"/${PN}-2.37.1-ipcutils_calloc_check.patch #806070
|
||||||
}
|
"${FILESDIR}"/${PN}-2.37.1-libmount_setgroups_fix.patch #805218
|
||||||
|
"${FILESDIR}"/${PN}-2.37.1-agetty_ctrl-c_erase.patch #804972
|
||||||
|
"${FILESDIR}"/${PN}-2.37.1-lscpu_NULL_dereference_fix.patch #802606
|
||||||
|
)
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
|
|
||||||
eapply "${FILESDIR}"/${P}-add-missing-lintl.patch
|
|
||||||
touch -r "${S}"/configure "${S}"/libsmartcols/src/Makemodule.am || die
|
|
||||||
touch -r "${S}"/configure "${S}"/libuuid/src/Makemodule.am || die
|
|
||||||
|
|
||||||
# Prevent uuidd test failure due to socket path limit. #593304
|
# Prevent uuidd test failure due to socket path limit. #593304
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
|
-e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
|
||||||
tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
|
tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
|
||||||
|
|
||||||
if ! use userland_GNU; then
|
if ! use userland_GNU ; then
|
||||||
# test runner is using GNU-specific xargs call
|
# test runner is using GNU-specific xargs call
|
||||||
sed -i -e 's:xargs:gxargs:' tests/run.sh || die
|
sed -i -e 's:xargs:gxargs:' tests/run.sh || die
|
||||||
# test requires util-linux uuidgen (which we don't build)
|
# test requires util-linux uuidgen (which we don't build)
|
||||||
@ -90,12 +113,6 @@ src_prepare() {
|
|||||||
eautoreconf
|
eautoreconf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Undo bad ncurses handling by upstream. #601530
|
|
||||||
sed -i -E \
|
|
||||||
-e '/NCURSES_/s:(ncursesw?)[56]-config:$PKG_CONFIG \1:' \
|
|
||||||
-e 's:(ncursesw?)[56]-config --version:$PKG_CONFIG --exists --print-errors \1:' \
|
|
||||||
configure || die
|
|
||||||
|
|
||||||
elibtoolize
|
elibtoolize
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,6 +129,27 @@ lfs_fallocate_test() {
|
|||||||
rm -f "${T}"/fallocate.${ABI}.c
|
rm -f "${T}"/fallocate.${ABI}.c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
python_configure() {
|
||||||
|
local myeconfargs=(
|
||||||
|
"${commonargs[@]}"
|
||||||
|
--disable-all-programs
|
||||||
|
--disable-bash-completion
|
||||||
|
--without-systemdsystemunitdir
|
||||||
|
--with-python
|
||||||
|
)
|
||||||
|
if use userland_GNU ; then
|
||||||
|
myeconfargs+=(
|
||||||
|
--enable-libblkid
|
||||||
|
--enable-libmount
|
||||||
|
--enable-pylibmount
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
mkdir "${BUILD_DIR}" || die
|
||||||
|
pushd "${BUILD_DIR}" >/dev/null || die
|
||||||
|
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
||||||
|
popd >/dev/null || die
|
||||||
|
}
|
||||||
|
|
||||||
multilib_src_configure() {
|
multilib_src_configure() {
|
||||||
lfs_fallocate_test
|
lfs_fallocate_test
|
||||||
# The scanf test in a run-time test which fails while cross-compiling.
|
# The scanf test in a run-time test which fails while cross-compiling.
|
||||||
@ -121,32 +159,45 @@ multilib_src_configure() {
|
|||||||
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
|
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
|
||||||
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
|
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
|
||||||
|
|
||||||
local myeconfargs=(
|
# Undo bad ncurses handling by upstream. Fall back to pkg-config. #601530
|
||||||
|
export NCURSES6_CONFIG=false NCURSES5_CONFIG=false
|
||||||
|
export NCURSESW6_CONFIG=false NCURSESW5_CONFIG=false
|
||||||
|
|
||||||
|
# configure args shared by python and non-python builds
|
||||||
|
local commonargs=(
|
||||||
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
||||||
|
)
|
||||||
|
|
||||||
|
local myeconfargs=(
|
||||||
|
"${commonargs[@]}"
|
||||||
--with-bashcompletiondir="$(get_bashcompdir)"
|
--with-bashcompletiondir="$(get_bashcompdir)"
|
||||||
|
--without-python
|
||||||
$(multilib_native_use_enable suid makeinstall-chown)
|
$(multilib_native_use_enable suid makeinstall-chown)
|
||||||
$(multilib_native_use_enable suid makeinstall-setuid)
|
$(multilib_native_use_enable suid makeinstall-setuid)
|
||||||
$(multilib_native_use_with python)
|
|
||||||
$(multilib_native_use_with readline)
|
$(multilib_native_use_with readline)
|
||||||
$(multilib_native_use_with slang)
|
$(multilib_native_use_with slang)
|
||||||
$(multilib_native_use_with systemd)
|
$(multilib_native_use_with systemd)
|
||||||
$(multilib_native_use_with udev)
|
$(multilib_native_use_with udev)
|
||||||
|
$(multilib_native_usex ncurses "$(use_with magic libmagic)" '--without-libmagic')
|
||||||
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
||||||
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
||||||
|
$(multilib_native_use_with audit)
|
||||||
$(tc-has-tls || echo --disable-tls)
|
$(tc-has-tls || echo --disable-tls)
|
||||||
$(use_enable nls)
|
$(use_enable nls)
|
||||||
$(use_enable unicode widechar)
|
$(use_enable unicode widechar)
|
||||||
$(use_enable static-libs static)
|
$(use_enable static-libs static)
|
||||||
|
$(use_with ncurses tinfo)
|
||||||
$(use_with selinux)
|
$(use_with selinux)
|
||||||
$(usex ncurses '' '--without-tinfo')
|
|
||||||
)
|
)
|
||||||
# build programs only on GNU, on *BSD we want libraries only
|
# build programs only on GNU, on *BSD we want libraries only
|
||||||
if multilib_is_native_abi && use userland_GNU; then
|
if multilib_is_native_abi && use userland_GNU ; then
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--disable-chfn-chsh
|
--disable-chfn-chsh
|
||||||
--disable-login
|
--disable-login
|
||||||
|
--disable-newgrp
|
||||||
--disable-nologin
|
--disable-nologin
|
||||||
--disable-su
|
--disable-pylibmount
|
||||||
|
--disable-vipw
|
||||||
--enable-agetty
|
--enable-agetty
|
||||||
--enable-bash-completion
|
--enable-bash-completion
|
||||||
--enable-line
|
--enable-line
|
||||||
@ -159,14 +210,26 @@ multilib_src_configure() {
|
|||||||
$(use_enable caps setpriv)
|
$(use_enable caps setpriv)
|
||||||
$(use_enable cramfs)
|
$(use_enable cramfs)
|
||||||
$(use_enable fdformat)
|
$(use_enable fdformat)
|
||||||
|
$(use_enable hardlink)
|
||||||
|
$(use_enable kill)
|
||||||
|
$(use_enable logger)
|
||||||
|
$(use_enable ncurses pg)
|
||||||
|
$(use_enable su)
|
||||||
$(use_enable tty-helpers mesg)
|
$(use_enable tty-helpers mesg)
|
||||||
$(use_enable tty-helpers wall)
|
$(use_enable tty-helpers wall)
|
||||||
$(use_enable tty-helpers write)
|
$(use_enable tty-helpers write)
|
||||||
$(use_enable kill)
|
$(use_with cryptsetup)
|
||||||
)
|
)
|
||||||
|
if [[ ${PV} == *9999 ]] ; then
|
||||||
|
myeconfargs+=( --enable-asciidoc )
|
||||||
|
else
|
||||||
|
# Upstream is shipping pre-generated man-pages for releases
|
||||||
|
myeconfargs+=( --disable-asciidoc )
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--disable-all-programs
|
--disable-all-programs
|
||||||
|
--disable-asciidoc
|
||||||
--disable-bash-completion
|
--disable-bash-completion
|
||||||
--without-systemdsystemunitdir
|
--without-systemdsystemunitdir
|
||||||
# build libraries
|
# build libraries
|
||||||
@ -175,7 +238,7 @@ multilib_src_configure() {
|
|||||||
--enable-libsmartcols
|
--enable-libsmartcols
|
||||||
--enable-libfdisk
|
--enable-libfdisk
|
||||||
)
|
)
|
||||||
if use userland_GNU; then
|
if use userland_GNU ; then
|
||||||
# those libraries don't work on *BSD
|
# those libraries don't work on *BSD
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--enable-libmount
|
--enable-libmount
|
||||||
@ -183,20 +246,57 @@ multilib_src_configure() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
||||||
|
|
||||||
|
if multilib_is_native_abi && use python ; then
|
||||||
|
python_foreach_impl python_configure
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
python_compile() {
|
||||||
|
pushd "${BUILD_DIR}" >/dev/null || die
|
||||||
|
emake all
|
||||||
|
popd >/dev/null || die
|
||||||
|
}
|
||||||
|
|
||||||
|
multilib_src_compile() {
|
||||||
|
emake all
|
||||||
|
|
||||||
|
if multilib_is_native_abi && use python ; then
|
||||||
|
python_foreach_impl python_compile
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
python_test() {
|
||||||
|
pushd "${BUILD_DIR}" >/dev/null || die
|
||||||
|
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
||||||
|
popd >/dev/null || die
|
||||||
}
|
}
|
||||||
|
|
||||||
multilib_src_test() {
|
multilib_src_test() {
|
||||||
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
||||||
|
if multilib_is_native_abi && use python ; then
|
||||||
|
python_foreach_impl python_test
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
python_install() {
|
||||||
|
pushd "${BUILD_DIR}" >/dev/null || die
|
||||||
|
emake DESTDIR="${D}" install
|
||||||
|
python_optimize
|
||||||
|
popd >/dev/null || die
|
||||||
}
|
}
|
||||||
|
|
||||||
multilib_src_install() {
|
multilib_src_install() {
|
||||||
|
if multilib_is_native_abi && use python ; then
|
||||||
|
python_foreach_impl python_install
|
||||||
|
fi
|
||||||
|
|
||||||
|
# This needs to be called AFTER python_install call (#689190)
|
||||||
emake DESTDIR="${D}" install
|
emake DESTDIR="${D}" install
|
||||||
|
|
||||||
if multilib_is_native_abi && use userland_GNU; then
|
if multilib_is_native_abi && use userland_GNU ; then
|
||||||
# need the libs in /
|
# need the libs in /
|
||||||
gen_usr_ldscript -a blkid fdisk mount smartcols uuid
|
gen_usr_ldscript -a blkid fdisk mount smartcols uuid
|
||||||
|
|
||||||
use python && python_optimize
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,13 +306,13 @@ multilib_src_install_all() {
|
|||||||
# e2fsprogs-libs didnt install .la files, and .pc work fine
|
# e2fsprogs-libs didnt install .la files, and .pc work fine
|
||||||
find "${ED}" -name "*.la" -delete || die
|
find "${ED}" -name "*.la" -delete || die
|
||||||
|
|
||||||
if ! use userland_GNU; then
|
if ! use userland_GNU ; then
|
||||||
# manpage collisions
|
# manpage collisions
|
||||||
# TODO: figure out a good way to keep them
|
# TODO: figure out a good way to keep them
|
||||||
rm "${ED%/}"/usr/share/man/man3/uuid* || die
|
rm "${ED}"/usr/share/man/man3/uuid* || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if use pam; then
|
if use pam ; then
|
||||||
newpamd "${FILESDIR}/runuser.pamd" runuser
|
newpamd "${FILESDIR}/runuser.pamd" runuser
|
||||||
newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
|
newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
|
||||||
fi
|
fi
|
||||||
@ -227,11 +327,11 @@ multilib_src_install_all() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if ! use tty-helpers; then
|
if ! use tty-helpers ; then
|
||||||
elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
|
elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z ${REPLACING_VERSIONS} ]]; then
|
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||||||
elog "The agetty util now clears the terminal by default. You"
|
elog "The agetty util now clears the terminal by default. You"
|
||||||
elog "might want to add --noclear to your /etc/inittab lines."
|
elog "might want to add --noclear to your /etc/inittab lines."
|
||||||
fi
|
fi
|
@ -1,12 +1,11 @@
|
|||||||
# Copyright 1999-2019 Gentoo Authors and others
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Copyright 2018 Sony Interactive Entertainment Inc.
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=6
|
EAPI=7
|
||||||
|
|
||||||
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
|
PYTHON_COMPAT=( python3_{8,9} )
|
||||||
|
|
||||||
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 \
|
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 usr-ldscript \
|
||||||
pam python-r1 multilib-minimal multiprocessing systemd
|
pam python-r1 multilib-minimal multiprocessing systemd
|
||||||
|
|
||||||
MY_PV="${PV/_/-}"
|
MY_PV="${PV/_/-}"
|
||||||
@ -17,52 +16,81 @@ if [[ ${PV} == 9999 ]] ; then
|
|||||||
EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
|
EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
|
||||||
else
|
else
|
||||||
[[ "${PV}" = *_rc* ]] || \
|
[[ "${PV}" = *_rc* ]] || \
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
|
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESCRIPTION="Various useful Linux utilities"
|
DESCRIPTION="Various useful Linux utilities"
|
||||||
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
|
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
|
||||||
|
|
||||||
LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
|
LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="build caps +cramfs fdformat kill ncurses nls pam python +readline selinux slang static-libs +suid systemd test tty-helpers udev unicode userland_GNU"
|
IUSE="audit build caps +cramfs cryptsetup fdformat +hardlink kill +logger magic ncurses nls pam python +readline selinux slang static-libs su +suid systemd test tty-helpers udev unicode userland_GNU"
|
||||||
|
|
||||||
# Most lib deps here are related to programs rather than our libs,
|
# Most lib deps here are related to programs rather than our libs,
|
||||||
# so we rarely need to specify ${MULTILIB_USEDEP}.
|
# so we rarely need to specify ${MULTILIB_USEDEP}.
|
||||||
RDEPEND="caps? ( sys-libs/libcap-ng )
|
RDEPEND="
|
||||||
|
virtual/libcrypt:=
|
||||||
|
audit? ( >=sys-process/audit-2.6:= )
|
||||||
|
caps? ( sys-libs/libcap-ng )
|
||||||
cramfs? ( sys-libs/zlib:= )
|
cramfs? ( sys-libs/zlib:= )
|
||||||
ncurses? ( >=sys-libs/ncurses-5.2-r2:0=[unicode?] )
|
cryptsetup? ( >=sys-fs/cryptsetup-2.1.0 )
|
||||||
|
hardlink? ( dev-libs/libpcre2:= )
|
||||||
|
ncurses? (
|
||||||
|
sys-libs/ncurses:=[unicode(+)?]
|
||||||
|
magic? ( sys-apps/file:0= )
|
||||||
|
)
|
||||||
nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
|
nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
|
||||||
pam? ( sys-libs/pam )
|
pam? ( sys-libs/pam )
|
||||||
|
ppc? ( sys-libs/librtas )
|
||||||
|
ppc64? ( sys-libs/librtas )
|
||||||
python? ( ${PYTHON_DEPS} )
|
python? ( ${PYTHON_DEPS} )
|
||||||
readline? ( sys-libs/readline:0= )
|
readline? ( sys-libs/readline:0= )
|
||||||
selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
|
selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
|
||||||
slang? ( sys-libs/slang )
|
slang? ( sys-libs/slang )
|
||||||
!build? ( systemd? ( sys-apps/systemd ) )
|
!build? ( systemd? ( sys-apps/systemd ) )
|
||||||
udev? ( virtual/libudev:= )"
|
udev? ( virtual/libudev:= )"
|
||||||
DEPEND="${RDEPEND}
|
BDEPEND="
|
||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
nls? ( sys-devel/gettext )
|
nls? ( sys-devel/gettext )
|
||||||
test? ( sys-devel/bc )
|
test? ( sys-devel/bc )
|
||||||
virtual/os-headers"
|
"
|
||||||
|
DEPEND="
|
||||||
|
${RDEPEND}
|
||||||
|
virtual/os-headers
|
||||||
|
"
|
||||||
RDEPEND+="
|
RDEPEND+="
|
||||||
|
hardlink? ( !app-arch/hardlink )
|
||||||
|
logger? ( !>=app-admin/sysklogd-2.0[logger] )
|
||||||
kill? (
|
kill? (
|
||||||
!sys-apps/coreutils[kill]
|
!sys-apps/coreutils[kill]
|
||||||
!sys-process/procps[kill]
|
!sys-process/procps[kill]
|
||||||
)
|
)
|
||||||
|
su? (
|
||||||
|
!<sys-apps/shadow-4.7-r2
|
||||||
|
!>=sys-apps/shadow-4.7-r2[su]
|
||||||
|
)
|
||||||
!net-wireless/rfkill
|
!net-wireless/rfkill
|
||||||
!sys-process/schedutils
|
!<app-shells/bash-completion-2.7-r1
|
||||||
!sys-apps/setarch
|
"
|
||||||
!<sys-apps/sysvinit-2.88-r7
|
|
||||||
!<sys-libs/e2fsprogs-libs-1.41.8
|
# Required for man-page generation
|
||||||
!<sys-fs/e2fsprogs-1.41.8
|
if [[ "${PV}" == 9999 ]] ; then
|
||||||
!<app-shells/bash-completion-2.7-r1"
|
BDEPEND+="
|
||||||
|
dev-ruby/asciidoctor
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||||
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
S="${WORKDIR}/${MY_P}"
|
S="${WORKDIR}/${MY_P}"
|
||||||
|
|
||||||
|
PATCHES=(
|
||||||
|
"${FILESDIR}"/${PN}-2.37.1-agetty_ctrl-c_erase.patch #804972
|
||||||
|
"${FILESDIR}"/${P}-ioctl_ns-test-hang.patch # upstream test hang patch
|
||||||
|
)
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
|
|
||||||
@ -71,7 +99,7 @@ src_prepare() {
|
|||||||
-e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
|
-e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
|
||||||
tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
|
tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
|
||||||
|
|
||||||
if ! use userland_GNU; then
|
if ! use userland_GNU ; then
|
||||||
# test runner is using GNU-specific xargs call
|
# test runner is using GNU-specific xargs call
|
||||||
sed -i -e 's:xargs:gxargs:' tests/run.sh || die
|
sed -i -e 's:xargs:gxargs:' tests/run.sh || die
|
||||||
# test requires util-linux uuidgen (which we don't build)
|
# test requires util-linux uuidgen (which we don't build)
|
||||||
@ -83,12 +111,6 @@ src_prepare() {
|
|||||||
eautoreconf
|
eautoreconf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Undo bad ncurses handling by upstream. #601530
|
|
||||||
sed -i -E \
|
|
||||||
-e '/NCURSES_/s:(ncursesw?)[56]-config:$PKG_CONFIG \1:' \
|
|
||||||
-e 's:(ncursesw?)[56]-config --version:$PKG_CONFIG --exists --print-errors \1:' \
|
|
||||||
configure || die
|
|
||||||
|
|
||||||
elibtoolize
|
elibtoolize
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,12 +129,13 @@ lfs_fallocate_test() {
|
|||||||
|
|
||||||
python_configure() {
|
python_configure() {
|
||||||
local myeconfargs=(
|
local myeconfargs=(
|
||||||
|
"${commonargs[@]}"
|
||||||
--disable-all-programs
|
--disable-all-programs
|
||||||
--disable-bash-completion
|
--disable-bash-completion
|
||||||
--without-systemdsystemunitdir
|
--without-systemdsystemunitdir
|
||||||
--with-python
|
--with-python
|
||||||
)
|
)
|
||||||
if use userland_GNU; then
|
if use userland_GNU ; then
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--enable-libblkid
|
--enable-libblkid
|
||||||
--enable-libmount
|
--enable-libmount
|
||||||
@ -134,8 +157,17 @@ multilib_src_configure() {
|
|||||||
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
|
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
|
||||||
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
|
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
|
||||||
|
|
||||||
local myeconfargs=(
|
# Undo bad ncurses handling by upstream. Fall back to pkg-config. #601530
|
||||||
|
export NCURSES6_CONFIG=false NCURSES5_CONFIG=false
|
||||||
|
export NCURSESW6_CONFIG=false NCURSESW5_CONFIG=false
|
||||||
|
|
||||||
|
# configure args shared by python and non-python builds
|
||||||
|
local commonargs=(
|
||||||
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
||||||
|
)
|
||||||
|
|
||||||
|
local myeconfargs=(
|
||||||
|
"${commonargs[@]}"
|
||||||
--with-bashcompletiondir="$(get_bashcompdir)"
|
--with-bashcompletiondir="$(get_bashcompdir)"
|
||||||
--without-python
|
--without-python
|
||||||
$(multilib_native_use_enable suid makeinstall-chown)
|
$(multilib_native_use_enable suid makeinstall-chown)
|
||||||
@ -144,28 +176,31 @@ multilib_src_configure() {
|
|||||||
$(multilib_native_use_with slang)
|
$(multilib_native_use_with slang)
|
||||||
$(multilib_native_use_with systemd)
|
$(multilib_native_use_with systemd)
|
||||||
$(multilib_native_use_with udev)
|
$(multilib_native_use_with udev)
|
||||||
|
$(multilib_native_usex ncurses "$(use_with magic libmagic)" '--without-libmagic')
|
||||||
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
||||||
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
||||||
|
$(multilib_native_use_with audit)
|
||||||
$(tc-has-tls || echo --disable-tls)
|
$(tc-has-tls || echo --disable-tls)
|
||||||
$(use_enable nls)
|
$(use_enable nls)
|
||||||
$(use_enable unicode widechar)
|
$(use_enable unicode widechar)
|
||||||
$(use_enable static-libs static)
|
$(use_enable static-libs static)
|
||||||
$(use_with selinux)
|
|
||||||
$(use_with ncurses tinfo)
|
$(use_with ncurses tinfo)
|
||||||
|
$(use_with selinux)
|
||||||
)
|
)
|
||||||
# build programs only on GNU, on *BSD we want libraries only
|
# build programs only on GNU, on *BSD we want libraries only
|
||||||
if multilib_is_native_abi && use userland_GNU; then
|
if multilib_is_native_abi && use userland_GNU ; then
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--disable-chfn-chsh
|
--disable-chfn-chsh
|
||||||
--disable-login
|
--disable-login
|
||||||
|
--disable-newgrp
|
||||||
--disable-nologin
|
--disable-nologin
|
||||||
--disable-pylibmount
|
--disable-pylibmount
|
||||||
--disable-su
|
--disable-raw
|
||||||
|
--disable-vipw
|
||||||
--enable-agetty
|
--enable-agetty
|
||||||
--enable-bash-completion
|
--enable-bash-completion
|
||||||
--enable-line
|
--enable-line
|
||||||
--enable-partx
|
--enable-partx
|
||||||
--enable-raw
|
|
||||||
--enable-rename
|
--enable-rename
|
||||||
--enable-rfkill
|
--enable-rfkill
|
||||||
--enable-schedutils
|
--enable-schedutils
|
||||||
@ -173,14 +208,26 @@ multilib_src_configure() {
|
|||||||
$(use_enable caps setpriv)
|
$(use_enable caps setpriv)
|
||||||
$(use_enable cramfs)
|
$(use_enable cramfs)
|
||||||
$(use_enable fdformat)
|
$(use_enable fdformat)
|
||||||
|
$(use_enable hardlink)
|
||||||
|
$(use_enable kill)
|
||||||
|
$(use_enable logger)
|
||||||
|
$(use_enable ncurses pg)
|
||||||
|
$(use_enable su)
|
||||||
$(use_enable tty-helpers mesg)
|
$(use_enable tty-helpers mesg)
|
||||||
$(use_enable tty-helpers wall)
|
$(use_enable tty-helpers wall)
|
||||||
$(use_enable tty-helpers write)
|
$(use_enable tty-helpers write)
|
||||||
$(use_enable kill)
|
$(use_with cryptsetup)
|
||||||
)
|
)
|
||||||
|
if [[ ${PV} == *9999 ]] ; then
|
||||||
|
myeconfargs+=( --enable-asciidoc )
|
||||||
|
else
|
||||||
|
# Upstream is shipping pre-generated man-pages for releases
|
||||||
|
myeconfargs+=( --disable-asciidoc )
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--disable-all-programs
|
--disable-all-programs
|
||||||
|
--disable-asciidoc
|
||||||
--disable-bash-completion
|
--disable-bash-completion
|
||||||
--without-systemdsystemunitdir
|
--without-systemdsystemunitdir
|
||||||
# build libraries
|
# build libraries
|
||||||
@ -189,7 +236,7 @@ multilib_src_configure() {
|
|||||||
--enable-libsmartcols
|
--enable-libsmartcols
|
||||||
--enable-libfdisk
|
--enable-libfdisk
|
||||||
)
|
)
|
||||||
if use userland_GNU; then
|
if use userland_GNU ; then
|
||||||
# those libraries don't work on *BSD
|
# those libraries don't work on *BSD
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--enable-libmount
|
--enable-libmount
|
||||||
@ -198,7 +245,7 @@ multilib_src_configure() {
|
|||||||
fi
|
fi
|
||||||
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
||||||
|
|
||||||
if multilib_is_native_abi && use python; then
|
if multilib_is_native_abi && use python ; then
|
||||||
python_foreach_impl python_configure
|
python_foreach_impl python_configure
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -212,7 +259,7 @@ python_compile() {
|
|||||||
multilib_src_compile() {
|
multilib_src_compile() {
|
||||||
emake all
|
emake all
|
||||||
|
|
||||||
if multilib_is_native_abi && use python; then
|
if multilib_is_native_abi && use python ; then
|
||||||
python_foreach_impl python_compile
|
python_foreach_impl python_compile
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -225,7 +272,7 @@ python_test() {
|
|||||||
|
|
||||||
multilib_src_test() {
|
multilib_src_test() {
|
||||||
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
||||||
if multilib_is_native_abi && use python; then
|
if multilib_is_native_abi && use python ; then
|
||||||
python_foreach_impl python_test
|
python_foreach_impl python_test
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -238,13 +285,14 @@ python_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
multilib_src_install() {
|
multilib_src_install() {
|
||||||
if multilib_is_native_abi && use python; then
|
if multilib_is_native_abi && use python ; then
|
||||||
python_foreach_impl python_install
|
python_foreach_impl python_install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# This needs to be called AFTER python_install call (#689190)
|
||||||
emake DESTDIR="${D}" install
|
emake DESTDIR="${D}" install
|
||||||
|
|
||||||
if multilib_is_native_abi && use userland_GNU; then
|
if multilib_is_native_abi && use userland_GNU ; then
|
||||||
# need the libs in /
|
# need the libs in /
|
||||||
gen_usr_ldscript -a blkid fdisk mount smartcols uuid
|
gen_usr_ldscript -a blkid fdisk mount smartcols uuid
|
||||||
fi
|
fi
|
||||||
@ -256,13 +304,13 @@ multilib_src_install_all() {
|
|||||||
# e2fsprogs-libs didnt install .la files, and .pc work fine
|
# e2fsprogs-libs didnt install .la files, and .pc work fine
|
||||||
find "${ED}" -name "*.la" -delete || die
|
find "${ED}" -name "*.la" -delete || die
|
||||||
|
|
||||||
if ! use userland_GNU; then
|
if ! use userland_GNU ; then
|
||||||
# manpage collisions
|
# manpage collisions
|
||||||
# TODO: figure out a good way to keep them
|
# TODO: figure out a good way to keep them
|
||||||
rm "${ED%/}"/usr/share/man/man3/uuid* || die
|
rm "${ED}"/usr/share/man/man3/uuid* || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if use pam; then
|
if use pam ; then
|
||||||
newpamd "${FILESDIR}/runuser.pamd" runuser
|
newpamd "${FILESDIR}/runuser.pamd" runuser
|
||||||
newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
|
newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
|
||||||
fi
|
fi
|
||||||
@ -277,11 +325,11 @@ multilib_src_install_all() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if ! use tty-helpers; then
|
if ! use tty-helpers ; then
|
||||||
elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
|
elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z ${REPLACING_VERSIONS} ]]; then
|
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||||||
elog "The agetty util now clears the terminal by default. You"
|
elog "The agetty util now clears the terminal by default. You"
|
||||||
elog "might want to add --noclear to your /etc/inittab lines."
|
elog "might want to add --noclear to your /etc/inittab lines."
|
||||||
fi
|
fi
|
@ -1,12 +1,11 @@
|
|||||||
# Copyright 1999-2018 Gentoo Authors and others
|
# Copyright 1999-2021 Gentoo Authors
|
||||||
# Copyright 2018 Sony Interactive Entertainment Inc.
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=6
|
EAPI=7
|
||||||
|
|
||||||
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
|
PYTHON_COMPAT=( python3_{8,9} )
|
||||||
|
|
||||||
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 \
|
inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 usr-ldscript \
|
||||||
pam python-r1 multilib-minimal multiprocessing systemd
|
pam python-r1 multilib-minimal multiprocessing systemd
|
||||||
|
|
||||||
MY_PV="${PV/_/-}"
|
MY_PV="${PV/_/-}"
|
||||||
@ -17,56 +16,76 @@ if [[ ${PV} == 9999 ]] ; then
|
|||||||
EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
|
EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
|
||||||
else
|
else
|
||||||
[[ "${PV}" = *_rc* ]] || \
|
[[ "${PV}" = *_rc* ]] || \
|
||||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
|
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
|
||||||
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DESCRIPTION="Various useful Linux utilities"
|
DESCRIPTION="Various useful Linux utilities"
|
||||||
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
|
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
|
||||||
|
|
||||||
LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
|
LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="build caps +cramfs fdformat kill ncurses nls pam python +readline selinux slang static-libs +suid systemd test tty-helpers udev unicode userland_GNU"
|
IUSE="audit build caps +cramfs cryptsetup fdformat +hardlink kill +logger magic ncurses nls pam python +readline selinux slang static-libs su +suid systemd test tty-helpers udev unicode userland_GNU"
|
||||||
|
|
||||||
# Most lib deps here are related to programs rather than our libs,
|
# Most lib deps here are related to programs rather than our libs,
|
||||||
# so we rarely need to specify ${MULTILIB_USEDEP}.
|
# so we rarely need to specify ${MULTILIB_USEDEP}.
|
||||||
RDEPEND="caps? ( sys-libs/libcap-ng )
|
RDEPEND="
|
||||||
|
virtual/libcrypt:=
|
||||||
|
audit? ( >=sys-process/audit-2.6:= )
|
||||||
|
caps? ( sys-libs/libcap-ng )
|
||||||
cramfs? ( sys-libs/zlib:= )
|
cramfs? ( sys-libs/zlib:= )
|
||||||
ncurses? ( >=sys-libs/ncurses-5.2-r2:0=[unicode?] )
|
cryptsetup? ( >=sys-fs/cryptsetup-2.1.0 )
|
||||||
|
hardlink? ( dev-libs/libpcre2:= )
|
||||||
|
ncurses? (
|
||||||
|
sys-libs/ncurses:=[unicode(+)?]
|
||||||
|
magic? ( sys-apps/file:0= )
|
||||||
|
)
|
||||||
nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
|
nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
|
||||||
pam? ( sys-libs/pam )
|
pam? ( sys-libs/pam )
|
||||||
|
ppc? ( sys-libs/librtas )
|
||||||
|
ppc64? ( sys-libs/librtas )
|
||||||
python? ( ${PYTHON_DEPS} )
|
python? ( ${PYTHON_DEPS} )
|
||||||
readline? ( sys-libs/readline:0= )
|
readline? ( sys-libs/readline:0= )
|
||||||
selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
|
selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
|
||||||
slang? ( sys-libs/slang )
|
slang? ( sys-libs/slang )
|
||||||
!build? ( systemd? ( sys-apps/systemd ) )
|
!build? ( systemd? ( sys-apps/systemd ) )
|
||||||
udev? ( virtual/libudev:= )"
|
udev? ( virtual/libudev:= )"
|
||||||
DEPEND="${RDEPEND}
|
BDEPEND="
|
||||||
virtual/pkgconfig
|
virtual/pkgconfig
|
||||||
nls? ( sys-devel/gettext )
|
nls? ( sys-devel/gettext )
|
||||||
test? ( sys-devel/bc )
|
test? ( sys-devel/bc )
|
||||||
virtual/os-headers"
|
"
|
||||||
|
DEPEND="
|
||||||
|
${RDEPEND}
|
||||||
|
virtual/os-headers
|
||||||
|
"
|
||||||
RDEPEND+="
|
RDEPEND+="
|
||||||
|
hardlink? ( !app-arch/hardlink )
|
||||||
|
logger? ( !>=app-admin/sysklogd-2.0[logger] )
|
||||||
kill? (
|
kill? (
|
||||||
!sys-apps/coreutils[kill]
|
!sys-apps/coreutils[kill]
|
||||||
!sys-process/procps[kill]
|
!sys-process/procps[kill]
|
||||||
)
|
)
|
||||||
|
su? (
|
||||||
|
!<sys-apps/shadow-4.7-r2
|
||||||
|
!>=sys-apps/shadow-4.7-r2[su]
|
||||||
|
)
|
||||||
!net-wireless/rfkill
|
!net-wireless/rfkill
|
||||||
!sys-process/schedutils
|
!<app-shells/bash-completion-2.7-r1
|
||||||
!sys-apps/setarch
|
"
|
||||||
!<sys-apps/sysvinit-2.88-r7
|
|
||||||
!<sys-libs/e2fsprogs-libs-1.41.8
|
# Required for man-page generation
|
||||||
!<sys-fs/e2fsprogs-1.41.8
|
if [[ "${PV}" == 9999 ]] ; then
|
||||||
!<app-shells/bash-completion-2.7-r1"
|
BDEPEND+="
|
||||||
|
dev-ruby/asciidoctor
|
||||||
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||||
|
RESTRICT="!test? ( test )"
|
||||||
|
|
||||||
S="${WORKDIR}/${MY_P}"
|
S="${WORKDIR}/${MY_P}"
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}/util-linux-2.32.1-skip-oids-test-when-uuidgen-is-not-available.patch"
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
default
|
default
|
||||||
|
|
||||||
@ -75,7 +94,7 @@ src_prepare() {
|
|||||||
-e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
|
-e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
|
||||||
tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
|
tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
|
||||||
|
|
||||||
if ! use userland_GNU; then
|
if ! use userland_GNU ; then
|
||||||
# test runner is using GNU-specific xargs call
|
# test runner is using GNU-specific xargs call
|
||||||
sed -i -e 's:xargs:gxargs:' tests/run.sh || die
|
sed -i -e 's:xargs:gxargs:' tests/run.sh || die
|
||||||
# test requires util-linux uuidgen (which we don't build)
|
# test requires util-linux uuidgen (which we don't build)
|
||||||
@ -87,12 +106,6 @@ src_prepare() {
|
|||||||
eautoreconf
|
eautoreconf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Undo bad ncurses handling by upstream. #601530
|
|
||||||
sed -i -E \
|
|
||||||
-e '/NCURSES_/s:(ncursesw?)[56]-config:$PKG_CONFIG \1:' \
|
|
||||||
-e 's:(ncursesw?)[56]-config --version:$PKG_CONFIG --exists --print-errors \1:' \
|
|
||||||
configure || die
|
|
||||||
|
|
||||||
elibtoolize
|
elibtoolize
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,12 +124,13 @@ lfs_fallocate_test() {
|
|||||||
|
|
||||||
python_configure() {
|
python_configure() {
|
||||||
local myeconfargs=(
|
local myeconfargs=(
|
||||||
|
"${commonargs[@]}"
|
||||||
--disable-all-programs
|
--disable-all-programs
|
||||||
--disable-bash-completion
|
--disable-bash-completion
|
||||||
--without-systemdsystemunitdir
|
--without-systemdsystemunitdir
|
||||||
--with-python
|
--with-python
|
||||||
)
|
)
|
||||||
if use userland_GNU; then
|
if use userland_GNU ; then
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--enable-libblkid
|
--enable-libblkid
|
||||||
--enable-libmount
|
--enable-libmount
|
||||||
@ -138,8 +152,17 @@ multilib_src_configure() {
|
|||||||
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
|
export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
|
||||||
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
|
export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
|
||||||
|
|
||||||
local myeconfargs=(
|
# Undo bad ncurses handling by upstream. Fall back to pkg-config. #601530
|
||||||
|
export NCURSES6_CONFIG=false NCURSES5_CONFIG=false
|
||||||
|
export NCURSESW6_CONFIG=false NCURSESW5_CONFIG=false
|
||||||
|
|
||||||
|
# configure args shared by python and non-python builds
|
||||||
|
local commonargs=(
|
||||||
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
|
||||||
|
)
|
||||||
|
|
||||||
|
local myeconfargs=(
|
||||||
|
"${commonargs[@]}"
|
||||||
--with-bashcompletiondir="$(get_bashcompdir)"
|
--with-bashcompletiondir="$(get_bashcompdir)"
|
||||||
--without-python
|
--without-python
|
||||||
$(multilib_native_use_enable suid makeinstall-chown)
|
$(multilib_native_use_enable suid makeinstall-chown)
|
||||||
@ -148,8 +171,10 @@ multilib_src_configure() {
|
|||||||
$(multilib_native_use_with slang)
|
$(multilib_native_use_with slang)
|
||||||
$(multilib_native_use_with systemd)
|
$(multilib_native_use_with systemd)
|
||||||
$(multilib_native_use_with udev)
|
$(multilib_native_use_with udev)
|
||||||
|
$(multilib_native_usex ncurses "$(use_with magic libmagic)" '--without-libmagic')
|
||||||
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
$(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
|
||||||
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
$(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
|
||||||
|
$(multilib_native_use_with audit)
|
||||||
$(tc-has-tls || echo --disable-tls)
|
$(tc-has-tls || echo --disable-tls)
|
||||||
$(use_enable nls)
|
$(use_enable nls)
|
||||||
$(use_enable unicode widechar)
|
$(use_enable unicode widechar)
|
||||||
@ -158,18 +183,19 @@ multilib_src_configure() {
|
|||||||
$(use_with selinux)
|
$(use_with selinux)
|
||||||
)
|
)
|
||||||
# build programs only on GNU, on *BSD we want libraries only
|
# build programs only on GNU, on *BSD we want libraries only
|
||||||
if multilib_is_native_abi && use userland_GNU; then
|
if multilib_is_native_abi && use userland_GNU ; then
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--disable-chfn-chsh
|
--disable-chfn-chsh
|
||||||
--disable-login
|
--disable-login
|
||||||
|
--disable-newgrp
|
||||||
--disable-nologin
|
--disable-nologin
|
||||||
--disable-pylibmount
|
--disable-pylibmount
|
||||||
--disable-su
|
--disable-raw
|
||||||
|
--disable-vipw
|
||||||
--enable-agetty
|
--enable-agetty
|
||||||
--enable-bash-completion
|
--enable-bash-completion
|
||||||
--enable-line
|
--enable-line
|
||||||
--enable-partx
|
--enable-partx
|
||||||
--enable-raw
|
|
||||||
--enable-rename
|
--enable-rename
|
||||||
--enable-rfkill
|
--enable-rfkill
|
||||||
--enable-schedutils
|
--enable-schedutils
|
||||||
@ -177,14 +203,26 @@ multilib_src_configure() {
|
|||||||
$(use_enable caps setpriv)
|
$(use_enable caps setpriv)
|
||||||
$(use_enable cramfs)
|
$(use_enable cramfs)
|
||||||
$(use_enable fdformat)
|
$(use_enable fdformat)
|
||||||
|
$(use_enable hardlink)
|
||||||
|
$(use_enable kill)
|
||||||
|
$(use_enable logger)
|
||||||
|
$(use_enable ncurses pg)
|
||||||
|
$(use_enable su)
|
||||||
$(use_enable tty-helpers mesg)
|
$(use_enable tty-helpers mesg)
|
||||||
$(use_enable tty-helpers wall)
|
$(use_enable tty-helpers wall)
|
||||||
$(use_enable tty-helpers write)
|
$(use_enable tty-helpers write)
|
||||||
$(use_enable kill)
|
$(use_with cryptsetup)
|
||||||
)
|
)
|
||||||
|
if [[ ${PV} == *9999 ]] ; then
|
||||||
|
myeconfargs+=( --enable-asciidoc )
|
||||||
|
else
|
||||||
|
# Upstream is shipping pre-generated man-pages for releases
|
||||||
|
myeconfargs+=( --disable-asciidoc )
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--disable-all-programs
|
--disable-all-programs
|
||||||
|
--disable-asciidoc
|
||||||
--disable-bash-completion
|
--disable-bash-completion
|
||||||
--without-systemdsystemunitdir
|
--without-systemdsystemunitdir
|
||||||
# build libraries
|
# build libraries
|
||||||
@ -193,7 +231,7 @@ multilib_src_configure() {
|
|||||||
--enable-libsmartcols
|
--enable-libsmartcols
|
||||||
--enable-libfdisk
|
--enable-libfdisk
|
||||||
)
|
)
|
||||||
if use userland_GNU; then
|
if use userland_GNU ; then
|
||||||
# those libraries don't work on *BSD
|
# those libraries don't work on *BSD
|
||||||
myeconfargs+=(
|
myeconfargs+=(
|
||||||
--enable-libmount
|
--enable-libmount
|
||||||
@ -202,7 +240,7 @@ multilib_src_configure() {
|
|||||||
fi
|
fi
|
||||||
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
|
||||||
|
|
||||||
if multilib_is_native_abi && use python; then
|
if multilib_is_native_abi && use python ; then
|
||||||
python_foreach_impl python_configure
|
python_foreach_impl python_configure
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -216,7 +254,7 @@ python_compile() {
|
|||||||
multilib_src_compile() {
|
multilib_src_compile() {
|
||||||
emake all
|
emake all
|
||||||
|
|
||||||
if multilib_is_native_abi && use python; then
|
if multilib_is_native_abi && use python ; then
|
||||||
python_foreach_impl python_compile
|
python_foreach_impl python_compile
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -229,7 +267,7 @@ python_test() {
|
|||||||
|
|
||||||
multilib_src_test() {
|
multilib_src_test() {
|
||||||
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
|
||||||
if multilib_is_native_abi && use python; then
|
if multilib_is_native_abi && use python ; then
|
||||||
python_foreach_impl python_test
|
python_foreach_impl python_test
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -242,15 +280,16 @@ python_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
multilib_src_install() {
|
multilib_src_install() {
|
||||||
emake DESTDIR="${D}" install
|
if multilib_is_native_abi && use python ; then
|
||||||
|
python_foreach_impl python_install
|
||||||
if multilib_is_native_abi && use userland_GNU; then
|
|
||||||
# need the libs in /
|
|
||||||
gen_usr_ldscript -a blkid fdisk mount smartcols uuid
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if multilib_is_native_abi && use python; then
|
# This needs to be called AFTER python_install call (#689190)
|
||||||
python_foreach_impl python_install
|
emake DESTDIR="${D}" install
|
||||||
|
|
||||||
|
if multilib_is_native_abi && use userland_GNU ; then
|
||||||
|
# need the libs in /
|
||||||
|
gen_usr_ldscript -a blkid fdisk mount smartcols uuid
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,13 +299,13 @@ multilib_src_install_all() {
|
|||||||
# e2fsprogs-libs didnt install .la files, and .pc work fine
|
# e2fsprogs-libs didnt install .la files, and .pc work fine
|
||||||
find "${ED}" -name "*.la" -delete || die
|
find "${ED}" -name "*.la" -delete || die
|
||||||
|
|
||||||
if ! use userland_GNU; then
|
if ! use userland_GNU ; then
|
||||||
# manpage collisions
|
# manpage collisions
|
||||||
# TODO: figure out a good way to keep them
|
# TODO: figure out a good way to keep them
|
||||||
rm "${ED%/}"/usr/share/man/man3/uuid* || die
|
rm "${ED}"/usr/share/man/man3/uuid* || die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if use pam; then
|
if use pam ; then
|
||||||
newpamd "${FILESDIR}/runuser.pamd" runuser
|
newpamd "${FILESDIR}/runuser.pamd" runuser
|
||||||
newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
|
newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
|
||||||
fi
|
fi
|
||||||
@ -281,11 +320,11 @@ multilib_src_install_all() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
if ! use tty-helpers; then
|
if ! use tty-helpers ; then
|
||||||
elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
|
elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z ${REPLACING_VERSIONS} ]]; then
|
if [[ -z ${REPLACING_VERSIONS} ]] ; then
|
||||||
elog "The agetty util now clears the terminal by default. You"
|
elog "The agetty util now clears the terminal by default. You"
|
||||||
elog "might want to add --noclear to your /etc/inittab lines."
|
elog "might want to add --noclear to your /etc/inittab lines."
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user