summaryrefslogtreecommitdiff
path: root/sys-process/psinfo
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-09-26 15:08:09 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-09-26 15:08:09 +0100
commit2ad011cd42b40aebf90105be4521fb1727266d1d (patch)
treed9dc4f7c1665a6ba336ba8a9fa773f1292895b76 /sys-process/psinfo
parente0dcb1c4ea48292b379fadd53f55f1df42cf7eab (diff)
gentoo auto-resync : 26:09:2022 - 15:08:08
Diffstat (limited to 'sys-process/psinfo')
-rw-r--r--sys-process/psinfo/Manifest4
-rw-r--r--sys-process/psinfo/files/psinfo-0.12-char.patch65
-rw-r--r--sys-process/psinfo/psinfo-0.12-r1.ebuild2
-rw-r--r--sys-process/psinfo/psinfo-0.12-r2.ebuild24
4 files changed, 93 insertions, 2 deletions
diff --git a/sys-process/psinfo/Manifest b/sys-process/psinfo/Manifest
index dc8f0ff8d682..4b5379569515 100644
--- a/sys-process/psinfo/Manifest
+++ b/sys-process/psinfo/Manifest
@@ -1,4 +1,6 @@
AUX psinfo-0.12-asneeded.patch 1173 BLAKE2B 0b6b2aefa4e669c7775959191008819426bae32c776badd36405b5c3b945b38babd9ee3f40e3f14954f80f1a848f504210caf7307d05e616fdb3965690ff2ed3 SHA512 26e70733df993fc0614027c7c2abd02d4b900e5003211148e2c303476c1fd6f5dcb7e0c76b09dc90c1cca9663bf8ee1a14d999ab6aed5a96c8c40691e7ac1d7f
+AUX psinfo-0.12-char.patch 1957 BLAKE2B ffc4f74e36bfdceddbae5805465761f1b9d87fb1ab79f9fb9e213c4e250df6818f1deebd02b54c3231c2598d1376a19b33df7e606498377428a819e79a7fda5f SHA512 169837c96466579da3619f86ca4888dd74b587c9ed4362fa0a3c425040788a1e2ec08cdada8fe415266cce10cc86aa0cc277777e5f83895e5d8e63fb82d46d25
DIST psinfo-0.12.tar.gz 9107 BLAKE2B d6e9d2c32ca9299220677fd1e2cb80259ee6163c953186346c0450d16cf6622875eb03a89dca945c863ad15d62ab39b0c0d65b06b819e4bdb4d835449908bb8d SHA512 481743c9b8112fa34779bcdeb12d84a1445a4e4c105161d9a9927fe920e5c4f190dc3e03cb65d9978538cb3d4102983af7e290d31c809a1efa0f6c871064c62f
-EBUILD psinfo-0.12-r1.ebuild 486 BLAKE2B ac51527207f9bb6b68fd221f3d1ed7416d02d7526c7bca1ca471ef28bca428568cee0d36e0ec92edd3e32109194b1a30661f99b756a1ed0e08539391a153d3b1 SHA512 64bc4f2c0e1344c034901550d7ae7399e4eb4b9d4a51c6bdf1057c1db70bd2fb7aefec221094f2b5b47ba6f0868cd6e4181e2ca09aaacfcf92f6a0c113673ab5
+EBUILD psinfo-0.12-r1.ebuild 486 BLAKE2B fe2ec2c5bf959d576cc99471428d02e6e5815145ea94788678ab54ecdc751016f1b24a4ea506faa0319171d80721c9df43d1cb0e1c33ad105aab0400489f0480 SHA512 6202a6412b3392fed2ce33a4f0a1ad4bc5bb9e964e1d49d220986d9350a8cc7ee54c7c3f826d22e1c4be031207341514486d0636e9755435daa32b6e2398451a
+EBUILD psinfo-0.12-r2.ebuild 517 BLAKE2B b6d3f819d54e0817d4f5bbc174de936d420f51f7952e63806df1eea984548a419a134a4828c8eeb3cbbee664683f39719a7ce869d133ef221e06ebfce9c13159 SHA512 15ace75199fb3284035792b991a290ca8479f45efa1dd300d9e9b0f97ca07f9eba5c516c3832a54c8e7e282ba014aed4bf5c20ab2db46f377ed82cdcc71ecad0
MISC metadata.xml 262 BLAKE2B e27072dd98b7f5498daae1489ac8968231cfcfcb9f31ecf6097d268e188671b31bc4e508ab805667fdd439bc494038b63cef837afb48ecbea728931c13cbdcdb SHA512 8c217c8865ab5bebf8ce56edd243300895e206a29a717abb8d7a479b3021cb46a053fdb1ad235802b7a03cb124df70ec8806f3336c2e56d8844698f7bad22ee9
diff --git a/sys-process/psinfo/files/psinfo-0.12-char.patch b/sys-process/psinfo/files/psinfo-0.12-char.patch
new file mode 100644
index 000000000000..d29361633185
--- /dev/null
+++ b/sys-process/psinfo/files/psinfo-0.12-char.patch
@@ -0,0 +1,65 @@
+Subject: [PATCH] fix 'char' issue in RISC-V (also Arm64) platform
+
+According to RISC-V psAbi manual[1], "char" is equivalent to "unsigned char",
+so in RISC-V/ARM64 the following code will always print out 'false',
+while in X86_64 it will print out 'true'
+
+test() {
+ char val = EOF;
+ printf("%s", val == EOF ? "true" : "false");
+}
+
+According to man page, the following two function return value is 'int':
+ int getopt(int argc, char *const argv[],
+ const char *optstring);
+ int fgetc(FILE *stream);
+
+so, we use 'int' variable and then convert to 'char' if nencessary
+
+[1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc
+snip of description:
+ C/C++ type representations
+ char is unsigned.
+
+Bug: https://bugs.gentoo.org/872821
+
+Signed-off-by: Yixun Lan <dlan@gentoo.org>
+---
+ psinfo.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/psinfo.c b/psinfo.c
+index 90a6d8f..05acedf 100644
+--- a/psinfo.c
++++ b/psinfo.c
+@@ -172,14 +172,15 @@ int parse_proc_wchan(FILE * f, struct process_info *p)
+ int parse_proc_arrayfile(char *name, char ***s)
+ {
+ FILE *f;
+- int res = 1;
++ int ret, res = 1;
+
+ if ((f = fopen(name, "r")) != NULL) {
+ char *buf;
+ int len = 0, bufsize = 1024, count = 0;
+
+ buf = malloc(bufsize);
+- while ((buf[len++] = fgetc(f)) != EOF) {
++ while ((ret = fgetc(f)) != EOF) {
++ buf[len++] = ret & 0xFF;
+ if (buf[len - 1] == 0) {
+ *s = realloc(*s, (count + 2) * sizeof(char *));
+ (*s)[count] = malloc(len);
+@@ -673,8 +674,7 @@ void print_help()
+ int main(int argc, char **argv)
+ {
+ struct process_info *p;
+- int pid, output_general = 0, output_cpu = 0, output_io = 0, output_memory = 0, output_privilege = 0, output_signal = 0, result = 0;
+- char c;
++ int c, pid, output_general = 0, output_cpu = 0, output_io = 0, output_memory = 0, output_privilege = 0, output_signal = 0, result = 0;
+
+ opterr = 0;
+ if (argc <= 1) {
+--
+2.37.3
+
diff --git a/sys-process/psinfo/psinfo-0.12-r1.ebuild b/sys-process/psinfo/psinfo-0.12-r1.ebuild
index e6faa1baad15..033fcddb450b 100644
--- a/sys-process/psinfo/psinfo-0.12-r1.ebuild
+++ b/sys-process/psinfo/psinfo-0.12-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
diff --git a/sys-process/psinfo/psinfo-0.12-r2.ebuild b/sys-process/psinfo/psinfo-0.12-r2.ebuild
new file mode 100644
index 000000000000..fdf62188a826
--- /dev/null
+++ b/sys-process/psinfo/psinfo-0.12-r2.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Process information and statistics using the kernel /proc interface"
+HOMEPAGE="http://www.ward.nu/computer/psinfo/"
+SRC_URI="http://www.ward.nu/computer/${PN}/${P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+LICENSE="GPL-2"
+
+PATCHES=(
+ "${FILESDIR}/${P}-asneeded.patch"
+ "${FILESDIR}/${P}-char.patch"
+)
+
+src_prepare() {
+ default
+ tc-export CC
+}