summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-process/pidof-bsd/ChangeLog11
-rw-r--r--sys-process/pidof-bsd/Manifest25
-rw-r--r--sys-process/pidof-bsd/files/digest-pidof-bsd-20050501-r13
-rw-r--r--sys-process/pidof-bsd/files/pidof-bsd-20050501-gfbsd.patch128
-rw-r--r--sys-process/pidof-bsd/metadata.xml5
-rw-r--r--sys-process/pidof-bsd/pidof-bsd-20050501-r1.ebuild27
6 files changed, 199 insertions, 0 deletions
diff --git a/sys-process/pidof-bsd/ChangeLog b/sys-process/pidof-bsd/ChangeLog
new file mode 100644
index 000000000000..4ca7a3491b13
--- /dev/null
+++ b/sys-process/pidof-bsd/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for sys-process/pidof-bsd
+# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/pidof-bsd/ChangeLog,v 1.1 2006/04/01 17:01:15 flameeyes Exp $
+
+*pidof-bsd-20050501-r1 (01 Apr 2006)
+
+ 01 Apr 2006; Diego Pettenò <flameeyes@gentoo.org>
+ +files/pidof-bsd-20050501-gfbsd.patch, +metadata.xml,
+ +pidof-bsd-20050501-r1.ebuild:
+ Initial import in portage, from gentoo-alt overlay.
+
diff --git a/sys-process/pidof-bsd/Manifest b/sys-process/pidof-bsd/Manifest
new file mode 100644
index 000000000000..a15a5078cebc
--- /dev/null
+++ b/sys-process/pidof-bsd/Manifest
@@ -0,0 +1,25 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 c9ffc67d764afaf51844679b14eafbc2 ChangeLog 453
+RMD160 1db68f05ab9b8b5facbec508a8ed5ba3d507e63b ChangeLog 453
+SHA256 30d41654966dc6c22bc13de4426bf473c023ce00e463c1c0cccb9a65e73b47d6 ChangeLog 453
+MD5 f9b18b0eda11067150277402f75a049c files/digest-pidof-bsd-20050501-r1 250
+RMD160 f5d0cfefbbc271302ca64f57a40ed1d80029b979 files/digest-pidof-bsd-20050501-r1 250
+SHA256 73ddd421a0ef9f2c58364aa65a37226d03777c743e7fc0f5007c557967a627f0 files/digest-pidof-bsd-20050501-r1 250
+MD5 2e17a247d71dbbdbbf7460cc7e672fed files/pidof-bsd-20050501-gfbsd.patch 2898
+RMD160 e62fa1d1c714014b51be61b95e2e599c92ec1622 files/pidof-bsd-20050501-gfbsd.patch 2898
+SHA256 333984dcdfe27db0478e168366ee31449e5b457764530a840908890d31a688eb files/pidof-bsd-20050501-gfbsd.patch 2898
+MD5 2bd48a5ae413433cbb36110b219ce97c metadata.xml 156
+RMD160 60b5820a08275f307e5bd936d78f5afd1f141086 metadata.xml 156
+SHA256 30ab515d6ac492d3d6c36ac3c675511742c2149e56a6b3228c8d22ab8edb3ff7 metadata.xml 156
+MD5 9bb14a0cc5ee038cead950b6bf6ab6af pidof-bsd-20050501-r1.ebuild 586
+RMD160 c243da65076acb17f35ed8e78eac56c9a9b64d30 pidof-bsd-20050501-r1.ebuild 586
+SHA256 9f9b3ea930f417a7d43c285de859342e205b2ca077092047ec3ba253e481d1da pidof-bsd-20050501-r1.ebuild 586
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2.2 (GNU/Linux)
+
+iD8DBQFELrHqAiZjviIA2XgRAgF4AKC+yZJ4r47UZVeTyvx5fpWWl5/SzgCgwr4T
+b8p1KPSHxeNRrkaB/Fo46VA=
+=eUaL
+-----END PGP SIGNATURE-----
diff --git a/sys-process/pidof-bsd/files/digest-pidof-bsd-20050501-r1 b/sys-process/pidof-bsd/files/digest-pidof-bsd-20050501-r1
new file mode 100644
index 000000000000..a225f6856ac3
--- /dev/null
+++ b/sys-process/pidof-bsd/files/digest-pidof-bsd-20050501-r1
@@ -0,0 +1,3 @@
+MD5 58bcaf9a6e325ef6e5fd175175788e56 pidof-bsd-20050501.tar.gz 1769
+RMD160 1306e7f4b2d6231358d10b45705a16c925bb1d51 pidof-bsd-20050501.tar.gz 1769
+SHA256 c3ed8826178debe872f7717b8810d477d4611ab19af73bed97c5af1c552d20e6 pidof-bsd-20050501.tar.gz 1769
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..8309425d707a
--- /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: pidof-bsd-20050501-gfbsd.patch,v 1.1 2006/04/01 17:01:15 flameeyes Exp $
+ */
+
++#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/metadata.xml b/sys-process/pidof-bsd/metadata.xml
new file mode 100644
index 000000000000..ecedda4aa2cc
--- /dev/null
+++ b/sys-process/pidof-bsd/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>bsd</herd>
+</pkgmetadata>
diff --git a/sys-process/pidof-bsd/pidof-bsd-20050501-r1.ebuild b/sys-process/pidof-bsd/pidof-bsd-20050501-r1.ebuild
new file mode 100644
index 000000000000..a2ebbeab132c
--- /dev/null
+++ b/sys-process/pidof-bsd/pidof-bsd-20050501-r1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/pidof-bsd/pidof-bsd-20050501-r1.ebuild,v 1.1 2006/04/01 17:01:15 flameeyes Exp $
+
+inherit base 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="~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+RDEPEND="!sys-process/psmisc"
+
+S="${WORKDIR}/pidof"
+
+PATCHES="${FILESDIR}/${P}-gfbsd.patch"
+
+src_install() {
+ into /
+ dobin pidof
+}
+