summaryrefslogtreecommitdiff
path: root/sys-process/pidof-bsd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-process/pidof-bsd
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-process/pidof-bsd')
-rw-r--r--sys-process/pidof-bsd/Manifest9
-rw-r--r--sys-process/pidof-bsd/files/pidof-bsd-20050501-fbsd11.patch14
-rw-r--r--sys-process/pidof-bsd/files/pidof-bsd-20050501-firstarg.patch13
-rw-r--r--sys-process/pidof-bsd/files/pidof-bsd-20050501-gfbsd.patch128
-rw-r--r--sys-process/pidof-bsd/files/pidof-bsd-20050501-pname.patch46
-rw-r--r--sys-process/pidof-bsd/metadata.xml8
-rw-r--r--sys-process/pidof-bsd/pidof-bsd-20050501-r4.ebuild33
7 files changed, 251 insertions, 0 deletions
diff --git a/sys-process/pidof-bsd/Manifest b/sys-process/pidof-bsd/Manifest
new file mode 100644
index 000000000000..d2cb740a74a6
--- /dev/null
+++ b/sys-process/pidof-bsd/Manifest
@@ -0,0 +1,9 @@
+AUX pidof-bsd-20050501-fbsd11.patch 252 SHA256 cef03e8166278e8c5f2453951a379d7d934840d340f4bb21e46703002678faf6 SHA512 32c19975f2bc14e809a0416c52418416c9cfba62ed5bbda69b2773dd1dc931b7b2740054bf70f590403692f1944463e7cc6bef2dfc050d93bc5c7bc9f59559c3 WHIRLPOOL f59c9e6a8f88187ad60e2f606f6021c21c27da274aa8f7ee599adca2f0d4151a9e518628f546b7e8931eb2dbe0409eba3dd454304f3d1febf8d9e1f8d7298827
+AUX pidof-bsd-20050501-firstarg.patch 485 SHA256 40bc0e215cce2b963c949bc84ac615970d10dd5f6e820a2bb826b5307ee9aee3 SHA512 c7dd9d9c7d2d90c41b0c612284c9f23990e11d598ee6815480b2a31c2910703030511077781e9fc24e5054cc88fc6c50b6bf8eae1a9141a671f78c1be3cf9f09 WHIRLPOOL cf8ca9a8b7e1207c9275f925a03252b253076595041ef20b627d00c335b239f5623df9bf3ab51f19183f2bf101da476fafa3c782234d866f6c954ee86a950256
+AUX pidof-bsd-20050501-gfbsd.patch 2825 SHA256 d0befa96e29e1030d9aa9f41fd3f21893074418ff5ead049639c1394a416fbf4 SHA512 459bc1bb1452067207082c2b55ba86e47cb5a683cbc2ddf8b10545d8e961a0a8d9f5bba34236e150e391056364a4115be975b30e34df4c3dc82ed16bdad981a9 WHIRLPOOL e20e2c250c779c127558d66074333f38a24257fb1b3edc431f44ca5e4fc8a19d8103c757d00a79e6abfa1f08c2e516e0823b6a31b606af26eacc45a107d8bbb1
+AUX pidof-bsd-20050501-pname.patch 1374 SHA256 04fdaa9de91dafa6fc1e12443e30ec532315f74cfdffcf074fd5d8583ec322fe SHA512 5f3912a0f48db867181def6a6bb36f3544b069be89af0d0290d073f7d92041abda449c8b84694fed45e1d35a50bfa4bd157d695ab166fb61cc3b6c8d99e5f417 WHIRLPOOL aaf31effa8cfd1dd86ce684d8be8657bb3d3f3baa7c2adc44cfab5d30f7ed5340a9bb5a0cc563e020a2836790050dfd9eb35d4c8c25579ae3eb14f70b5291241
+DIST pidof-bsd-20050501.tar.gz 1769 SHA256 c3ed8826178debe872f7717b8810d477d4611ab19af73bed97c5af1c552d20e6 SHA512 27691305165848363415a7d487b36a87db0750a9c08e6327eef05f5e87326c91fbf46c415673f83268981a22bbfcfaaf5ef280c06c24b3ebb50d1483527f9c94 WHIRLPOOL cd8c2264f6286b0988385defa14e528f8c9f8f1018ece69f6bd9e8784f259c491b923d0ad70a10fbbcf132dcef8ef98c96049968a888a4bed6d09dbac83ac94e
+EBUILD pidof-bsd-20050501-r4.ebuild 657 SHA256 c47f78f255b7ab71550229514a30c4cc9c817b91ffcfc57b30ecc11c889a9c0e SHA512 c01bf95df2455943b47acc303472698401009e10569f2a12b0008c6ca254c2ce3c824289542e50c4a4622a26a756a2e91c95092d7ca95adef9d1dc8b3eb5e918 WHIRLPOOL 3045d244c1543ece2a44bfd3acba1ab76a0fe83c3686c18cf9b6dc471cbf31fc07afce54f4944ce5001d30a4bf81032d584a7ccb886670d4be6d76bfee884bf6
+MISC ChangeLog 2820 SHA256 4c7079c2ca346c88825d565433cf0bb6e9a9d0b21340025160b9062dfff811d9 SHA512 6d1207a21fec16534f8a359990fa372843cd3abe6ac9975879b776da8017c7736bcdf38ad98be04f4a84e3c95c2cc6fcc5400072f638208bdc326f9566beab0d WHIRLPOOL 3700fa085427bad52773c9716a885dd27b129ab9144f618c374c2767450592b72c0205ab421ed2b4e32582baf1a59e8474ff6844fe740d1be5bb0cff9295a0cf
+MISC ChangeLog-2015 2139 SHA256 fb1885d45c286e20d80134b8ec828618c3dfcf4ca418da9bbe7683a509f6a0c0 SHA512 e054b0fee6991132e566a090e1b14333ae0ab7ddf39a2f5f02412a8b91e62808cc01e2b14fc6d23c49e9d071cda2b157954437ecf04a9c04ca4d4517c3888f26 WHIRLPOOL 3f6f69436b1902f753ddcf25ce05114ac060346f42425b45040a4f35d3aa5299359ce6b115db42bac56920d4d57f850f0af7afe749a51671429433cb5eb8b4d1
+MISC metadata.xml 238 SHA256 501d93b0c41ed422505100f002758cd173cd9783ae7fbb53e2ec5f238c868340 SHA512 173efaa53a514acf1e2f0c6681c82a48ec16d505844f551d2cc823ee8685b27837c7461f7956c12182059ee7e83023e2f0bcd5d1afab74beeaf998487193656d WHIRLPOOL 4ca51d994f011a5e7e4939f02a54b5c2f9f3e526665893c9ac2876c9871b7dc80361393d41c5247b3a5520e82d31d0dd10da520e7715c94b806a94ce0fed2a5a
diff --git a/sys-process/pidof-bsd/files/pidof-bsd-20050501-fbsd11.patch b/sys-process/pidof-bsd/files/pidof-bsd-20050501-fbsd11.patch
new file mode 100644
index 000000000000..4a1b16285205
--- /dev/null
+++ b/sys-process/pidof-bsd/files/pidof-bsd-20050501-fbsd11.patch
@@ -0,0 +1,14 @@
+diff --git a/pidof/Makefile b/pidof/Makefile
+index d2d760b..67d2725 100644
+--- a/pidof/Makefile
++++ b/pidof/Makefile
+@@ -2,8 +2,7 @@
+
+ PROG= pidof
+ SRCS= pidof.c
+-NOMAN= yes
++NO_MAN= yes
+ LDADD= -lkvm
+-LINKS= ${BINDIR}/pidof
+
+ .include <bsd.prog.mk>
diff --git a/sys-process/pidof-bsd/files/pidof-bsd-20050501-firstarg.patch b/sys-process/pidof-bsd/files/pidof-bsd-20050501-firstarg.patch
new file mode 100644
index 000000000000..dfb15ae7b94b
--- /dev/null
+++ b/sys-process/pidof-bsd/files/pidof-bsd-20050501-firstarg.patch
@@ -0,0 +1,13 @@
+Index: pidof/pidof.c
+===================================================================
+--- pidof.orig/pidof.c
++++ pidof/pidof.c
+@@ -67,7 +67,7 @@ get_pid_of_process(const char *process_n
+ char **p_argv = NULL;
+
+ if ((p_argv = kvm_getargv(kd, p+i, 0)) != NULL)
+- for (; *p_argv != NULL; p_argv++)
++ if ( *p_argv != NULL )
+ if (strcmp(process_name, basename(*p_argv)) == 0) {
+ (void)printf("%d ", (int)p[i].ki_pid);
+ processes_found++;
diff --git a/sys-process/pidof-bsd/files/pidof-bsd-20050501-gfbsd.patch b/sys-process/pidof-bsd/files/pidof-bsd-20050501-gfbsd.patch
new file mode 100644
index 000000000000..bb7a776b630d
--- /dev/null
+++ b/sys-process/pidof-bsd/files/pidof-bsd-20050501-gfbsd.patch
@@ -0,0 +1,128 @@
+? .pidof.c.swp
+? pidof
+? pidof.core
+Index: pidof.c
+===================================================================
+RCS file: /cvsroot/bmp-plugins/pidof/pidof.c,v
+retrieving revision 1.4
+diff -u -r1.4 pidof.c
+--- pidof.c 1 May 2005 16:26:19 -0000 1.4
++++ pidof.c 13 Sep 2005 16:11:08 -0000
+@@ -26,6 +26,7 @@
+ * $Id$
+ */
+
++#include <unistd.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <err.h>
+@@ -37,56 +38,91 @@
+ #include <fcntl.h>
+ #include <stdlib.h>
+ #include <sysexits.h>
++#include <libgen.h>
+
+-static int get_pid_of_process(char *process_name);
++static int get_pid_of_process(const char *process_name);
+ static void usage(void);
+
++static int match_argv;
++static pid_t own_pid;
++
+ static int
+-get_pid_of_process(char *process_name)
++get_pid_of_process(const char *process_name)
+ {
+ static kvm_t *kd = NULL;
+ struct kinfo_proc *p;
+- int i, n_processes, processes_found;
+-
+- processes_found = 0;
++ int i, n_processes,
++ processes_found = 0;
+
+ if ((kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open")) == NULL)
+ (void)errx(1, "%s", kvm_geterr(kd));
+ else {
+ p = kvm_getprocs(kd, KERN_PROC_PROC, 0, &n_processes);
+- for (i = 0; i<n_processes; i++)
+- if (strncmp(process_name, p[i].ki_comm, COMMLEN+1) == 0) {
+- (void)printf("%d ", (int)p[i].ki_pid);
+- processes_found++;
+- }
++ for (i = 0; i<n_processes; i++) {
++ if (p[i].ki_pid != own_pid)
++ if (strncmp(process_name, p[i].ki_comm, COMMLEN+1) == 0) {
++ (void)printf("%d ", (int)p[i].ki_pid);
++ processes_found++;
++ } else if (match_argv == 1) {
++ char **p_argv = NULL;
++
++ if ((p_argv = kvm_getargv(kd, p+i, 0)) != NULL)
++ for (; *p_argv != NULL; p_argv++)
++ if (strcmp(process_name, basename(*p_argv)) == 0) {
++ (void)printf("%d ", (int)p[i].ki_pid);
++ processes_found++;
++ break;
++ }
++ }
++ }
+
+ kvm_close(kd);
+ }
+-
+- return processes_found;
++
++ return (processes_found);
+ }
+
+ static void
+ usage()
+ {
+
+- (void)fprintf(stderr, "usage: pidof name1 name2 ...\n");
++ (void)fprintf(stderr, "usage: pidof [-x] name1 name2 ...\n");
+ exit(EX_USAGE);
+ }
+
+ int
+ main(int argc, char **argv)
+ {
+- int i, procs_found;
++ int i, procs_found,
++ ch;
+
+ procs_found = 0;
++ match_argv = 0;
+
+- if (argc <= 1)
+- usage();
++ own_pid = getpid();
++
++ while ((ch = getopt(argc, argv, "x")) != -1) {
++ switch (ch) {
++ case 'x':
++ match_argv = 1;
++ break;
++ case '?':
++ default:
++ usage();
++ break;
++ }
++ }
++ argc -= optind;
++ argv += optind;
+
+- for (i = 1; i<argc; procs_found += get_pid_of_process(argv[i++]));
++ if (argc < 1)
++ usage();
++
++ for (i = 0; i<argc; i++) {
++ procs_found += get_pid_of_process(argv[i]);
++ }
+
+ (void)printf("\n");
+
+- return (procs_found > 0) ? 0 : 1;
++ return ((procs_found > 0) ? 0 : 1);
+ }
diff --git a/sys-process/pidof-bsd/files/pidof-bsd-20050501-pname.patch b/sys-process/pidof-bsd/files/pidof-bsd-20050501-pname.patch
new file mode 100644
index 000000000000..13e890c6a37c
--- /dev/null
+++ b/sys-process/pidof-bsd/files/pidof-bsd-20050501-pname.patch
@@ -0,0 +1,46 @@
+--- a/pidof.c 2006-09-21 15:14:03 +0100
++++ b/pidof.c 2006-09-21 15:13:47 +0100
+@@ -53,14 +53,22 @@
+ struct kinfo_proc *p;
+ int i, n_processes,
+ processes_found = 0;
++ char *pname = NULL;
++
++ if (process_name == NULL)
++ return 0;
++
++ if ((pname = strdup(basename(process_name))) == NULL)
++ return 0;
+
+- if ((kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open")) == NULL)
+- (void)errx(1, "%s", kvm_geterr(kd));
+- else {
++ if ((kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, NULL)) == NULL) {
++ free(pname);
++ (void)errx(1, "%s", kvm_geterr(kd));
++ } else {
+ p = kvm_getprocs(kd, KERN_PROC_PROC, 0, &n_processes);
+ for (i = 0; i<n_processes; i++) {
+ if (p[i].ki_pid != own_pid)
+- if (strncmp(process_name, p[i].ki_comm, COMMLEN+1) == 0) {
++ if (strncmp(pname, p[i].ki_comm, COMMLEN+1) == 0) {
+ (void)printf("%d ", (int)p[i].ki_pid);
+ processes_found++;
+ } else if (match_argv == 1) {
+@@ -68,7 +76,7 @@
+
+ if ((p_argv = kvm_getargv(kd, p+i, 0)) != NULL)
+ if ( *p_argv != NULL )
+- if (strcmp(process_name, basename(*p_argv)) == 0) {
++ if (strcmp(pname, basename(*p_argv)) == 0) {
+ (void)printf("%d ", (int)p[i].ki_pid);
+ processes_found++;
+ break;
+@@ -77,6 +85,7 @@
+ }
+
+ kvm_close(kd);
++ free(pname);
+ }
+
+ return (processes_found);
diff --git a/sys-process/pidof-bsd/metadata.xml b/sys-process/pidof-bsd/metadata.xml
new file mode 100644
index 000000000000..a00f3aeb1f81
--- /dev/null
+++ b/sys-process/pidof-bsd/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>bsd@gentoo.org</email>
+ <name>BSD Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-process/pidof-bsd/pidof-bsd-20050501-r4.ebuild b/sys-process/pidof-bsd/pidof-bsd-20050501-r4.ebuild
new file mode 100644
index 000000000000..e40003dbc400
--- /dev/null
+++ b/sys-process/pidof-bsd/pidof-bsd-20050501-r4.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit bsdmk
+
+DESCRIPTION="pidof(1) utility for *BSD"
+HOMEPAGE="http://people.freebsd.org/~novel/pidof.html"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND="sys-freebsd/freebsd-mk-defs"
+RDEPEND="!sys-process/psmisc"
+
+S="${WORKDIR}/pidof"
+
+PATCHES=( "${FILESDIR}/${P}-gfbsd.patch"
+ "${FILESDIR}/${P}-firstarg.patch"
+ "${FILESDIR}/${P}-pname.patch"
+ "${FILESDIR}/${P}-fbsd11.patch" )
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+}
+
+src_install() {
+ into /
+ dobin pidof
+}