[packages/chkconfig] - updated to 1.30
qboosh
qboosh at pld-linux.org
Sun Dec 8 13:55:48 CET 2024
commit 4049f38a7be26829b184eaba2ccf411ef0b489db
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Dec 8 13:05:58 2024 +0100
- updated to 1.30
chkconfig-noxinet.patch | 89 +++++++++++++++++++++++++++++-------------------
chkconfig-optflags.patch | 6 ++--
chkconfig.spec | 9 ++---
3 files changed, 62 insertions(+), 42 deletions(-)
---
diff --git a/chkconfig.spec b/chkconfig.spec
index af7821b..63dbc15 100644
--- a/chkconfig.spec
+++ b/chkconfig.spec
@@ -9,14 +9,14 @@ 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.25
-Release: 2
+Version: 1.30
+Release: 1
Epoch: 2
License: GPL v2
Group: Applications/System
#Source0Download: https://github.com/fedora-sysv/chkconfig/releases
Source0: https://github.com/fedora-sysv/chkconfig/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: 12a7b241ba7d3730b9dc389115be50ee
+# Source0-md5: 9733308c5c3f208f27706d741bbf033d
Patch0: %{name}-add.patch
Patch1: %{name}-noxinet.patch
Patch2: %{name}-rc.d.patch
@@ -171,9 +171,10 @@ Perla; ma być zamiennikiem skryptu update-alternatives z Debiana.
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{rc.d/{init,rc{0,1,2,3,4,5,6}}.d,env.d},/sbin}
+install -d $RPM_BUILD_ROOT{/etc/{rc.d/{init,rc{0,1,2,3,4,5,6}}.d,env.d},/sbin,/var/lib/alternatives}
%{__make} install \
+ BINDIR=/sbin \
MANDIR=%{_mandir} \
SYSTEMDUTILDIR=/lib/systemd \
DESTDIR=$RPM_BUILD_ROOT
diff --git a/chkconfig-noxinet.patch b/chkconfig-noxinet.patch
index 9be6af2..687e88c 100644
--- a/chkconfig-noxinet.patch
+++ b/chkconfig-noxinet.patch
@@ -18,8 +18,8 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
.SH OPTIONS
.TP
\fB-\-level \fIlevels\fR
---- chkconfig-1.25/chkconfig.c.orig 2023-10-07 20:29:44.542142680 +0200
-+++ chkconfig-1.25/chkconfig.c 2023-10-07 20:30:56.375086861 +0200
+--- chkconfig-1.30/chkconfig.c.orig 2024-12-08 12:49:09.599560223 +0100
++++ chkconfig-1.30/chkconfig.c 2024-12-08 12:51:00.768957966 +0100
@@ -117,8 +117,6 @@ static int delService(char *name, int ty
readServiceError(rc, name);
return 1;
@@ -29,7 +29,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
checkRoot();
-@@ -333,8 +331,6 @@ static int addService(char *name, int ty
+@@ -345,8 +343,6 @@ static int addService(char *name, int ty
return 1;
}
@@ -38,7 +38,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
checkRoot();
if (s.isLSB) {
-@@ -373,9 +369,6 @@ static int overrideService(char *name, i
+@@ -385,9 +381,6 @@ static int overrideService(char *name, i
return 0;
}
@@ -48,7 +48,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
checkRoot();
if ((s.levels == o.levels) && (s.kPriority == o.kPriority) &&
-@@ -452,10 +445,6 @@ static int showServiceInfo(struct servic
+@@ -464,10 +457,6 @@ static int showServiceInfo(struct servic
}
printf("%-15s", s.name);
@@ -59,7 +59,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
for (i = 0; i < 7; i++) {
printf("\t%d:%s", i, isOn(s.name, i) ? _("on") : _("off"));
-@@ -469,8 +458,7 @@ static int showServiceInfoByName(char *n
+@@ -481,8 +470,7 @@ static int showServiceInfoByName(char *n
int rc;
struct service s;
@@ -69,7 +69,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
return forgiving ? 0 : 1;
}
-@@ -485,20 +473,6 @@ static int showServiceInfoByName(char *n
+@@ -497,20 +485,6 @@ static int showServiceInfoByName(char *n
return showServiceInfo(s, forgiving);
}
@@ -90,9 +90,9 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
static int serviceNameCmp(const void *a, const void *b) {
const struct service *first = a;
const struct service *second = b;
-@@ -534,56 +508,6 @@ static int listService(char *item, int t
- }
- }
+@@ -546,62 +520,6 @@ static int listService(char *item, int t
+
+ free(services);
}
-
- if (isXinetdEnabled() && type & TYPE_XINETD) {
@@ -138,8 +138,14 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
- t = s;
- for (i = 0; i < numServices; i++, s++) {
- char *tmp = malloc(strlen(s->name) + 5);
+- if (!tmp) {
+- closedir(dir);
+- free(t);
+- return 1;
+- }
- sprintf(tmp, "%s:", s->name);
- printf("\t%-15s\t%s\n", tmp, s->levels ? _("on") : _("off"));
+- free(tmp);
- }
- closedir(dir);
- free(t);
@@ -147,7 +153,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
return 0;
}
-@@ -646,11 +570,6 @@ int setService(char *name, int type, int
+@@ -664,11 +582,6 @@ int setService(char *name, int type, int
reloadSystemd();
return rc;
@@ -159,7 +165,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
}
return 0;
-@@ -658,8 +577,6 @@ int setService(char *name, int type, int
+@@ -676,8 +589,6 @@ int setService(char *name, int type, int
void forwardSystemd(const char *name, int type, const char *verb) {
int socket = 0;
@@ -168,7 +174,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
if (!systemdIsInit())
return;
-@@ -743,12 +660,10 @@ int main(int argc, const char **argv) {
+@@ -761,12 +672,10 @@ int main(int argc, const char **argv) {
usage(progname);
if (typeString) {
@@ -183,7 +189,7 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
exit(1);
}
}
-@@ -873,16 +788,9 @@ int main(int argc, const char **argv) {
+@@ -891,16 +800,9 @@ int main(int argc, const char **argv) {
rc = readServiceInfo(name, type, &s, 0);
if (rc)
return 1;
@@ -200,10 +206,9 @@ diff -urNpa chkconfig-1.15.orig/chkconfig.8 chkconfig-1.15/chkconfig.8
} else if (!strcmp(state, "on")) {
if (!noRedirectItem) {
forwardSystemd(name, type, "enable");
-diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
---- chkconfig-1.15.orig/leveldb.c 2021-05-03 16:40:14.588185842 +0200
-+++ chkconfig-1.15/leveldb.c 2021-05-03 17:50:29.728139905 +0200
-@@ -204,114 +204,6 @@ int readDescription(char *start, char *b
+--- chkconfig-1.30/leveldb.c.orig 2024-12-08 12:49:09.602893538 +0100
++++ chkconfig-1.30/leveldb.c 2024-12-08 12:51:57.221985468 +0100
+@@ -208,122 +208,6 @@ int readDescription(char *start, char *b
return 0;
}
@@ -228,15 +233,22 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
- struct stat sb;
- char *buf = NULL, *ptr;
- char *eng_desc = NULL, *start;
+- int r;
-
-- asprintf(&filename, XINETDDIR "/%s", name);
--
-- if ((fd = open(filename, O_RDONLY)) < 0)
+- r = asprintf(&filename, XINETDDIR "/%s", name);
+- if (r < 0)
+- return -1;
+- fd = open(filename, O_RDONLY);
+- free(filename);
+- if(fd < 0)
- goto out_err;
+-
- fstat(fd, &sb);
- if (!S_ISREG(sb.st_mode))
- goto out_err;
- buf = malloc(sb.st_size + 1);
+- if (!buf)
+- goto out_err;
- if (read(fd, buf, sb.st_size) != sb.st_size)
- goto out_err;
- close(fd);
@@ -306,19 +318,20 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
- buf = ptr;
- }
- *service = serv;
+- free(start);
- return 0;
-out_err:
- if (fd >= 0)
- close(fd);
- free(buf);
-- free(filename);
- return -1;
-}
-
- int readServices(struct service **services) {
- DIR *dir;
- struct dirent *ent;
-@@ -365,12 +257,12 @@ int readServiceInfo(char *name, int type
+-
+ void freeService(struct service s) {
+ free(s.name);
+ free(s.startDeps);
+@@ -394,12 +278,12 @@ int readServiceInfo(char *name, int type
int parseret;
if (!(type & TYPE_INIT_D))
@@ -333,7 +346,7 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
free(filename);
parseret = parseServiceInfo(fd, name, &serv, honorHide, 0);
-@@ -410,12 +302,6 @@ int readServiceInfo(char *name, int type
+@@ -439,12 +323,6 @@ int readServiceInfo(char *name, int type
free(filename);
*service = serv;
return 0;
@@ -346,7 +359,7 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
}
int readServiceDifferences(char *name, int type, struct service *service,
-@@ -426,12 +312,12 @@ int readServiceDifferences(char *name, i
+@@ -455,12 +333,12 @@ int readServiceDifferences(char *name, i
int parseret;
if (!(type & TYPE_INIT_D))
@@ -361,7 +374,7 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
}
free(filename);
-@@ -455,12 +341,6 @@ int readServiceDifferences(char *name, i
+@@ -484,12 +362,6 @@ int readServiceDifferences(char *name, i
*service = serv;
*service_overrides = serv_overrides;
return 0;
@@ -374,7 +387,7 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
}
static struct dep *parseDeps(char *pos, char *end) {
-@@ -863,68 +743,6 @@ int whatLevels(char *name) {
+@@ -894,70 +766,6 @@ int whatLevels(char *name) {
return ret;
}
@@ -382,7 +395,7 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
- int oldfd, newfd;
- char oldfname[100], newfname[100];
- char tmpstr[50];
-- char *buf, *ptr, *tmp;
+- char *buf, *ptr, *tmp, *start;
- struct stat sb;
- mode_t mode;
- int r;
@@ -411,6 +424,7 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
- free(buf);
- return -1;
- }
+- start = buf;
- while (buf) {
- tmp = buf;
- ptr = strchr(buf, '\n');
@@ -431,6 +445,7 @@ diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c
- }
- buf = ptr;
- }
+- free(start);
- close(newfd);
- unlink(oldfname);
- r = rename(newfname, oldfname);
@@ -471,9 +486,8 @@ diff -urNpa chkconfig-1.15.orig/leveldb.h chkconfig-1.15/leveldb.h
int systemdIsInit();
int systemdActive();
int isOverriddenBySystemd(const char *service);
-diff -urNpa chkconfig-1.15.orig/ntsysv.c chkconfig-1.15/ntsysv.c
---- chkconfig-1.15.orig/ntsysv.c 2021-01-21 09:19:06.000000000 +0100
-+++ chkconfig-1.15/ntsysv.c 2021-05-03 17:45:56.483139905 +0200
+--- chkconfig-1.30/ntsysv.c.orig 2024-08-07 14:05:12.000000000 +0200
++++ chkconfig-1.30/ntsysv.c 2024-12-08 12:52:18.808535190 +0100
@@ -69,19 +69,13 @@ static int servicesWindow(struct service
newtCompactButton(-1, count,
services[i].type == TYPE_INIT_D
@@ -508,7 +522,7 @@ diff -urNpa chkconfig-1.15.orig/ntsysv.c chkconfig-1.15/ntsysv.c
char *cmd = NULL;
int en = 0;
if (services[i].enabled && states[i] != '*')
-@@ -368,50 +358,6 @@ static int getServices(struct service **
+@@ -369,55 +359,6 @@ static int getServices(struct service **
closedir(dir);
@@ -516,6 +530,7 @@ diff -urNpa chkconfig-1.15.orig/ntsysv.c chkconfig-1.15/ntsysv.c
- if (!(dir = opendir(XINETDDIR))) {
- fprintf(stderr, "failed to open " XINETDDIR ": %s\n",
- strerror(errno));
+- freeServices(services, numServices);
- return 2;
- }
-
@@ -544,6 +559,7 @@ diff -urNpa chkconfig-1.15.orig/ntsysv.c chkconfig-1.15/ntsysv.c
- fprintf(stderr, _("error reading info for service %s: %s\n"),
- ent->d_name, strerror(errno));
- closedir(dir);
+- freeServices(services, numServices);
- return 2;
- } else if (!rc)
- numServices++;
@@ -552,8 +568,11 @@ diff -urNpa chkconfig-1.15.orig/ntsysv.c chkconfig-1.15/ntsysv.c
- if (err) {
- fprintf(stderr, _("error reading from directory %s: %s\n"),
- XINETDDIR, strerror(err));
+- freeServices(services, numServices);
- return 1;
- }
+-
+- closedir(dir);
- }
-
getSystemdServices(&services, &numServices);
diff --git a/chkconfig-optflags.patch b/chkconfig-optflags.patch
index 54de890..67491a7 100644
--- a/chkconfig-optflags.patch
+++ b/chkconfig-optflags.patch
@@ -1,5 +1,5 @@
---- chkconfig-1.25/Makefile.orig 2023-10-07 20:31:30.358236092 +0200
-+++ chkconfig-1.25/Makefile 2023-10-07 20:32:21.871290355 +0200
+--- chkconfig-1.30/Makefile.orig 2024-12-08 12:53:49.284711705 +0100
++++ chkconfig-1.30/Makefile 2024-12-08 12:54:37.537783629 +0100
@@ -2,8 +2,8 @@ VERSION := $(shell awk '/Version:/ { pri
NEXT_VERSION := $(shell sed -nr 's/Version:[ ]*([0-9]*)\.([0-9]*)/echo "\1\.$$((\2+1))"/gep' chkconfig.spec)
TAG = $(VERSION)
@@ -10,4 +10,4 @@
+LDFLAGS += $(OPTLDFLAGS)
MAN = chkconfig.8 ntsysv.8 alternatives.8
PROG = chkconfig
- BINDIR = /sbin
+ SBINDIR = /usr/sbin
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/chkconfig.git/commitdiff/4049f38a7be26829b184eaba2ccf411ef0b489db
More information about the pld-cvs-commit
mailing list