Codebase list openrc / 0c3269c
debian/patches: refresh patches. Benda Xu 8 years ago
2 changed file(s) with 50 addition(s) and 47 deletion(s). Raw diff Collapse all Expand all
290290 +
291291 --- a/src/librc/rc.h.in
292292 +++ b/src/librc/rc.h.in
293 @@ -404,13 +404,26 @@
293 @@ -405,13 +405,26 @@
294294 * @return pointer to the value, otherwise NULL */
295295 char *rc_proc_getent(const char *);
296296
320320 * its configuration file or an external configuration file the init script
321321 --- a/src/rc/rc-misc.c
322322 +++ b/src/rc/rc-misc.c
323 @@ -517,7 +517,13 @@
323 @@ -358,7 +358,13 @@
324324 if (regen)
325325 *regen = 1;
326326 ebegin("Caching service dependencies");
382382 static const char *bootlevel = NULL;
383383
384384 static char *
385 @@ -717,17 +747,742 @@
385 @@ -717,7 +747,731 @@
386386 }
387387 librc_hidden_def(rc_deptree_update_needed)
388388
389 -/* This is a 6 phase operation
389 -/* This is a 7 phase operation
390390 +static inline int
391391 +unapm_expandsdeps(service_id_t **unap, service_id_t service_id)
392392 +{
11111111 + return;
11121112 +}
11131113 +
1114 +/* This is a 7 phase operation
1114 +/* This is an 8 phase operation
11151115 Phase 1 is a shell script which loads each init script and config in turn
11161116 and echos their dependency info to stdout
11171117 Phase 2 takes that and populates a depinfo object with that data
1118 Phase 3 adds any provided services to the depinfo object
1119 Phase 4 scans that depinfo object and puts in backlinks
1118 @@ -726,10 +1480,11 @@
11201119 Phase 5 removes broken before dependencies
1121 - Phase 6 saves the depinfo object to disk
1122 + Phase 6 check for loops
1123 + Phase 7 saves the depinfo object to disk
1120 Phase 6 looks for duplicate services indicating a real and virtual service
1121 with the same names
1122 - Phase 7 saves the depinfo object to disk
1123 + Phase 7 check for loops
1124 + Phase 8 saves the depinfo object to disk
11241125 */
11251126 bool
11261127 -rc_deptree_update(void)
11281129 {
11291130 FILE *fp;
11301131 RC_DEPTREE *deptree, *providers;
1131 @@ -742,6 +1497,7 @@
1132 @@ -744,6 +1499,7 @@
11321133 bool retval = true;
1133 const char *sys = NULL;
1134 const char *sys = rc_sys();
11341135 struct utsname uts;
11351136 + unsigned int useneedafter_count=0;
1137 int serrno;
11361138
11371139 /* Some init scripts need RC_LIBEXECDIR to source stuff
1138 Ideally we should be setting our full env instead */
11391140 @@ -956,6 +1712,8 @@
11401141 rc_stringlist_add(types, "iuse");
11411142 rc_stringlist_add(types, "iafter");
11451146 deptype = get_deptype(depinfo, "ibefore");
11461147 if (!deptype)
11471148 continue;
1148 @@ -999,7 +1757,108 @@
1149 @@ -1014,7 +1772,108 @@
11491150 }
1150 rc_stringlist_free(types);
1151
1152 - /* Phase 6 - save to disk
1153 + /* Phase 6 - check for loops (non-recursive way) */
1151 rc_stringlist_free(dupes);
1152
1153 - /* Phase 7 - save to disk
1154 + /* Phase 7 - check for loops (non-recursive way) */
11541155 + if (flags & RCDTFLAGS_LOOPSOLVER)
11551156 + {
11561157 + int loopfound;
12511252 + tdestroy(svc_id2depinfo_bt, free);
12521253 + }
12531254 +
1254 + /* Phase 7 - save to disk
1255 + /* Phase 8 - save to disk
12551256 Now that we're purely in C, do we need to keep a shell parseable file?
12561257 I think yes as then it stays human readable
12571258 This works and should be entirely shell parseable provided that depend
4545 +++ b/sh/openrc-run.sh.in
4646 @@ -246,30 +246,35 @@
4747 done
48
48
4949 # Load our script
5050 -sourcex "$RC_SERVICE"
51 -
52 -eval "printf '%s\n' $required_dirs" | while read _d; do
53 - if [ -n "$_d" ] && [ ! -d "$_d" ]; then
54 - eerror "$RC_SVCNAME: \`$_d' is not a directory"
55 - exit 1
5156 +lsbh=$(lsb2rcconf "$RC_SERVICE")
5257 +if [ -n "${lsbh}" ]; then
5358 + eval "${lsbh}"
5459 +else
5560 + sourcex "$RC_SERVICE"
56
57 -eval "printf '%s\n' $required_dirs" | while read _d; do
58 - if [ -n "$_d" ] && [ ! -d "$_d" ]; then
59 - eerror "$RC_SVCNAME: \`$_d' is not a directory"
60 - exit 1
61 - fi
62 -done
63 -[ $? -ne 0 ] && exit 1
64 -unset _d
61 +
6562 + eval "printf '%s\n' $required_dirs" | while read _d; do
6663 + if [ -n "$_d" ] && [ ! -d "$_d" ]; then
6764 + eerror "$RC_SVCNAME: \`$_d' is not a directory"
7067 + done
7168 + [ $? -ne 0 ] && exit 1
7269 + unset _d
73
70 +
71 + eval "printf '%s\n' $required_files" | while read _f; do
72 + if [ -n "$_f" ] && [ ! -r "$_f" ]; then
73 + eerror "$RC_SVCNAME: \`$_f' is not readable"
74 + exit 1
75 + fi
76 + done
77 + [ $? -ne 0 ] && exit 1
78 + unset _f
79 +
80 + if [ -n "$opts" ]; then
81 + ewarn "Use of the opts variable is deprecated and will be"
82 + ewarn "removed in the future."
83 + ewarn "Please use extra_commands, extra_started_commands or extra_stopped_commands."
84 fi
85 -done
86 -[ $? -ne 0 ] && exit 1
87 -unset _d
88 -
7489 -eval "printf '%s\n' $required_files" | while read _f; do
7590 - if [ -n "$_f" ] && [ ! -r "$_f" ]; then
7691 - eerror "$RC_SVCNAME: \`$_f' is not readable"
7994 -done
8095 -[ $? -ne 0 ] && exit 1
8196 -unset _f
82 + eval "printf '%s\n' $required_files" | while read _f; do
83 + if [ -n "$_f" ] && [ ! -r "$_f" ]; then
84 + eerror "$RC_SVCNAME: \`$_f' is not readable"
85 + exit 1
86 + fi
87 + done
88 + [ $? -ne 0 ] && exit 1
89 + unset _f
90
97 -
9198 -if [ -n "$opts" ]; then
9299 - ewarn "Use of the opts variable is deprecated and will be"
93100 - ewarn "removed in the future."
94101 - ewarn "Please use extra_commands, extra_started_commands or extra_stopped_commands."
95 + if [ -n "$opts" ]; then
96 + ewarn "Use of the opts variable is deprecated and will be"
97 + ewarn "removed in the future."
98 + ewarn "Please use extra_commands, extra_started_commands or extra_stopped_commands."
99 + fi
100102 fi
101103
102104 while [ -n "$1" ]; do
126128 SUBDIR+= tools
127129 --- a/src/librc/librc-depend.c
128130 +++ b/src/librc/librc-depend.c
129 @@ -1565,14 +1565,6 @@
131 @@ -1568,14 +1568,6 @@
130132 strcmp(depend, service) == 0)
131133 continue;
132134
157159 }
158160 if (options & LS_DIR) {
159161 snprintf(file, sizeof(file), "%s/%s",
160 @@ -511,16 +504,6 @@
162 @@ -570,16 +563,6 @@
161163 errno = EINVAL;
162164 return false;
163165 }
250252 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251253 --- a/src/rc/rc-misc.c
252254 +++ b/src/rc/rc-misc.c
253 @@ -286,7 +286,7 @@
255 @@ -284,7 +284,7 @@
254256 sigprocmask(SIG_SETMASK, &old, NULL);
255257
256258 /* Safe to run now */