]> git.pld-linux.org Git - packages/chkconfig.git/blobdiff - chkconfig-add.patch
up to 1.6 (fixes systemd<->sysv "ping-pong" issue)
[packages/chkconfig.git] / chkconfig-add.patch
index 330177fb11b6b9017da4cdb9e4af96c14b4d65c9..cedbb047352b522e358a6383e269b2b121b731dc 100644 (file)
@@ -1,19 +1,18 @@
-diff -Nru chkconfig-1.2.24h.orig/chkconfig.c chkconfig-1.2.24h/chkconfig.c
---- chkconfig-1.2.24h.orig/chkconfig.c Wed Jul 17 20:10:55 2002
-+++ chkconfig-1.2.24h/chkconfig.c      Wed Jan 22 11:56:32 2003
-@@ -31,6 +31,7 @@
- #include <sys/stat.h>
+--- chkconfig-1.3.58/chkconfig.c~      2012-12-04 15:41:14.000000000 +0200
++++ chkconfig-1.3.58/chkconfig.c       2012-12-04 15:42:06.080488828 +0200
+@@ -27,6 +27,7 @@
  #include <unistd.h>
  static char *progname;
 +extern int addItem;
- struct config conf;           // used by leveldb.c
  
  #define _(String) gettext((String)) 
-@@ -94,12 +95,10 @@
-     if (s.type == TYPE_XINETD) return 0;
-     
-     for (i = 0; i <= conf.maxlevel; i++) {
--      if (!isConfigured(name, i)) {
+@@ -243,12 +244,10 @@
+               frobDependencies(&s);
+     else
+     for (i = 0; i < 7; i++) {
+-      if (!isConfigured(name, i, NULL, NULL)) {
            if ((1 << i) & s.levels)
                doSetService(s, i, 1);
            else
@@ -22,56 +21,55 @@ diff -Nru chkconfig-1.2.24h.orig/chkconfig.c chkconfig-1.2.24h/chkconfig.c
      }
  
      return 0;
-@@ -275,7 +274,7 @@
+@@ -626,7 +626,7 @@
+ }
  
- int main(int argc, char ** argv) {
--    int listItem = 0, addItem = 0, delItem = 0;
-+    int listItem = 0, delItem = 0;
+ int main(int argc, const char ** argv) {
+-    int listItem = 0, addItem = 0, delItem = 0, overrideItem = 0, noRedirectItem = 0;
++    int listItem = 0, delItem = 0, overrideItem = 0, noRedirectItem = 0;
+     int type = TYPE_ANY;
      int rc, i, x;
      char * levels = NULL;
-     int help=0, version=0;
-diff -Nru chkconfig-1.2.24h.orig/leveldb.c chkconfig-1.2.24h/leveldb.c
---- chkconfig-1.2.24h.orig/leveldb.c   Fri Apr 19 03:15:55 2002
-+++ chkconfig-1.2.24h/leveldb.c        Wed Jan 22 12:04:47 2003
-@@ -11,6 +11,10 @@
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
+--- chkconfig-1.4/leveldb.c~   2015-04-25 12:18:41.000000000 +0300
++++ chkconfig-1.4/leveldb.c    2015-04-25 12:19:52.959858162 +0300
+@@ -22,6 +22,7 @@
+ #include <libintl.h>
+ #include <locale.h>
+ #include <sys/mman.h>
 +#include <sys/types.h>
-+#include <dirent.h>
-+
-+int addItem = 0;
- /* Changes
-    2001-12-03 - Petter Reinholdtsen <pere@hungry.com>
-@@ -231,6 +235,9 @@
-     char overflow;
-     char levelbuf[20];
-     char * english_desc = NULL;
-+    DIR *dir;
-+    struct dirent *dirent;
-+    int i;
-     sprintf(filename, "%s/%s", conf.initdir, name);
+ #include <sys/stat.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -41,6 +42,8 @@
  
-@@ -345,6 +352,21 @@
+ #include "leveldb.h"
  
-     serv.name = strdup(name);
++int addItem = 0;
++
+ int selinux_restore(const char *name) {
+         struct selabel_handle *hnd = NULL;
+         struct stat buf;
+@@ -563,6 +567,25 @@
+           serv.provides[1] = NULL;
+     }
  
 +    if (addItem) {
-+      strcpy(levelbuf,"/etc/rc.d/rc0.d");
-+      for(i=0;i<7;i++,levelbuf[12]++) {
-+          dir=opendir(levelbuf);
-+          if (!dir) return 1;
-+          while ((dirent=readdir(dir))) {
-+              if (strlen(dirent->d_name)<4) continue;
-+              if (strcmp(dirent->d_name+3,name)) continue;
-+              if (*dirent->d_name=='K') serv.levels &= ~(1<<i);
-+              else if (*dirent->d_name=='S') serv.levels |= 1<<i;
++          DIR *dir;
++          struct dirent *dirent;
++          int i;
++
++          strcpy(levelbuf,"/etc/rc.d/rc0.d");
++          for(i=0;i<7;i++,levelbuf[12]++) {
++                  dir=opendir(levelbuf);
++                  if (!dir) return 1;
++                  while ((dirent=readdir(dir))) {
++                          if (strlen(dirent->d_name)<4) continue;
++                          if (strcmp(dirent->d_name+3,name)) continue;
++                          if (*dirent->d_name=='K') serv.levels &= ~(1<<i);
++                          else if (*dirent->d_name=='S') serv.levels |= 1<<i;
++                  }
++                  closedir(dir);
 +          }
-+          closedir(dir);
-+      }
 +    }
 +
      *service = serv;
This page took 0.067526 seconds and 4 git commands to generate.