aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Piasek <dagger@gentoo.org>2009-01-13 15:28:08 +0000
committerRobert Piasek <dagger@gentoo.org>2009-01-13 15:28:08 +0000
commit229d7b7108d243823dbc2d52d1331996037b37d7 (patch)
tree4f410cc126c475368e02658e35c8432e7d9bc951 /sys-apps
parentNew ebuild for openmoko-paludis-wrappers (diff)
downloadembedded-cross-229d7b7108d243823dbc2d52d1331996037b37d7.tar.gz
embedded-cross-229d7b7108d243823dbc2d52d1331996037b37d7.tar.bz2
embedded-cross-229d7b7108d243823dbc2d52d1331996037b37d7.zip
Added svn ebuild for openrc. It contains many bugfixes
and it's recommanded for everyone who's using openrc < 0.4.3
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/openrc/files/0.4.1/0001-msg-style.patch46
-rw-r--r--sys-apps/openrc/files/0.4.1/0002-useful-functions.patch80
-rw-r--r--sys-apps/openrc/files/0.4.1/0003-KV.patch120
-rw-r--r--sys-apps/openrc/files/0.4.1/0004-s-s-d-retry.patch54
-rw-r--r--sys-apps/openrc/files/0.4.1/0005-init-script-novserver.patch25
-rw-r--r--sys-apps/openrc/files/0.4.1/0006-openrc-utime.patch510
-rw-r--r--sys-apps/openrc/openrc-9999.ebuild (renamed from sys-apps/openrc/openrc-0.4.1-r2.ebuild)60
7 files changed, 41 insertions, 854 deletions
diff --git a/sys-apps/openrc/files/0.4.1/0001-msg-style.patch b/sys-apps/openrc/files/0.4.1/0001-msg-style.patch
deleted file mode 100644
index ab3559e..0000000
--- a/sys-apps/openrc/files/0.4.1/0001-msg-style.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 1eddb56f11b41c4bf4f878c995c5d140b1f9d44d Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Mon, 24 Mar 2008 01:48:19 -0400
-Subject: [PATCH] This reverts commit 0e2f160c95b15e95f3885e3f5a3670ec5ae0a709. 2 spaces in 80 cols has never made any sort of realistic difference and we're not going to change this behavior in Gentoo.
-
----
- src/libeinfo/libeinfo.c | 9 +++------
- 1 files changed, 3 insertions(+), 6 deletions(-)
-
-diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
-index f8ddcb5..c46cacb 100644
---- a/src/libeinfo/libeinfo.c
-+++ b/src/libeinfo/libeinfo.c
-@@ -787,7 +787,7 @@ static void _eend(FILE * __EINFO_RESTRICT fp, int col, ECOLOR color,
- if (! msg)
- return;
-
-- cols = get_term_columns(fp) - (strlen(msg) + 3);
-+ cols = get_term_columns(fp) - (strlen(msg) + 5);
-
- /* cons25 is special - we need to remove one char, otherwise things
- * do not align properly at all. */
-@@ -801,18 +801,15 @@ static void _eend(FILE * __EINFO_RESTRICT fp, int col, ECOLOR color,
- if (term_is_cons25)
- cols--;
-
-- /* If extra spacing is required around msg, then please change
-- * via a runtime knob and leave this default as is as it saves 2
-- * valuable columns when running on 80 column screens. */
- if (cols > 0 && colour_terminal(fp)) {
-- fprintf(fp, "%s%s %s[%s%s%s]%s\n", up, tgoto(goto_column, 0, cols),
-+ fprintf(fp, "%s%s %s[%s %s %s]%s\n", up, tgoto(goto_column, 0, cols),
- ecolor(ECOLOR_BRACKET), ecolor(color), msg,
- ecolor(ECOLOR_BRACKET), ecolor(ECOLOR_NORMAL));
- } else {
- if (col > 0)
- for (i = 0; i < cols - col; i++)
- fprintf(fp, " ");
-- fprintf(fp, " [%s]\n", msg);
-+ fprintf(fp, " [ %s ]\n", msg);
- }
- }
-
---
-1.5.4.4
-
diff --git a/sys-apps/openrc/files/0.4.1/0002-useful-functions.patch b/sys-apps/openrc/files/0.4.1/0002-useful-functions.patch
deleted file mode 100644
index a307386..0000000
--- a/sys-apps/openrc/files/0.4.1/0002-useful-functions.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 79e8ce8d2ea0ede99aba18d5f9a625a110aa918f Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Mon, 24 Mar 2008 02:03:39 -0400
-Subject: [PATCH] add a softlevel() function to the API so people dont have to worry about inner details and move get_bootparam back to the exported function.sh api
-
----
- sh/functions.sh.in | 22 ++++++++++++++++++++++
- sh/rc-functions.sh.in | 23 -----------------------
- 2 files changed, 22 insertions(+), 23 deletions(-)
-
-diff --git a/sh/functions.sh.in b/sh/functions.sh.in
-index 57917ed..680f534 100644
---- a/sh/functions.sh.in
-+++ b/sh/functions.sh.in
-@@ -42,6 +42,28 @@ rc_runlevel() {
- rc-status --runlevel
- }
-
-+get_bootparam()
-+{
-+ local match="$1"
-+ [ -z "${match}" -o ! -r /proc/cmdline ] && return 1
-+
-+ set -- $(cat /proc/cmdline)
-+ while [ -n "$1" ]; do
-+ case "$1" in
-+ gentoo=*)
-+ local params="${1##*=}"
-+ local IFS=, x=
-+ for x in ${params}; do
-+ [ "${x}" = "${match}" ] && return 0
-+ done
-+ ;;
-+ esac
-+ shift
-+ done
-+
-+ return 1
-+}
-+
- _sanitize_path()
- {
- local IFS=":" p= path=
-diff --git a/sh/rc-functions.sh.in b/sh/rc-functions.sh.in
-index 751d47a..c713def 100644
---- a/sh/rc-functions.sh.in
-+++ b/sh/rc-functions.sh.in
-@@ -51,29 +51,6 @@ is_union_fs()
- unionctl "$1" --list >/dev/null 2>&1
- }
-
--get_bootparam()
--{
-- local match="$1"
-- [ -z "${match}" -o ! -r /proc/cmdline ] && return 1
--
-- set -- $(cat /proc/cmdline)
-- while [ -n "$1" ]; do
-- [ "$1" = "${match}" ] && return 0
-- case "$1" in
-- gentoo=*)
-- local params="${1##*=}"
-- local IFS=, x=
-- for x in ${params}; do
-- [ "${x}" = "${match}" ] && return 0
-- done
-- ;;
-- esac
-- shift
-- done
--
-- return 1
--}
--
- # Add our sbin to $PATH
- case "${PATH}" in
- "${RC_LIBDIR}"/sbin|"${RC_LIBDIR}"/sbin:*);;
---
-1.6.0.2
-
diff --git a/sys-apps/openrc/files/0.4.1/0003-KV.patch b/sys-apps/openrc/files/0.4.1/0003-KV.patch
deleted file mode 100644
index 8ab646f..0000000
--- a/sys-apps/openrc/files/0.4.1/0003-KV.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-From dac703b26c71cd8479b71d101c4e1ddb8eadc194 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Mon, 24 Mar 2008 03:14:02 -0400
-Subject: [PATCH] add back KV_* funcs
-
----
- sh/functions.sh.in | 35 +++++++++++++++++++++++++++++++++++
- sh/runtests.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 80 insertions(+), 0 deletions(-)
-
-diff --git a/sh/functions.sh.in b/sh/functions.sh.in
-index 140f6dc..0522792 100644
---- a/sh/functions.sh.in
-+++ b/sh/functions.sh.in
-@@ -65,6 +65,41 @@ get_bootparam()
- return 1
- }
-
-+KV_major() {
-+ [ -z "$*" ] && return 1
-+ local KV="$*"
-+ echo ${KV%%.*}
-+}
-+
-+KV_minor() {
-+ [ -z "$*" ] && return 1
-+ local KV="$*"
-+ KV=${KV#*.}
-+ echo ${KV%%.*}
-+}
-+
-+KV_micro() {
-+ [ -z "$*" ] && return 1
-+ local KV="$*"
-+ KV=${KV#*.*.}
-+ echo ${KV%%[![:digit:]]*}
-+}
-+
-+KV_to_int() {
-+ [ -z "$*" ] && return 1
-+ local KV_MAJOR="$(KV_major "$*")"
-+ local KV_MINOR="$(KV_minor "$*")"
-+ local KV_MICRO="$(KV_micro "$*")"
-+ local KV_int="$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))"
-+ echo "${KV_int}"
-+}
-+
-+_RC_GET_KV_CACHE=""
-+get_KV() {
-+ [ -z ${_RC_GET_KV_CACHE} ] && _RC_GET_KV_CACHE=$(uname -r)
-+ echo $(KV_to_int "${_RC_GET_KV_CACHE}")
-+}
-+
- _sanitize_path()
- {
- local IFS=":" p= path=
-diff --git a/sh/runtests.sh b/sh/runtests.sh
-index d0d6a17..debcf4f 100755
---- a/sh/runtests.sh
-+++ b/sh/runtests.sh
-@@ -3,6 +3,19 @@
- top_srcdir=${top_srcdir:-..}
- . ${top_srcdir}/test/setup_env.sh
-
-+checkit() {
-+ local output=$($1 $3)
-+ local lret=$?
-+ if [ ${lret} -ne 0 ] ; then
-+ ((tret+=lret))
-+ echo "FAIL: exec: $*"
-+ fi
-+ if [ "${output}" != "$2" ] ; then
-+ ((tret+=lret))
-+ echo "FAIL: output: $* : got='${output}' wanted='$2'"
-+ fi
-+}
-+
- ret=0
-
- tret=0
-@@ -22,4 +35,36 @@ done
- eend ${tret}
- ((ret+=tret))
-
-+compare_int() {
-+ local got=$(KV_to_int $1)
-+ local exp=$(KV_to_int $3)
-+ if ! [ ${got} $2 ${exp} ] ; then
-+ ((tret+=1))
-+ echo "FAIL: KV_to_int '${v}'(${got}) $2 '1.2.2'(${exp})"
-+ fi
-+}
-+
-+tret=0
-+ebegin "Testing KV_{major,minor,micro,to_int}"
-+for v in \
-+ 1.2.3 1.2.3-rc0 1.2.3_rc0 "1.2.3 rc0" \
-+ 1.2.3.4 1.2.3.4-rc0 1.2.3.4_rc0 "1.2.3.4 rc0"
-+do
-+ checkit KV_major 1 ${v}
-+ checkit KV_minor 2 ${v}
-+ checkit KV_micro 3 ${v}
-+
-+ compare_int 1.2.2 -lt ${v}
-+ compare_int 1.2.2.10 -lt ${v}
-+ compare_int 1.2.4 -gt ${v}
-+ compare_int 1.2.4-rc0 -gt ${v}
-+ compare_int 1.2.3 -eq ${v}
-+ compare_int 1.2.3-rc0 -eq ${v}
-+ compare_int 1.2.3.2 -eq ${v}
-+ compare_int 1.2.3.3 -eq ${v}
-+ compare_int 1.2.3.4 -eq ${v}
-+done
-+eend ${tret}
-+((ret+=tret))
-+
- exit ${ret}
---
-1.5.4.4
-
diff --git a/sys-apps/openrc/files/0.4.1/0004-s-s-d-retry.patch b/sys-apps/openrc/files/0.4.1/0004-s-s-d-retry.patch
deleted file mode 100644
index c207c46..0000000
--- a/sys-apps/openrc/files/0.4.1/0004-s-s-d-retry.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-Index: /trunk/src/rc/start-stop-daemon.c
-===================================================================
---- /trunk/src/rc/start-stop-daemon.c (revision 1453)
-+++ /trunk/src/rc/start-stop-daemon.c (revision 1460)
-@@ -627,4 +627,5 @@
- char *name = NULL;
- char *pidfile = NULL;
-+ char *retry = NULL;
- int sig = 0;
- int nicelevel = 0;
-@@ -695,5 +696,5 @@
-
- case 'R': /* --retry <schedule>|<timeout> */
-- parse_schedule(optarg, sig);
-+ retry = optarg;
- break;
-
-@@ -854,5 +855,7 @@
- *--argv = exec;
-
-- if (stop || sig) {
-+ if (stop || sig != 0) {
-+ if (sig == 0)
-+ sig = SIGTERM;
- if (!*argv && !pidfile && !name && !uid)
- eerrorx("%s: --stop needs --exec, --pidfile,"
-@@ -877,4 +880,5 @@
- " with --background", applet);
- }
-+
- /* Expand ~ */
- if (ch_dir && *ch_dir == '~')
-@@ -956,14 +960,14 @@
-
- if (stop || sig) {
-- if (!sig)
-+ if (sig == 0)
- sig = SIGTERM;
- if (!stop)
- oknodo = true;
-- if (!TAILQ_FIRST(&schedule)) {
-- if (test || oknodo)
-- parse_schedule("0", sig);
-- else
-- parse_schedule(NULL, sig);
-- }
-+ if (retry)
-+ parse_schedule(retry, sig);
-+ else if (test || oknodo)
-+ parse_schedule("0", sig);
-+ else
-+ parse_schedule(NULL, sig);
- i = run_stop_schedule(exec, (const char *const *)margv,
- pidfile, uid, quiet, verbose, test);
diff --git a/sys-apps/openrc/files/0.4.1/0005-init-script-novserver.patch b/sys-apps/openrc/files/0.4.1/0005-init-script-novserver.patch
deleted file mode 100644
index 91e14b6..0000000
--- a/sys-apps/openrc/files/0.4.1/0005-init-script-novserver.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Index: init.d/dmesg.in
-===================================================================
---- init.d/dmesg.in (revision 1465)
-+++ init.d/dmesg.in (working copy)
-@@ -7,6 +7,7 @@
- depend()
- {
- before dev modules
-+ keyword novserver
- }
-
- start()
-Index: init.d/sysfs.in
-===================================================================
---- init.d/sysfs.in (revision 1465)
-+++ init.d/sysfs.in (working copy)
-@@ -6,7 +6,7 @@
-
- depend()
- {
-- keyword noprefix
-+ keyword noprefix novserver
- }
-
- mount_sys()
diff --git a/sys-apps/openrc/files/0.4.1/0006-openrc-utime.patch b/sys-apps/openrc/files/0.4.1/0006-openrc-utime.patch
deleted file mode 100644
index c0546f5..0000000
--- a/sys-apps/openrc/files/0.4.1/0006-openrc-utime.patch
+++ /dev/null
@@ -1,510 +0,0 @@
-Index: init.d/savecache.in
-===================================================================
---- init.d/savecache.in (revision 1474)
-+++ init.d/savecache.in (working copy)
-@@ -1,11 +1,18 @@
- #!@PREFIX@/sbin/runscript
--# Copyright 2007-2008 Roy Marples <roy@marples.name>
-+# Copyright 2007-2009 Roy Marples <roy@marples.name>
- # All rights reserved. Released under the 2-clause BSD license.
-
- description="Saves the caches OpenRC uses to non volatile storage"
-
- start()
- {
-+ if [ -e "${RC_SVCDIR}"/clock-skewed ]; then
-+ ewarn "WARNING: clock skew detected!"
-+ if ! yesno "savecache_skewed"; then
-+ eerror "Not saving deptree cache"
-+ return 1
-+ fi
-+ fi
- ebegin "Saving dependency cache"
- if [ ! -d "${RC_LIBDIR}"/cache ]; then
- rm -rf "${RC_LIBDIR}"/cache
-Index: src/rc/rc-depend.c
-===================================================================
---- src/rc/rc-depend.c (revision 1474)
-+++ src/rc/rc-depend.c (working copy)
-@@ -4,7 +4,7 @@
- */
-
- /*
-- * Copyright 2007-2008 Roy Marples <roy@marples.name>
-+ * Copyright 2007-2009 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
-@@ -54,8 +54,10 @@
- int retval;
- int serrno = errno;
- int merrno;
-+ time_t t;
-
-- if (rc_deptree_update_needed()) {
-+ t = 0;
-+ if (rc_deptree_update_needed(&t)) {
- /* Test if we have permission to update the deptree */
- fd = open(RC_DEPTREE_CACHE, O_WRONLY);
- merrno = errno;
-@@ -67,7 +69,7 @@
- if (regen)
- *regen = 1;
- ebegin("Caching service dependencies");
-- retval = rc_deptree_update();
-+ retval = rc_deptree_update(&t);
- eend (retval ? 0 : -1, "Failed to update the dependency tree");
- }
- return rc_deptree_load();
-@@ -142,7 +144,7 @@
-
- if (update) {
- ebegin("Caching service dependencies");
-- update = rc_deptree_update();
-+ update = rc_deptree_update(NULL);
- eend(update ? 0 : -1, "%s: %s", applet, strerror(errno));
- if (!update)
- eerrorx("Failed to update the dependency tree");
-Index: src/rc/rc.c
-===================================================================
---- src/rc/rc.c (revision 1474)
-+++ src/rc/rc.c (working copy)
-@@ -9,7 +9,7 @@
- */
-
- /*
-- * Copyright 2007-2008 Roy Marples <roy@marples.name>
-+ * Copyright 2007-2009 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
-@@ -946,6 +946,8 @@
- /* Load our deptree */
- if ((deptree = _rc_deptree_load(&regen)) == NULL)
- eerrorx("failed to load deptree");
-+ if (exists(RC_DEPTREE_SKEWED))
-+ ewarn("WARNING: clock skew detected!");
-
- /* Clean the failed services state dir */
- clean_failed();
-Index: src/rc/rc-applets.c
-===================================================================
---- src/rc/rc-applets.c (revision 1474)
-+++ src/rc/rc-applets.c (working copy)
-@@ -7,7 +7,7 @@
- */
-
- /*
-- * Copyright 2007-2008 Roy Marples <roy@marples.name>
-+ * Copyright 2007-2009 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
-@@ -451,7 +451,7 @@
- if (argc < 3)
- exit (EXIT_FAILURE);
- while (i < argc) {
-- if (!rc_newer_than(argv[1], argv[i++]))
-+ if (!rc_newer_than(argv[1], argv[i++], NULL))
- exit(EXIT_SUCCESS);
- }
- exit(EXIT_FAILURE);
-@@ -461,7 +461,7 @@
- if (argc < 3)
- exit (EXIT_FAILURE);
- while (i < argc) {
-- if (!rc_newer_than(argv[1], argv[i++]))
-+ if (!rc_newer_than(argv[1], argv[i++], NULL))
- exit(EXIT_FAILURE);
- }
- exit(EXIT_SUCCESS);
-Index: src/includes/rc-misc.h
-===================================================================
---- src/includes/rc-misc.h (revision 1474)
-+++ src/includes/rc-misc.h (working copy)
-@@ -4,7 +4,7 @@
- */
-
- /*
-- * Copyright 2007-2008 Roy Marples <roy@marples.name>
-+ * Copyright 2007-2009 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
-@@ -41,6 +41,7 @@
- #define RC_LEVEL_DEFAULT "default"
-
- #define RC_DEPTREE_CACHE RC_SVCDIR "/deptree"
-+#define RC_DEPTREE_SKEWED RC_SVCDIR "/clock-skewed"
- #define RC_KRUNLEVEL RC_SVCDIR "/krunlevel"
- #define RC_STARTING RC_SVCDIR "/rc.starting"
- #define RC_STOPPING RC_SVCDIR "/rc.stopping"
-Index: src/librc/rc.h.in
-===================================================================
---- src/librc/rc.h.in (revision 1474)
-+++ src/librc/rc.h.in (working copy)
-@@ -1,5 +1,5 @@
- /*
-- * Copyright 2007-2008 Roy Marples <roy@marples.name>
-+ * Copyright 2007-2009 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
-@@ -304,25 +304,31 @@
-
- /*! Check to see if source is newer than target.
- * If target is a directory then we traverse it and it's children.
-+ * time_t returns the time of the newest file found if newer.
- * @return true if source is newer than target, otherwise false */
--bool rc_newer_than(const char *, const char *);
-+bool rc_newer_than(const char *, const char *, time_t *);
-
--/*! Check to see if source is newer than target.
-+/*! Check to see if source is older than target.
- * If target is a directory then we traverse it and it's children.
--* @return true if source is newer than target, otherwise false */
--bool rc_older_than(const char *, const char *);
-+ * time_t returns the time of the oldest file found if older.
-+* @return true if source is older than target, otherwise false */
-+bool rc_older_than(const char *, const char *, time_t *);
-
- /*! Update the cached dependency tree if it's older than any init script,
- * its configuration file or an external configuration file the init script
- * has specified.
-+ * time_t returns the time of the newest file that the dependency tree
-+ * will be checked against.
- * @return true if successful, otherwise false */
--bool rc_deptree_update(void);
-+bool rc_deptree_update(const time_t *);
-
- /*! Check if the cached dependency tree is older than any init script,
- * its configuration file or an external configuration file the init script
- * has specified.
-+ * time_t returns the time of the newest file that the dependency tree
-+ * will be checked against.
- * @return true if it needs updating, otherwise false */
--bool rc_deptree_update_needed(void);
-+bool rc_deptree_update_needed(time_t *);
-
- /*! Load the cached dependency tree and return a pointer to it.
- * This pointer should be freed with rc_deptree_free when done.
-Index: src/librc/librc.h
-===================================================================
---- src/librc/librc.h (revision 1474)
-+++ src/librc/librc.h (working copy)
-@@ -4,7 +4,7 @@
- */
-
- /*
-- * Copyright 2007-2008 Roy Marples <roy@marples.name>
-+ * Copyright 2007-2009 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
-@@ -56,6 +56,7 @@
- #include <strings.h>
- #include <time.h>
- #include <unistd.h>
-+#include <utime.h>
-
- #ifdef BSD
- #include <sys/param.h>
-Index: src/librc/librc-depend.c
-===================================================================
---- src/librc/librc-depend.c (revision 1474)
-+++ src/librc/librc-depend.c (working copy)
-@@ -4,7 +4,7 @@
- */
-
- /*
-- * Copyright 2007-2008 Roy Marples <roy@marples.name>
-+ * Copyright 2007-2009 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
-@@ -544,7 +544,7 @@
- librc_hidden_def(rc_deptree_order)
-
- static bool
--mtime_check(const char *source, const char *target, bool newer)
-+mtime_check(const char *source, const char *target, bool newer, time_t *rel)
- {
- struct stat buf;
- time_t mtime;
-@@ -564,17 +564,29 @@
- return true;
-
- if (newer) {
-- if (mtime < buf.st_mtime)
-- return false;
-+ if (mtime < buf.st_mtime) {
-+ retval = false;
-+ if (rel != NULL) {
-+ if (*rel < buf.st_mtime)
-+ *rel = buf.st_mtime;
-+ } else
-+ return retval;
-+ }
- } else {
-- if (mtime > buf.st_mtime)
-- return false;
-+ if (mtime > buf.st_mtime) {
-+ retval = false;
-+ if (rel != NULL) {
-+ if (*rel > buf.st_mtime)
-+ *rel = buf.st_mtime;
-+ } else
-+ return retval;
-+ }
- }
-
- /* If not a dir then reset errno */
- if (!(dp = opendir(target))) {
- errno = serrno;
-- return true;
-+ return retval;
- }
-
- /* Check all the entries in the dir */
-@@ -582,26 +594,28 @@
- if (d->d_name[0] == '.')
- continue;
- snprintf(path, sizeof(path), "%s/%s", target, d->d_name);
-- retval = mtime_check(source, path, newer);
-- if (!retval)
-- break;
-+ if (!mtime_check(source, path, newer, rel)) {
-+ retval = false;
-+ if (rel == NULL)
-+ break;
-+ }
- }
- closedir(dp);
- return retval;
- }
-
- bool
--rc_newer_than(const char *source, const char *target)
-+rc_newer_than(const char *source, const char *target, time_t *newest)
- {
-
-- return mtime_check(source, target, true);
-+ return mtime_check(source, target, true, newest);
- }
- librc_hidden_def(rc_newer_than)
-
- bool
--rc_older_than(const char *source, const char *target)
-+rc_older_than(const char *source, const char *target, time_t *oldest)
- {
-- return mtime_check(source, target, false);
-+ return mtime_check(source, target, false, oldest);
- }
- librc_hidden_def(rc_older_than)
-
-@@ -638,7 +652,7 @@
- };
-
- bool
--rc_deptree_update_needed(void)
-+rc_deptree_update_needed(time_t *newest)
- {
- bool newer = false;
- RC_STRINGLIST *config;
-@@ -652,31 +666,39 @@
-
- /* Quick test to see if anything we use has changed and we have
- * data in our deptree */
-- if (!existss(RC_DEPTREE_CACHE) ||
-- !rc_newer_than(RC_DEPTREE_CACHE, RC_INITDIR) ||
-- !rc_newer_than(RC_DEPTREE_CACHE, RC_CONFDIR) ||
-+ if (!existss(RC_DEPTREE_CACHE))
-+ return true;
-+ if (!rc_newer_than(RC_DEPTREE_CACHE, RC_INITDIR, newest))
-+ newer = true;
-+ if (!rc_newer_than(RC_DEPTREE_CACHE, RC_CONFDIR, newest))
-+ newer = true;
- #ifdef RC_PKG_INITDIR
-- !rc_newer_than(RC_DEPTREE_CACHE, RC_PKG_INITDIR) ||
-+ if (!rc_newer_than(RC_DEPTREE_CACHE, RC_PKG_INITDIR, newest))
-+ newer = true;
- #endif
- #ifdef RC_PKG_CONFDIR
-- !rc_newer_than(RC_DEPTREE_CACHE, RC_PKG_CONFDIR) ||
-+ if (!rc_newer_than(RC_DEPTREE_CACHE, RC_PKG_CONFDIR, newest))
-+ newer = true;
- #endif
- #ifdef RC_LOCAL_INITDIR
-- !rc_newer_than(RC_DEPTREE_CACHE, RC_LOCAL_INITDIR) ||
-+ if (!rc_newer_than(RC_DEPTREE_CACHE, RC_LOCAL_INITDIR, newest))
-+ newer = true;
- #endif
- #ifdef RC_LOCAL_CONFDIR
-- !rc_newer_than(RC_DEPTREE_CACHE, RC_LOCAL_CONFDIR) ||
-+ if (!rc_newer_than(RC_DEPTREE_CACHE, RC_LOCAL_CONFDIR, newest))
-+ newer = true;
- #endif
-- !rc_newer_than(RC_DEPTREE_CACHE, "/etc/rc.conf"))
-- return true;
-+ if (!rc_newer_than(RC_DEPTREE_CACHE, "/etc/rc.conf", newest))
-+ newer = true;
-
- /* Some init scripts dependencies change depending on config files
- * outside of baselayout, like syslog-ng, so we check those too. */
- config = rc_config_list(RC_DEPCONFIG);
- TAILQ_FOREACH(s, config, entries) {
-- if (!rc_newer_than(RC_DEPTREE_CACHE, s->value)) {
-+ if (!rc_newer_than(RC_DEPTREE_CACHE, s->value, newest)) {
- newer = true;
-- break;
-+ if (newest == NULL)
-+ break;
- }
- }
- rc_stringlist_free(config);
-@@ -694,7 +716,7 @@
- Phase 6 saves the depinfo object to disk
- */
- bool
--rc_deptree_update(void)
-+rc_deptree_update(const time_t *newest)
- {
- FILE *fp;
- RC_DEPTREE *deptree, *providers;
-@@ -708,6 +730,8 @@
- size_t i, k, l;
- bool retval = true;
- const char *sys = rc_sys();
-+ struct stat buf;
-+ struct utimbuf utimbuf;
-
- /* Some init scripts need RC_LIBDIR to source stuff
- Ideally we should be setting our full env instead */
-@@ -958,6 +982,24 @@
- i++;
- }
- fclose(fp);
-+
-+ if (newest) {
-+ stat(RC_DEPTREE_CACHE, &buf);
-+ if (buf.st_mtime < *newest) {
-+ fprintf(stderr, "Clock skew detected!\n"
-+ "Adjusting mtime of `" RC_DEPTREE_CACHE
-+ "' to %s", ctime(newest));
-+ fp = fopen(RC_DEPTREE_SKEWED, "w");
-+ if (fp != NULL)
-+ fclose(fp);
-+ utimbuf.actime = *newest;
-+ utimbuf.modtime = *newest;
-+ utime(RC_DEPTREE_CACHE, &utimbuf);
-+ } else {
-+ if (exists(RC_DEPTREE_SKEWED))
-+ unlink(RC_DEPTREE_SKEWED);
-+ }
-+ }
- } else {
- fprintf(stderr, "fopen `%s': %s\n",
- RC_DEPTREE_CACHE, strerror(errno));
-Index: man/rc-update.8
-===================================================================
---- man/rc-update.8 (revision 1474)
-+++ man/rc-update.8 (working copy)
-@@ -1,4 +1,4 @@
--.\" Copyright 2007-2008 Roy Marples
-+.\" Copyright 2007-2009 Roy Marples
- .\" All rights reserved
- .\"
- .\" Redistribution and use in source and binary forms, with or without
-@@ -22,7 +22,7 @@
- .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- .\" SUCH DAMAGE.
- .\"
--.Dd Jan 15, 2008
-+.Dd Jan 10, 2009
- .Dt RC-UPDATE 8 SMM
- .Os OpenRC
- .Sh NAME
-@@ -38,6 +38,7 @@
- .Ar service
- .Op Ar runlevel ...
- .Nm
-+.Op Fl u , -update
- .Op Fl v , -verbose
- .Ar show
- .Op Ar runlevel ...
-@@ -53,7 +54,7 @@
- directories. They must also conform to the OpenRC runscript standard.
- .Pp
- .Bl -tag -width "Fl a , -delete service"
--.It Fl a , -add Ar service
-+.It Ar add Ar service
- Add the
- .Ar service
- to the
-@@ -72,6 +73,10 @@
- runlevels to show, then only those will be included in the output.
- .It Fl v , -verbose
- Show all services.
-+.It Fl u , -update
-+Forces an update of the dependency tree cache.
-+This may be needed in the even of clock skew (a file in /etc is newer than the
-+system clock).
- .El
- .Sh SEE ALSO
- .Xr rc 8 ,
-
-Index: src/rc/rc-update.c
-===================================================================
---- src/rc/rc-update.c~ 2008-12-23 10:45:41.000000000 +0000
-+++ src/rc/rc-update.c 2009-01-12 13:05:05.473806298 +0000
-@@ -4,7 +4,7 @@
- */
-
- /*
-- * Copyright 2007-2008 Roy Marples <roy@marples.name>
-+ * Copyright 2007-2009 Roy Marples <roy@marples.name>
- * All rights reserved
-
- * Redistribution and use in source and binary forms, with or without
-@@ -135,11 +135,13 @@
- "Usage: rc-update [options] add service <runlevel>\n" \
- " rc-update [options] del service <runlevel>\n" \
- " rc-update [options] show"
--#define getoptstring getoptstring_COMMON
-+#define getoptstring "u" getoptstring_COMMON
- static const struct option longopts[] = {
-+ { "update", 0, NULL, 'u' },
- longopts_COMMON
- };
- static const char * const longopts_help[] = {
-+ "Force an update of the dependency tree",
- longopts_help_COMMON
- };
- #include "_usage.c"
-@@ -155,7 +157,7 @@
- char *service = NULL;
- char *p;
- int action = 0;
-- bool verbose = false;
-+ bool verbose = false, update;
- int opt;
- int retval = EXIT_FAILURE;
- int num_updated = 0;
-@@ -163,8 +165,15 @@
- int ret;
-
- while ((opt = getopt_long(argc, argv, getoptstring,
-- longopts, (int *) 0)) != -1)
-+ longopts, (int *)0)) != -1)
- switch (opt) {
-+ case 'u':
-+ ebegin("Caching service dependencies");
-+ update = rc_deptree_update(NULL);
-+ eend(update ? 0 : -1, "%s: %s", applet, strerror(errno));
-+ if (!update)
-+ eerrorx("Failed to update the dependency tree");
-+ return 0;
- case_RC_COMMON_GETOPT
- }
-
-
diff --git a/sys-apps/openrc/openrc-0.4.1-r2.ebuild b/sys-apps/openrc/openrc-9999.ebuild
index 8e7f36d..61646ab 100644
--- a/sys-apps/openrc/openrc-0.4.1-r2.ebuild
+++ b/sys-apps/openrc/openrc-9999.ebuild
@@ -1,13 +1,12 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.4.0.ebuild,v 1.1 2008/12/10 22:04:46 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-9999.ebuild,v 1.43 2008/12/31 21:31:40 cardoe Exp $
inherit eutils flag-o-matic multilib toolchain-funcs
if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/openrc.git"
- EGIT_BRANCH="master"
- inherit git
+ ESVN_REPO_URI="svn://roy.marples.name/openrc/trunk"
+ inherit subversion
else
SRC_URI="http://roy.marples.name/downloads/${PN}/${P}.tar.bz2
mirror://gentoo/${P}.tar.bz2
@@ -20,19 +19,20 @@ HOMEPAGE="http://roy.marples.name/openrc"
LICENSE="BSD-2"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
-IUSE="debug ncurses pam unicode kernel_linux kernel_FreeBSD"
+KEYWORDS=""
+IUSE="debug elibc_glibc ncurses pam unicode kernel_linux kernel_FreeBSD"
RDEPEND="virtual/init
- kernel_linux? ( virtual/modutils )
kernel_FreeBSD? ( sys-process/fuser-bsd )
elibc_glibc? ( >=sys-libs/glibc-2.5 )
ncurses? ( sys-libs/ncurses )
pam? ( virtual/pam )
>=sys-apps/baselayout-2.0.0
+ kernel_linux? ( !<sys-apps/module-init-tools-3.2.2-r2 )
!<sys-fs/udev-133
- !<sys-fs/sysvinit-2.86-r11"
-DEPEND="virtual/os-headers"
+ !<sys-apps/sysvinit-2.86-r11"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
pkg_setup() {
LIBDIR="lib"
@@ -57,12 +57,12 @@ pkg_setup() {
src_unpack() {
if [[ ${PV} == "9999" ]] ; then
- git_src_unpack
+ subversion_src_unpack
else
unpack ${A}
fi
cd "${S}"
- epatch "${FILESDIR}"/${PV}/*.patch
+ epatch "${FILESDIR}"/9999/*.patch
}
src_compile() {
@@ -72,8 +72,8 @@ src_compile() {
fi
if [[ ${PV} == "9999" ]] ; then
- local ver="git-$(git --git-dir=${EGIT_STORE_DIR}/${EGIT_PROJECT} rev-parse --verify ${EGIT_BRANCH} | cut -c1-8)"
- sed -i "/^VERSION[[:space:]]*=/s:=.*:=${ver}:" Makefile
+ local ver="-svn-$(cd "${ESVN_STORE_DIR}/${ESVN_PROJECT}/${ESVN_REPO_URI##*/}"; LC_ALL=C svn info|awk '/Revision/ { print $2 }')"
+ sed -i "/^SVNVER[[:space:]]*=/s:=.*:=${ver}:" src/rc/Makefile
fi
tc-export CC AR RANLIB
@@ -141,6 +141,9 @@ pkg_preinst() {
if [[ -e ${ROOT}/etc/conf.d/clock ]] ; then
mv "${ROOT}"/etc/conf.d/clock "${ROOT}"/etc/conf.d/${clock}
fi
+ if [[ -e ${ROOT}/etc/init.d/clock ]] ; then
+ rm -f "${ROOT}"/etc/init.d/clock
+ fi
if [[ -L ${ROOT}/etc/runlevels/boot/clock ]] ; then
rm -f "${ROOT}"/etc/runlevels/boot/clock
ln -snf /etc/init.d/${clock} "${ROOT}"/etc/runlevels/boot/${clock}
@@ -170,8 +173,24 @@ pkg_preinst() {
fi
done
- # termencoding was added in 0.2.1 and needed in boot
- has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+ # openrc-0.4.0 no longer loads the udev addon
+ enable_udev=0
+ if [[ ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && \
+ [[ -e "${ROOT}"/etc/init.d/udev ]] && \
+ ! has_version ">=sys-apps/openrc-0.4.0"
+ then
+ # make sure udev is in sysinit if it was enabled before
+ local rc_devices=$(
+ [[ -f /etc/rc.conf ]] && source /etc/rc.conf
+ [[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc
+ echo "${rc_devices:-${RC_DEVICES:-auto}}"
+ )
+ case ${rc_devices} in
+ udev|auto)
+ enable_udev=1
+ ;;
+ esac
+ fi
# skip remaining migration if we already have openrc installed
has_version sys-apps/openrc && return 0
@@ -261,16 +280,19 @@ pkg_postinst() {
else
if [[ ! -e ${ROOT}/etc/runlevels/sysinit/devfs ]] ; then
mkdir -p "${ROOT}"/etc/runlevels/sysinit
- cp -RPp "${ROOT}"/usr/share/${PN}/runlevels/sysinit/* \
- "${ROOT}"/etc/runlevels/sysinit
+ cp -RPp "${ROOT}"/usr/share/${PN}/runlevels/sysinit/* "${ROOT}"/etc/runlevels/sysinit
fi
if [[ ! -e ${ROOT}/etc/runlevels/shutdown/mount-ro ]] ; then
mkdir -p "${ROOT}"/etc/runlevels/shutdown
- cp -RPp "${ROOT}"/usr/share/${PN}/runlevels/shutdown/* \
- "${ROOT}"/etc/runlevels/shutdown
+ cp -RPp "${ROOT}"/usr/share/${PN}/runlevels/shutdown/* "${ROOT}"/etc/runlevels/shutdown
fi
fi
+ if [[ "$enable_udev" = 1 ]]; then
+ elog "Auto adding udev init script to the sysinit runlevel"
+ ln -sf /etc/init.d/udev "${ROOT}"/etc/runlevels/sysinit/udev
+ fi
+
# update the dependency tree bug #224171
[[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u