Codebase list openrc / e3b710b
New version of the lsb2rcconf (LSB header support) patch. Thomas Goirand 10 years ago
2 changed file(s) with 41 addition(s) and 26 deletion(s). Raw diff Collapse all Expand all
44 * Adds 2 new patches for the loop solver:
55 - 0130-option-rc_loopsolver_warnings.patch
66 - 0140-loopsolver-doubleprint-fix.patch
7 * New version of the lsb2rcconf (LSB header support) patch.
78
89 -- Thomas Goirand <zigo@debian.org> Sun, 09 Feb 2014 17:34:25 +0800
910
44 issue.
55 Author: Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C, heroxbd <heroxbd@gentoo.org>
66 Origin: upstream
7 Date: 2014-01-21
7 Date: 2014-02-09
88
99 --- a/sh/gendepends.sh.in
1010 +++ b/sh/gendepends.sh.in
246246 +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
247247 +
248248 +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.
249 --- a/src/rc/rc-misc.c
250 +++ b/src/rc/rc-misc.c
251 @@ -296,7 +296,7 @@
252 sigprocmask(SIG_SETMASK, &old, NULL);
253
254 /* Safe to run now */
255 - execl(file, file, "--lockfd", sfd, arg, (char *) NULL);
256 + execl("/sbin/openrc-run", "/sbin/openrc-run", file, "--lockfd", sfd, arg, (char *) NULL);
257 fprintf(stderr, "unable to exec `%s': %s\n",
258 file, strerror(errno));
259 svc_unlock(basename_c(service), fd);
260 --- /dev/null
261 +++ b/src/lsb2rcconf/tests/run.sh
262 @@ -0,0 +1,3 @@
263 +#!/bin/sh
264 +
265 +exit 0
249266 --- /dev/null
250267 +++ b/src/lsb2rcconf/main.c
251 @@ -0,0 +1,640 @@
268 @@ -0,0 +1,654 @@
252269 +/*
253270 + lsb2rcconf - prints configuration for openrc's rc.conf based on LSB
254271 +
301318 +#include <unistd.h> /* access() */
302319 +
303320 +#include "../includes/helpers.h"
321 +
322 +
323 +#define SERVICENAME_ALL "_all"
304324 +
305325 +/* === portability hacks === */
306326 +
403423 + int *relation_count_p;
404424 + int relation_max;
405425 + hsearch_data_t *relation_ht_p;
426 + char relation_has_all; /* did we met "$all" virtual services or not */
406427 +};
407428 +
408429 +#define RELATION(relation_name)\
469490 + switch (*service) {
470491 + case '$': {
471492 + service++;
493 +
494 + if (!arg_p->relation_has_all)
495 + arg_p->relation_has_all = (strcmp(service, "all") == 0);
496 +
472497 + const char *const services = lsb_v2s(service);
473498 + if (services != NULL) {
474499 + void relation_add_mark_real_service(char *service, void *arg) {
625650 +{
626651 + /* Hardcoded: */
627652 + ENTRY entries_v2s[] = {
628 + {"all", "+*"},
629 + {NULL, NULL},
653 + {"all", "+"SERVICENAME_ALL},
654 + {NULL, NULL},
630655 + };
631656 + ENTRY entries_s2v[] = {
632 + {"*", "all"},
633 + {NULL, NULL},
657 + {SERVICENAME_ALL, "all"},
658 + {NULL, NULL},
634659 + };
635660 +
636661 +
684709 + return lsb_x2x(lsb_virtual, &ht_lsb_s2v);
685710 +}
686711 +#endif
687 +
688 +char *lsb_expand(const char *const _services)
712 +#if 0
713 +char *lsb_expand(const char *const _services, int *has_Sall)
689714 +{
690715 + char *ret = xmalloc(BUFSIZ);
691716 + char *ptr = ret, *ret_end = &ret[BUFSIZ];
696721 + switch (*service) {
697722 + case '$': {
698723 + const char * const service_expanded = lsb_v2s(&service[1]);
724 + if (has_Sall != NULL)
725 + has_Sall = (strcmp(&service[1], "all") == 0);
699726 +
700727 + if (service_expanded == NULL)
701728 + return;
723750 + free(services);
724751 + return ret;
725752 +}
726 +
753 +#endif
727754 +static void lsb_header_parse(const char *const header, char *value)
728755 +{
729756 + if (!strcmp(header, "provides")) {
820847 +
821848 +l_lsb_parse_end:
822849 +
850 + if (state == LP_COMPLETE)
851 + if (! (use_arg.relation_has_all || need_arg.relation_has_all))
852 + PROVIDE(SERVICENAME_ALL);
853 +
823854 + fclose(file_initdscript);
824855 + return state;
825856 +}
889920 +
890921 + exit(0);
891922 +}
892 --- a/src/rc/rc-misc.c
893 +++ b/src/rc/rc-misc.c
894 @@ -296,7 +296,7 @@
895 sigprocmask(SIG_SETMASK, &old, NULL);
896
897 /* Safe to run now */
898 - execl(file, file, "--lockfd", sfd, arg, (char *) NULL);
899 + execl("/sbin/openrc-run", "/sbin/openrc-run", file, "--lockfd", sfd, arg, (char *) NULL);
900 fprintf(stderr, "unable to exec `%s': %s\n",
901 file, strerror(errno));
902 svc_unlock(basename_c(service), fd);
903 --- /dev/null
904 +++ b/src/lsb2rcconf/tests/run.sh
905 @@ -0,0 +1,3 @@
906 +#!/bin/sh
907 +
908 +exit 0