diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-process/pidof-bsd | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-process/pidof-bsd')
-rw-r--r-- | sys-process/pidof-bsd/Manifest | 1 | ||||
-rw-r--r-- | sys-process/pidof-bsd/files/pidof-bsd-20050501-fbsd10.patch | 18 | ||||
-rw-r--r-- | sys-process/pidof-bsd/files/pidof-bsd-20050501-firstarg.patch | 13 | ||||
-rw-r--r-- | sys-process/pidof-bsd/files/pidof-bsd-20050501-gfbsd.patch | 128 | ||||
-rw-r--r-- | sys-process/pidof-bsd/files/pidof-bsd-20050501-pname.patch | 46 | ||||
-rw-r--r-- | sys-process/pidof-bsd/metadata.xml | 5 | ||||
-rw-r--r-- | sys-process/pidof-bsd/pidof-bsd-20050501-r4.ebuild | 29 |
7 files changed, 240 insertions, 0 deletions
diff --git a/sys-process/pidof-bsd/Manifest b/sys-process/pidof-bsd/Manifest new file mode 100644 index 000000000000..472bce62f713 --- /dev/null +++ b/sys-process/pidof-bsd/Manifest @@ -0,0 +1 @@ +DIST pidof-bsd-20050501.tar.gz 1769 SHA256 c3ed8826178debe872f7717b8810d477d4611ab19af73bed97c5af1c552d20e6 diff --git a/sys-process/pidof-bsd/files/pidof-bsd-20050501-fbsd10.patch b/sys-process/pidof-bsd/files/pidof-bsd-20050501-fbsd10.patch new file mode 100644 index 000000000000..5c7382e1344f --- /dev/null +++ b/sys-process/pidof-bsd/files/pidof-bsd-20050501-fbsd10.patch @@ -0,0 +1,18 @@ +share/mk/bsd.compat.mk has been removed from FreeBSD 10.0. +An old style NOMAN is not supported anymore. + +https://bugs.gentoo.org/show_bug.cgi?id=483044 + +diff --git a/Makefile b/Makefile +index d2d760b..446bd6f 100644 +--- a/Makefile ++++ b/Makefile +@@ -2,7 +2,7 @@ + + PROG= pidof + SRCS= pidof.c +-NOMAN= yes ++NO_MAN= yes + LDADD= -lkvm + LINKS= ${BINDIR}/pidof + 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..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-r4.ebuild b/sys-process/pidof-bsd/pidof-bsd-20050501-r4.ebuild new file mode 100644 index 000000000000..65fd527c014e --- /dev/null +++ b/sys-process/pidof-bsd/pidof-bsd-20050501-r4.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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="~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}-fbsd10.patch" ) + +src_install() { + into / + dobin pidof +} |