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
This commit is contained in:
parent
3f0833fcd1
commit
17d117bb6f
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:22c2a2b22577c0f776c1268d0e0f305c5c041e10155022a345b43b665da0ffe9
|
||||
size 124642
|
3
cronie-1.5.7.tar.gz
Normal file
3
cronie-1.5.7.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:30190b791c79bd72a43eb7cd6fced00be850e2e27e60852dec6dbacb82ecf21e
|
||||
size 148739
|
@ -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.
|
||||
*/
|
||||
|
@ -1,3 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat May 8 20:33:29 UTC 2021 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- 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 <dmueller@suse.com>
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user