[packages/chkconfig] up to 1.4

glen glen at pld-linux.org
Sat Apr 25 11:30:45 CEST 2015


commit 5edaa7566695f73a5def713118b1f7cac10789c9
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Apr 25 12:18:21 2015 +0300

    up to 1.4
    
    it's not major change, just "lets simplify version"

 chkconfig-add.patch      | 29 ++++++++-------
 chkconfig-noxinet.patch  | 92 ++++++++++++++++++++++++++++--------------------
 chkconfig-optflags.patch |  8 ++---
 chkconfig.spec           |  8 +++--
 4 files changed, 79 insertions(+), 58 deletions(-)
---
diff --git a/chkconfig.spec b/chkconfig.spec
index 62357df..59b664e 100644
--- a/chkconfig.spec
+++ b/chkconfig.spec
@@ -9,19 +9,21 @@ Summary(ru.UTF-8):	Системная утилита для управления
 Summary(tr.UTF-8):	Sistem servis bilgilerini sorgular ve yeniler
 Summary(uk.UTF-8):	Системна утиліта для керування ієрархією /etc/rc.d
 Name:		chkconfig
-Version:	1.3.63
-Release:	2
+Version:	1.4
+Release:	1
 Epoch:		2
 License:	GPL v2
 Group:		Applications/System
 Source0:	https://fedorahosted.org/releases/c/h/chkconfig/%{name}-%{version}.tar.bz2
-# Source0-md5:	7a9d030aa0915b8e9341a930e95d68e6
+# Source0-md5:	487dd7b760d6d2154f045797b3eecc00
 Patch0:		%{name}-add.patch
 Patch1:		%{name}-noxinet.patch
 Patch2:		%{name}-rc.d.patch
 Patch3:		%{name}-optflags.patch
 Patch4:		%{name}-pl.patch
+URL:		https://git.fedorahosted.org/git/chkconfig.git
 BuildRequires:	gettext-tools
+BuildRequires:	libselinux-devel
 BuildRequires:	newt-devel
 BuildRequires:	popt-devel
 Requires:	rc-scripts
diff --git a/chkconfig-add.patch b/chkconfig-add.patch
index 6105620..cedbb04 100644
--- a/chkconfig-add.patch
+++ b/chkconfig-add.patch
@@ -30,20 +30,25 @@
      int type = TYPE_ANY;
      int rc, i, x;
      char * levels = NULL;
-diff -urN chkconfig-1.3.37.org/leveldb.c chkconfig-1.3.37/leveldb.c
---- chkconfig-1.3.37.org/leveldb.c	2007-08-03 19:57:56.000000000 +0200
-+++ chkconfig-1.3.37/leveldb.c	2008-04-24 09:27:34.124665839 +0200
-@@ -26,6 +26,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;
+ #include <sys/stat.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -41,6 +42,8 @@
+ 
+ #include "leveldb.h"
  
