mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-01-24 02:22:15 +08:00
update sysvinit to 2.88
This commit is contained in:
parent
c337f71d84
commit
0904fcc479
@ -1,100 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 20_pidof.dpatch by Petter Reinholdtsen
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Modify pidof to not print empty line if no pid was found. (bug: #225476)
|
||||
|
||||
@DPATCH@
|
||||
diff -urNad trunk~/src/killall5.c trunk/src/killall5.c
|
||||
--- trunk~/src/killall5.c 2008-03-26 09:30:38.000000000 +0100
|
||||
+++ trunk/src/killall5.c 2008-03-26 09:31:14.000000000 +0100
|
||||
@@ -378,8 +378,8 @@
|
||||
int foundone = 0;
|
||||
int ok = 0;
|
||||
|
||||
- /* Try to stat the executable. */
|
||||
- if (prog[0] == '/' && stat(prog, &st) == 0) dostat++;
|
||||
+ if (! prog)
|
||||
+ return NULL;
|
||||
|
||||
/* Get basename of program. */
|
||||
if ((s = strrchr(prog, '/')) == NULL)
|
||||
@@ -387,9 +387,16 @@
|
||||
else
|
||||
s++;
|
||||
|
||||
+ if (! *s)
|
||||
+ return NULL;
|
||||
+
|
||||
q = (PIDQ_HEAD *)xmalloc(sizeof(PIDQ_HEAD));
|
||||
q = init_pid_q(q);
|
||||
|
||||
+ /* Try to stat the executable. */
|
||||
+ if (prog[0] == '/' && stat(prog, &st) == 0)
|
||||
+ dostat++;
|
||||
+
|
||||
/* First try to find a match based on dev/ino pair. */
|
||||
if (dostat) {
|
||||
for (p = plist; p; p = p->next) {
|
||||
@@ -404,15 +411,35 @@
|
||||
if (!foundone) for (p = plist; p; p = p->next) {
|
||||
ok = 0;
|
||||
|
||||
- /* Compare name (both basename and full path) */
|
||||
- ok += (p->argv0 && strcmp(p->argv0, prog) == 0);
|
||||
- ok += (p->argv0 && strcmp(p->argv0base, s) == 0);
|
||||
+ /* matching nonmatching
|
||||
+ * proc name prog name prog name
|
||||
+ * --- ----------- ------------
|
||||
+ * b b, p/b, q/b
|
||||
+ * p/b b, p/b q/b
|
||||
+ *
|
||||
+ * Algorithm: Match if:
|
||||
+ * cmd = arg
|
||||
+ * or cmd = base(arg)
|
||||
+ * or base(cmd) = arg
|
||||
+ *
|
||||
+ * Specifically, do not match just because base(cmd) = base(arg)
|
||||
+ * as was done in earlier versions of this program, since this
|
||||
+ * allows /aaa/foo to match /bbb/foo .
|
||||
+ */
|
||||
+ ok |=
|
||||
+ (p->argv0 && strcmp(p->argv0, prog) == 0)
|
||||
+ || (p->argv0 && s != prog && strcmp(p->argv0, s) == 0)
|
||||
+ || (p->argv0base && strcmp(p->argv0base, prog) == 0);
|
||||
|
||||
/* For scripts, compare argv[1] as well. */
|
||||
- if (scripts_too && p->argv1 &&
|
||||
- !strncmp(p->statname, p->argv1base, STATNAMELEN)) {
|
||||
- ok += (strcmp(p->argv1, prog) == 0);
|
||||
- ok += (strcmp(p->argv1base, s) == 0);
|
||||
+ if (
|
||||
+ scripts_too && p->statname && p->argv1base
|
||||
+ && !strncmp(p->statname, p->argv1base, STATNAMELEN)
|
||||
+ ) {
|
||||
+ ok |=
|
||||
+ (p->argv1 && strcmp(p->argv1, prog) == 0)
|
||||
+ || (p->argv1 && s != prog && strcmp(p->argv1, s) == 0)
|
||||
+ || (p->argv1base && strcmp(p->argv1base, prog) == 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -423,7 +450,7 @@
|
||||
(p->argv0 == NULL ||
|
||||
p->argv0[0] == 0 ||
|
||||
strchr(p->argv0, ' '))) {
|
||||
- ok += (strcmp(p->statname, s) == 0);
|
||||
+ ok |= (strcmp(p->statname, s) == 0);
|
||||
}
|
||||
if (ok) add_pid_to_q(q, p);
|
||||
}
|
||||
@@ -548,7 +575,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
- printf("\n");
|
||||
+ if (!first)
|
||||
+ printf("\n");
|
||||
closelog();
|
||||
return(first ? 1 : 0);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
2009-04-29 Eric Belanger <eric@archlinux.org>
|
||||
|
||||
* sysvinit 2.86-5
|
||||
* Patched pidof to prevent false positives (close FS#14428)
|
||||
* FHS man pages
|
||||
* Added url
|
||||
* Added ChangeLog
|
@ -1,28 +1,29 @@
|
||||
# $Id: PKGBUILD 37188 2009-05-01 02:26:00Z eric $
|
||||
# Maintainer: Eric Belanger <eric@archlinux.org>
|
||||
# Contributor: judd <jvinet@zeroflux.org>
|
||||
#
|
||||
# Chakra Packages for Chakra, part of chakra-project.org
|
||||
#
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
||||
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
||||
|
||||
pkgname=sysvinit
|
||||
pkgver=2.86
|
||||
pkgrel=5
|
||||
pkgver=2.88
|
||||
pkgrel=1
|
||||
pkgdesc="Linux System V Init"
|
||||
arch=('i686' 'x86_64')
|
||||
url="http://freshmeat.net/projects/sysvinit/"
|
||||
url="http://savannah.nongnu.org/projects/sysvinit"
|
||||
license=('GPL')
|
||||
groups=('base')
|
||||
depends=('shadow' 'util-linux' 'coreutils' 'glibc' 'awk')
|
||||
source=(ftp://ftp.cistron.nl/pub/people/miquels/${pkgname}/${pkgname}-${pkgver}.tar.gz \
|
||||
80_killall_pidof.patch)
|
||||
md5sums=('7d5d61c026122ab791ac04c8a84db967' '3d65ca1e0c47648d1d58cd2af29a1ea4')
|
||||
install=sysvinit.install
|
||||
source=(http://download.savannah.gnu.org/releases/sysvinit/${pkgname}-${pkgver}dsf.tar.bz2)
|
||||
md5sums=('6eda8a97b86e0a6f59dabbf25202aa6f')
|
||||
sha1sums=('f2ca149df1314a91f3007cccd7a0aa47d990de26')
|
||||
|
||||
build() {
|
||||
cd ${srcdir}/${pkgname}-${pkgver}
|
||||
patch -p1 < ../80_killall_pidof.patch || return 1
|
||||
cp src/init.c src/init.c.backup || return 1
|
||||
sed -i 's/\(.*\)\(Sending processes\)\(.*\)/\1\2 started by init\3/' src/init.c || return 1
|
||||
install -d ${pkgdir}/{bin,sbin}
|
||||
install -d ${pkgdir}/usr/{bin,include}
|
||||
install -d ${pkgdir}/usr/share/man/man{1,5,8}
|
||||
make -C src || return 1
|
||||
make -C src ROOT=${pkgdir} install || return 1
|
||||
cd "${srcdir}/${pkgname}-${pkgver}dsf"
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}dsf"
|
||||
make ROOT="${pkgdir}" install
|
||||
}
|
||||
|
3
sysvinit/sysvinit.install
Normal file
3
sysvinit/sysvinit.install
Normal file
@ -0,0 +1,3 @@
|
||||
post_upgrade() {
|
||||
[ -x sbin/init ] && sbin/init u
|
||||
}
|
Loading…
Reference in New Issue
Block a user