[packages/SysVinit] Up to 3.10
arekm
arekm at pld-linux.org
Thu Aug 1 10:02:22 CEST 2024
commit 696266e1402006a53d7be84c817a4bad76d9d284
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Aug 1 08:49:56 2024 +0200
Up to 3.10
SysVinit.spec | 8 ++---
sysvinit-halt.patch | 37 ++++++++++------------
sysvinit-rebootconfirmation.patch | 66 ++++++++++++++++++---------------------
3 files changed, 51 insertions(+), 60 deletions(-)
---
diff --git a/SysVinit.spec b/SysVinit.spec
index ca1500a..5034aeb 100644
--- a/SysVinit.spec
+++ b/SysVinit.spec
@@ -12,12 +12,12 @@ Summary(ru.UTF-8): Программы, управляющие базовыми
Summary(tr.UTF-8): System V başlatma programı
Summary(uk.UTF-8): Програми, що керують базовими системними процесами
Name: SysVinit
-Version: 3.04
+Version: 3.10
Release: 1
License: GPL v2+
Group: Base
-Source0: http://download.savannah.gnu.org/releases/sysvinit/sysvinit-%{version}.tar.xz
-# Source0-md5: 9a00e5f15dd2f038f10feee50677ebff
+Source0: https://github.com/slicer69/sysvinit/releases/download/%{version}/sysvinit-%{version}.tar.xz
+# Source0-md5: b8fbe11062cf16d3b6a3709b7f6978d2
Source1: sysvinit.logrotate
Source2: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/sysvinit-non-english-man-pages.tar.bz2
# Source2-md5: 9ae8a63a4685368fae19707f95475cca
@@ -138,7 +138,7 @@ Ten pakiet zawiera różne narzędzia do zarządzania procesami.
%patch9 -p1
%patch10 -p1
%patch11 -p1
-%patch12 -p0
+%patch12 -p1
%build
%{__make} -C src \
diff --git a/sysvinit-halt.patch b/sysvinit-halt.patch
index 7c6146b..365aa50 100644
--- a/sysvinit-halt.patch
+++ b/sysvinit-halt.patch
@@ -1,23 +1,18 @@
---- sysvinit-2.78/src/halt.c.halt Wed Apr 19 15:48:23 2000
-+++ sysvinit-2.78/src/halt.c Wed Apr 19 15:55:03 2000
-@@ -218,8 +218,19 @@
- * See if we are in runlevel 0 or 6.
- */
- c = get_runlevel();
-- if (c != '0' && c != '6')
-+ if (c != '0' && c != '6') {
-+ char *file;
+--- sysvinit-3.10/src/halt.c~ 2024-07-29 15:39:12.000000000 +0200
++++ sysvinit-3.10/src/halt.c 2024-08-01 08:41:12.739971452 +0200
+@@ -170,6 +170,15 @@ void do_shutdown(char *fl, int should_po
+ {
+ char *args[9];
+ int i = 0;
++ char *file;
+
-+ if (do_poweroff) {
-+ file = strdup("/poweroff");
-+ } else {
-+ file = strdup("/halt");
-+ }
-+ close(open(file, O_CREAT|O_RDWR, 0644));
-+ free(file);
-+
- do_shutdown(do_reboot ? "-r" : "-h", do_poweroff, tm);
-+ }
- }
++ if (should_poweroff) {
++ file = strdup("/poweroff");
++ } else {
++ file = strdup("/halt");
++ }
++ close(open(file, O_CREAT|O_RDWR, 0644));
++ free(file);
- /*
+ args[i++] = "shutdown";
+ args[i++] = fl;
diff --git a/sysvinit-rebootconfirmation.patch b/sysvinit-rebootconfirmation.patch
index 73523c3..90002e5 100644
--- a/sysvinit-rebootconfirmation.patch
+++ b/sysvinit-rebootconfirmation.patch
@@ -1,62 +1,58 @@
-diff -urNp -x '*.orig' src/halt.c src/halt.c
---- src/halt.c 2021-02-25 08:12:01.388254734 +0100
-+++ src/halt.c 2021-02-25 08:12:01.484924408 +0100
-@@ -75,7 +75,7 @@ extern void write_wtmp(char *user, char
+--- sysvinit-3.10/src/halt.c.orig 2024-08-01 08:41:41.156638116 +0200
++++ sysvinit-3.10/src/halt.c 2024-08-01 08:48:11.933304753 +0200
+@@ -81,10 +81,11 @@ extern void write_wtmp(char *user, char
*/
void usage(void)
{
-- fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-h] [-i]%s\n",
-+ fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-h] [-i] [-c]%s\n",
- progname, strcmp(progname, "halt") ? "" : " [-p]");
- fprintf(stderr, "\t-n: don't sync before halting the system\n");
- fprintf(stderr, "\t-w: only write a wtmp reboot record and exit.\n");
-@@ -83,6 +83,7 @@ void usage(void)
+- fprintf(stderr, "usage: %s [-d] [-f] [-h] [-i] [-n] [-w]%s%s\n",
++ fprintf(stderr, "usage: %s [-c] [-d] [-f] [-h] [-i] [-n] [-w]%s%s\n",
+ progname,
+ strcmp(progname, "halt") ? "" : " [-p]",
+ strcmp(progname, "reboot") ? "" : " [-k] [-m <message>]");
++ fprintf(stderr, "\t-c: ask for confirmation.\n");
+ fprintf(stderr, "\t-d: don't write a wtmp record.\n");
fprintf(stderr, "\t-f: force halt/reboot, don't call shutdown.\n");
fprintf(stderr, "\t-h: put harddisks in standby mode.\n");
- fprintf(stderr, "\t-i: shut down all network interfaces.\n");
-+ fprintf(stderr, "\t-c: ask for confirmation.\n");
- if (!strcmp(progname, "halt"))
- fprintf(stderr, "\t-p: power down the system (if possible, otherwise halt).\n");
- exit(1);
-@@ -193,8 +194,10 @@ int main(int argc, char **argv)
- int do_ifdown = 0;
+@@ -214,7 +215,9 @@ int main(int argc, char **argv)
int do_hddown = 0;
int do_poweroff = 0;
-+ int do_confirm = 0;
+ int do_kexec = 0;
++ int do_confirm = 0;
+ char *user_message = NULL;
++ char answer = 'n';
int c;
char *tm = NULL;
-+ char answer = 'n';
- /*
- * Find out who we are
-@@ -212,7 +215,7 @@ int main(int argc, char **argv)
+@@ -234,7 +237,7 @@ int main(int argc, char **argv)
/*
* Get flags
*/
-- while((c = getopt(argc, argv, ":ihdfnpwt:")) != EOF) {
-+ while((c = getopt(argc, argv, ":ihdfnpwct:")) != EOF) {
+- while((c = getopt(argc, argv, ":ihdfm:npwkt:")) != EOF) {
++ while((c = getopt(argc, argv, ":ihdfm:npwkct:")) != EOF) {
switch(c) {
case 'n':
do_sync = 0;
-@@ -236,6 +239,9 @@ int main(int argc, char **argv)
- case 'p':
- do_poweroff = 1;
- break;
-+ case 'c':
-+ do_confirm = 1;
-+ break;
+@@ -268,6 +271,9 @@ int main(int argc, char **argv)
case 't':
tm = optarg;
break;
-@@ -256,6 +262,11 @@ int main(int argc, char **argv)
- }
++ case 'c':
++ do_confirm = 1;
++ break;
+ default:
+ usage();
+ }
+@@ -300,6 +306,13 @@ int main(int argc, char **argv)
+ exit(1);
+ }
- if (!do_hard && !do_nothing) {
+ if (do_confirm) {
+ fprintf(stderr, "Are you sure you want to reboot? N/y.\n");
+ scanf("%c", &answer);
-+ if (tolower(answer) != 'y') exit(1);
++ if (tolower(answer) != 'y')
++ exit(1);
+ }
++
/*
* See if we are in runlevel 0 or 6.
*/
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/SysVinit.git/commitdiff/696266e1402006a53d7be84c817a4bad76d9d284
More information about the pld-cvs-commit
mailing list