Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > c4201dcb4458e8d1d4c3554e8d9b1456 > files > 4

chkconfig-1.3.37-1mdv2009.0.src.rpm

--- chkconfig-1.3.30/chkconfig.c.should	2007-01-20 17:55:59.000000000 +0100
+++ chkconfig-1.3.30/chkconfig.c	2007-01-20 18:00:33.000000000 +0100
@@ -246,6 +246,20 @@
 				}
 			}
 		}
+		if (s->shouldStartDeps) {
+			for (j = 0; s->shouldStartDeps[j] ; j++) {
+				if (!strcmp(s->shouldStartDeps[j], servs[i].name)) {
+					s->sPriority = laterThan(s->sPriority, servs[i].sPriority);
+				}
+				if (servs[i].provides) {
+					for (k = 0; servs[i].provides[k]; k++) {
+						if (!strcmp(s->shouldStartDeps[j], servs[i].provides[k])) {
+							s->sPriority = laterThan(s->sPriority, servs[i].sPriority);
+						}
+					}
+				}
+			}
+		}
 		if (s->stopDeps) {
 			for (j = 0; s->stopDeps[j] ; j++) {
 				if (!strcmp(s->stopDeps[j], servs[i].name)) {
@@ -264,6 +278,20 @@
 				}
 			}
 		}
+		if (s->shouldStopDeps) {
+			for (j = 0; s->shouldStopDeps[j] ; j++) {
+				if (!strcmp(s->shouldStopDeps[j], servs[i].name)) {
+					s->kPriority = earlierThan(s->kPriority, servs[i].kPriority);
+				}
+				if (servs[i].provides) {
+					for (k = 0; servs[i].provides[k]; k++) {
+						if (!strcmp(s->shouldStopDeps[j], servs[i].provides[k])) {
+							s->kPriority = earlierThan(s->kPriority, servs[i].kPriority);
+						}
+					}
+				}
+			}
+		}
 	}
 
 	int resolved = (s0 != s->sPriority) || (k0 != s->kPriority);
--- chkconfig-1.3.30/leveldb.c.should	2006-09-07 20:58:40.000000000 +0200
+++ chkconfig-1.3.30/leveldb.c	2007-01-20 17:24:56.000000000 +0100
@@ -447,6 +447,56 @@
 			else
 				start = t;
 		}
+	} else if (!strncmp(start, "Should-Start:", 13)) {
+		char *t;
+		int numdeps = 0;
+		
+		start+=13;
+		while (1) {
+			while (*start && isspace(*start) && start < end) start++;
+			if (start == end)
+				break;
+			t = start;
+			while (*t && !isspace(*t) && t < end) t++;
+			if (isspace(*t)) {
+				*t = '\0';
+				t++;
+			}
+			numdeps++;
+			serv.shouldStartDeps = realloc(serv.shouldStartDeps,
+						 (numdeps + 1) * sizeof(char *));
+			serv.shouldStartDeps[numdeps-1] = strdup(start);
+			serv.shouldStartDeps[numdeps] = NULL;
+			if (!t || t >= end)
+				break;
+			else
+				start = t;
+		}
+	} else if (!strncmp(start, "Required-Stop:", 12)) {
+		char *t;
+		int numdeps = 0;
+		
+		start+=12;
+		while (1) {
+			while (*start && isspace(*start) && start < end) start++;
+			if (start == end)
+				break;
+			t = start;
+			while (*t && !isspace(*t) && t < end) t++;
+			if (isspace(*t)) {
+				*t = '\0';
+				t++;
+			}
+			numdeps++;
+			serv.shouldStopDeps = realloc(serv.shouldStopDeps,
+						 (numdeps + 1) * sizeof(char *));
+			serv.shouldStopDeps[numdeps-1] = strdup(start);
+			serv.shouldStopDeps[numdeps] = NULL;
+			if (!t || t >= end)
+				break;
+			else
+				start = t;
+		}
 	} else if (!strncmp(start, "Provides:", 9)) {
 		char *t;
 		int numdeps = 0;
--- chkconfig-1.3.30/leveldb.h.should	2007-01-20 14:58:41.000000000 +0100
+++ chkconfig-1.3.30/leveldb.h	2007-01-20 16:47:45.000000000 +0100
@@ -24,7 +24,9 @@
     int levels, kPriority, sPriority;
     char * desc;
     char **startDeps;
+    char **shouldStartDeps;
     char **stopDeps;
+    char **shouldStopDeps;
     char **provides;
     int type;
     int isLSB;