From 17d117bb6fd2afeea8433f9251d947f960f6a95fee310bb9eb87d79d0c4c1e36 Mon Sep 17 00:00:00 2001 From: Kristyna Streitova Date: Mon, 10 May 2021 14:53:29 +0000 Subject: [PATCH] Accepting request 891605 from home:dirkmueller:Factory - update to 1.5.7: * anacron: Fix problem of anacron not being started on some desktops * crontab: switch off colors if NO_COLOR is set * crontab: crontab without arguments now works if stdin is not a TTY * crond: Fix various issues on loading the crontab databases on startup * anacron: Expand MAILTO and MAILFROM environment variables * crontab: New option to test crontab file syntax without installing it - cronie-nheader_lines.diff: refresh against 1.5.7 OBS-URL: https://build.opensuse.org/request/show/891605 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=195 --- cronie-1.5.5.tar.gz | 3 -- cronie-1.5.7.tar.gz | 3 ++ cronie-nheader_lines.diff | 80 ++++++++++++++++----------------------- cronie.changes | 12 ++++++ cronie.spec | 2 +- 5 files changed, 49 insertions(+), 51 deletions(-) delete mode 100644 cronie-1.5.5.tar.gz create mode 100644 cronie-1.5.7.tar.gz diff --git a/cronie-1.5.5.tar.gz b/cronie-1.5.5.tar.gz deleted file mode 100644 index 1e78480..0000000 --- a/cronie-1.5.5.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:22c2a2b22577c0f776c1268d0e0f305c5c041e10155022a345b43b665da0ffe9 -size 124642 diff --git a/cronie-1.5.7.tar.gz b/cronie-1.5.7.tar.gz new file mode 100644 index 0000000..366514d --- /dev/null +++ b/cronie-1.5.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30190b791c79bd72a43eb7cd6fced00be850e2e27e60852dec6dbacb82ecf21e +size 148739 diff --git a/cronie-nheader_lines.diff b/cronie-nheader_lines.diff index 1af1ebf..2dbd376 100644 --- a/cronie-nheader_lines.diff +++ b/cronie-nheader_lines.diff @@ -9,27 +9,23 @@ Index: src/crontab.c -#define NHEADER_LINES 0 +#define NHEADER_LINES 3 - #define COMMENT_COLOR "\x1B[34m" - #define RESET_COLOR "\033[0m" -@@ -394,7 +394,7 @@ static void parse_args(int argc, char *a + #define COMMENT_COLOR "\x1B[34m" + #define ERROR_COLOR "\x1B[31m" +@@ -418,7 +418,7 @@ static void parse_args(int argc, char *a static void list_cmd(void) { char n[MAX_FNAME]; FILE *f; - int ch; + int ch, x; - const int is_tty = isatty(STDOUT); + const int colorize = isatty(STDOUT) && getenv("NO_COLOR") == NULL; int new_line = 1; - -@@ -411,9 +411,25 @@ static void list_cmd(void) { - exit(ERROR_EXIT); - } - -- /* file is open. copy to stdout, close. -- */ - Set_LineNum(1) -+ -+ /* ignore the top few comments since we probably put them there. -+ */ + int in_comment = 0; +@@ -439,6 +439,22 @@ static void list_cmd(void) { + /* file is open. copy to stdout, close. + */ + Set_LineNum(1); ++ /* ignore the top few comments since we probably put them there. ++ */ + x = 0; + while (EOF != (ch = get_char(f))) { + if ('#' != ch) { @@ -37,18 +33,17 @@ Index: src/crontab.c + break; + } + while (EOF != (ch = get_char(f))) -+ if (ch == '\n') -+ break; ++ if (ch == '\n') ++ break; + if (++x >= NHEADER_LINES) + break; + } -+ + /* copy the rest of the crontab (if any) to the stdout. + */ while (EOF != (ch = get_char(f))) { - if (is_tty && new_line) { - if (ch == '#') { -@@ -500,7 +516,7 @@ static void edit_cmd(void) { + if (colorize) { + if (!in_comment && new_line && ch == '#') { +@@ -533,7 +549,7 @@ static void edit_cmd(void) { char n[MAX_FNAME], q[MAX_TEMPSTR]; const char *editor; FILE *f; @@ -57,20 +52,15 @@ Index: src/crontab.c struct stat statbuf; struct utimbuf utimebuf; WAIT_T waiter; -@@ -552,13 +568,25 @@ static void edit_cmd(void) { +@@ -585,10 +601,20 @@ static void edit_cmd(void) { } - Set_LineNum(1) -- /* -- * NHEADER_LINES processing removed for clarity -- * (NHEADER_LINES == 0 in all Red Hat crontabs) -- */ -- /* copy the rest of the crontab (if any) to the temp file. -- */ -- if (EOF != ch) -+ + Set_LineNum(1); +- /* +- * NHEADER_LINES processing removed for clarity +- * (NHEADER_LINES == 0 in all Red Hat crontabs) + /* ignore the top few comments since we probably put them there. -+ */ + */ + x = 0; + while (EOF != (ch = get_char(f))) { + if ('#' != ch) { @@ -79,26 +69,22 @@ Index: src/crontab.c + } + while (EOF != (ch = get_char(f))) + if (ch == '\n') -+ break; -+ if (++x >= NHEADER_LINES) -+ break; ++ break; ++ if (++x >= NHEADER_LINES) ++ break; + } -+ -+ /* copy the rest of the crontab (if any) to the temp file. -+ */ -+ if (EOF != ch) - while (EOF != (ch = get_char(f))) - putc(ch, NewCrontab); - -@@ -766,6 +794,7 @@ static int replace_cmd(void) { + /* copy the rest of the crontab (if any) to the temp file. + */ + if (EOF != ch) +@@ -812,6 +838,7 @@ static int replace_cmd(void) { + int ch, fd; int error = 0; - entry *e; uid_t file_owner; + time_t now = time(NULL); - char **envp; char *safename; - int envs = 0, entries = 0; -@@ -796,10 +825,10 @@ static int replace_cmd(void) { + + safename = host_specific_filename("#tmp", "XXXXXXXXXX"); +@@ -839,10 +866,10 @@ static int replace_cmd(void) { * * VERY IMPORTANT: make sure NHEADER_LINES agrees with this code. */ diff --git a/cronie.changes b/cronie.changes index 0977766..bb57cd4 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Sat May 8 20:33:29 UTC 2021 - Dirk Müller + +- update to 1.5.7: + * anacron: Fix problem of anacron not being started on some desktops + * crontab: switch off colors if NO_COLOR is set + * crontab: crontab without arguments now works if stdin is not a TTY + * crond: Fix various issues on loading the crontab databases on startup + * anacron: Expand MAILTO and MAILFROM environment variables + * crontab: New option to test crontab file syntax without installing it +- cronie-nheader_lines.diff: refresh against 1.5.7 + ------------------------------------------------------------------- Fri Mar 12 22:08:43 UTC 2021 - Dirk Müller diff --git a/cronie.spec b/cronie.spec index 6047cb4..52effb5 100644 --- a/cronie.spec +++ b/cronie.spec @@ -22,7 +22,7 @@ %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif Name: cronie -Version: 1.5.5 +Version: 1.5.7 Release: 0 Summary: Cron Daemon License: BSD-3-Clause AND GPL-2.0-only AND MIT