- /* Changes
-    1998-09-22 - Arnaldo Carvalho de Melo <acme at conectiva.com.br>
++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;
      }
diff --git a/chkconfig-noxinet.patch b/chkconfig-noxinet.patch
index 07110de..b6a4fe0 100644
--- a/chkconfig-noxinet.patch
+++ b/chkconfig-noxinet.patch
@@ -17,8 +17,8 @@
  .SH OPTIONS
  .TP
  \fB-\-level \fIlevels\fR
---- chkconfig-1.3.63/chkconfig.c	2014-11-30 14:57:06.299908151 +0200
-+++ chkconfig-1.3.63.no-xinetd/chkconfig.c	2014-11-30 14:55:40.542232924 +0200
+--- chkconfig-1.4/chkconfig.c~	2015-04-25 12:27:57.000000000 +0300
++++ chkconfig-1.4/chkconfig.c	2015-04-25 12:29:08.685346749 +0300
 @@ -102,7 +102,6 @@
  	readServiceError(rc, name);
  	return 1;
@@ -55,6 +55,15 @@
  
      for (i = 0; i < 7; i++) {
  	printf("\t%d:%s", i, isOn(s.name, i) ? _("on") : _("off"));
+@@ -425,7 +425,7 @@
+     int rc;
+     struct service s;
+ 
+-    if (systemdActive() && isOverriddenBySystemd(name) && !(type & TYPE_XINETD)) {
++    if (systemdActive() && isOverriddenBySystemd(name)) {
+         return forgiving ? 0 : 1;
+     }
+ 
 @@ -448,33 +440,10 @@
      return showServiceInfo(s, forgiving);
  }
@@ -197,8 +206,8 @@
  	} else if (!strcmp(state, "on")) {
  	    if (!noRedirectItem) {
  		forwardSystemd(name, type, "enable");
---- chkconfig-1.3.63/leveldb.c	2014-11-30 14:57:06.299908151 +0200
-+++ chkconfig-1.3.63.no-xinetd/leveldb.c	2014-11-30 14:56:00.846594263 +0200
+--- chkconfig-1.4/leveldb.c~	2015-04-25 12:20:58.000000000 +0300
++++ chkconfig-1.4/leveldb.c	2015-04-25 12:21:39.535385553 +0300
 @@ -154,107 +154,6 @@
  	return 0;
  }
@@ -367,7 +376,7 @@
  }
  
  static struct dep *parseDeps(char *pos, char *end) {
-@@ -760,62 +650,6 @@
+@@ -682,67 +682,6 @@
      return ret;
  }
  
@@ -378,6 +387,7 @@
 -	char *buf, *ptr, *tmp;
 -	struct stat sb;
 -        mode_t mode;
+-        int r;
 -
 -	if (on == -1) {
 -		on = s.enabled ? 1 : 0;
@@ -424,15 +434,19 @@
 -	}
 -	close(newfd);
 -	unlink(oldfname);
--	return(rename(newfname,oldfname));
+-        r = rename(newfname,oldfname);
+-        if (selinux_restore(oldfname) != 0)
+-                fprintf(stderr, _("Unable to set selinux context for %s: %s\n"), oldfname,
+-		strerror(errno));
+-	return(r);
 -}
 -
  int doSetService(struct service s, int level, int on) {
      int priority = on ? s.sPriority : s.kPriority;
      char linkname[200];
---- chkconfig-1.3.63/leveldb.h	2014-11-05 18:39:09.000000000 +0200
-+++ chkconfig-1.3.63.no-xinetd/leveldb.h	2014-11-30 14:54:29.775316676 +0200
-@@ -17,13 +17,11 @@
+--- chkconfig-1.4/leveldb.h~	2015-04-25 12:20:58.000000000 +0300
++++ chkconfig-1.4/leveldb.h	2015-04-25 12:22:49.345672830 +0300
+@@ -17,14 +17,12 @@
  #define H_LEVELDB
  
  #define RUNLEVELS "/etc"
@@ -442,8 +456,9 @@
  
  #define TYPE_INIT_D	0x1
 -#define TYPE_XINETD	0x2
--#define TYPE_ANY	(TYPE_INIT_D | TYPE_XINETD)
-+#define TYPE_ANY	(TYPE_INIT_D)
+ #define TYPE_SYSTEMD	0x4
+-#define TYPE_ANY	(TYPE_INIT_D | TYPE_XINETD | TYPE_SYSTEMD)
++#define TYPE_ANY	(TYPE_INIT_D | TYPE_SYSTEMD)
  
  #ifndef SYSTEMD_SERVICE_PATH
  #define SYSTEMD_SERVICE_PATH "/lib/systemd/system"
@@ -456,25 +471,28 @@
  int systemdIsInit();
  int systemdActive();
  int isOverriddenBySystemd(const char *service);
---- chkconfig-1.3.63/ntsysv.c	2014-11-05 18:39:09.000000000 +0200
-+++ chkconfig-1.3.63.no-xinetd/ntsysv.c	2014-11-30 14:54:29.775316676 +0200
-@@ -61,15 +61,9 @@
-     states = alloca(sizeof(*states) * numServices);
- 
-     for (i = 0; i < numServices; i++) {
+--- chkconfig-1.4/ntsysv.c~	2015-03-26 15:14:53.000000000 +0200
++++ chkconfig-1.4/ntsysv.c	2015-04-25 12:25:27.840559610 +0300
+@@ -67,17 +67,12 @@
+         if (last != services[i].type) {
+ 	        newtFormAddComponent(subform, newtCompactButton(-1, count,
+                                         services[i].type == TYPE_INIT_D ? "SysV initscripts":
+-                                        services[i].type == TYPE_XINETD ? "xinetd services":
+                                         services[i].type == TYPE_SYSTEMD ? "systemd services":
+                                         "Unknown"));
+                 count++;
+                 last = services[i].type;
+         }
 -	if (services[i].type == TYPE_XINETD) {
--		checkboxes[i] = newtCheckbox(-1, i, services[i].name,
+-		checkboxes[i] = newtCheckbox(-1, count, services[i].name,
 -				     services[i].levels ? '*' : ' ', NULL,
 -				     states + i);
--	} else {
- 		checkboxes[i] = newtCheckbox(-1, i, services[i].name,
- 					     (services[i].currentLevels & levels) ? '*' : ' ', NULL,
- 					     states + i);
--	}
- 	newtFormAddComponent(subform, checkboxes[i]);
-     }
- 
-@@ -126,16 +120,10 @@
+-	} else if (services[i].type == TYPE_SYSTEMD) {
++	if (services[i].type == TYPE_SYSTEMD) {
+ 		checkboxes[i] = newtCheckbox(-1, count, services[i].name,
+ 				     services[i].enabled ? '*' : ' ', NULL,
+ 				     states + i);
+@@ -142,11 +137,7 @@
      if (!update) return 1;
  
      for (i = 0; i < numServices; i++) {
@@ -482,16 +500,12 @@
 -        if ((services[i].enabled && states[i] != '*') ||
 -	    (!services[i].enabled && states[i] == '*'))
 -	      setXinetdService(services[i], states[i] == '*');
--      } else {
- 	      for (j = 0; j < 7; j++) {
- 		      if (levels & (1 << j))
- 			doSetService(services[i], j, states[i] == '*');
- 	      }
--      }
-     }
- 
-     return 0;
-@@ -214,49 +202,6 @@
+-      } else if (services[i].type == TYPE_SYSTEMD) {
++	  if (services[i].type == TYPE_SYSTEMD) {
+               char *cmd = NULL;
+               int en = 0;
+               if (services[i].enabled && states[i] != '*')
+@@ -347,49 +338,6 @@
  
      closedir(dir);
  
@@ -538,6 +552,6 @@
 -    }
 -    }
 -
-     qsort(services, numServices, sizeof(*services), serviceNameCmp);
+     getSystemdServices(&services, &numServices);
  
-     *servicesPtr = services;
+     qsort(services, numServices, sizeof(*services), serviceNameCmp);
diff --git a/chkconfig-optflags.patch b/chkconfig-optflags.patch
index 95807ed..4a77ab0 100644
--- a/chkconfig-optflags.patch
+++ b/chkconfig-optflags.patch
@@ -1,13 +1,13 @@
---- chkconfig-1.3.63/Makefile~	2014-11-05 18:39:09.000000000 +0200
-+++ chkconfig-1.3.63/Makefile	2014-11-30 15:00:11.219270582 +0200
+--- chkconfig-1.4/Makefile~	2015-03-26 15:14:53.000000000 +0200
++++ chkconfig-1.4/Makefile	2015-04-25 12:27:11.812618643 +0300
 @@ -1,8 +1,8 @@
  VERSION=$(shell awk '/Version:/ { print $$2 }' chkconfig.spec)
  TAG = chkconfig-$(VERSION)
  
 -CFLAGS=-g -Wall $(RPM_OPT_FLAGS) -D_GNU_SOURCE
--LDFLAGS+=-g
+-LDFLAGS+=-g -lselinux -lsepol
 +CFLAGS=$(OPTFLAGS) -Wall -D_GNU_SOURCE
-+LDFLAGS+=
++LDFLAGS+=-lselinux -lsepol
  MAN=chkconfig.8 ntsysv.8 alternatives.8
  PROG=chkconfig
  BINDIR = /sbin
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/chkconfig.git/commitdiff/5edaa7566695f73a5def713118b1f7cac10789c9



More information about the pld-cvs-commit mailing list