rpms/anacron/devel anacron-2.3-random.patch, 1.1, 1.2 anacron-2.3-range.patch, 1.1, 1.2 anacron.spec, 1.58, 1.59 anacrontab, 1.6, 1.7 manAUX_Limit.patch, 1.1, 1.2

Marcela Mašláňová mmaslano at fedoraproject.org
Tue Feb 10 09:58:12 UTC 2009


Author: mmaslano

Update of /cvs/pkgs/rpms/anacron/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13451

Modified Files:
	anacron-2.3-random.patch anacron-2.3-range.patch anacron.spec 
	anacrontab manAUX_Limit.patch 
Log Message:
* Tue Feb 10 2009 Marcela Mašláňová <mmaslano at redhat.com> 2.3-69
- apply fix of my previous range patch from tmraz
- fix man page


anacron-2.3-random.patch:

Index: anacron-2.3-random.patch
===================================================================
RCS file: /cvs/pkgs/rpms/anacron/devel/anacron-2.3-random.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- anacron-2.3-random.patch	6 Feb 2009 14:08:07 -0000	1.1
+++ anacron-2.3-random.patch	10 Feb 2009 09:58:12 -0000	1.2
@@ -1,6 +1,6 @@
-diff -up anacron-2.3/main.c.aux anacron-2.3/main.c
---- anacron-2.3/main.c.aux	2009-02-06 12:58:17.000000000 +0100
-+++ anacron-2.3/main.c	2009-02-06 12:59:44.000000000 +0100
+diff -up anacron-2.3/main.c.random anacron-2.3/main.c
+--- anacron-2.3/main.c.random	2009-02-10 10:22:07.000000000 +0100
++++ anacron-2.3/main.c	2009-02-10 10:22:07.000000000 +0100
 @@ -24,6 +24,7 @@
  
  
@@ -23,9 +23,9 @@
  
      if((program_name = strrchr(argv[0], '/')) == NULL)
  	program_name = argv[0];
-diff -up anacron-2.3/readtab.c.aux anacron-2.3/readtab.c
---- anacron-2.3/readtab.c.aux	2009-02-06 12:58:17.000000000 +0100
-+++ anacron-2.3/readtab.c	2009-02-06 12:58:17.000000000 +0100
+diff -up anacron-2.3/readtab.c.random anacron-2.3/readtab.c
+--- anacron-2.3/readtab.c.random	2009-02-10 10:22:07.000000000 +0100
++++ anacron-2.3/readtab.c	2009-02-10 10:23:10.000000000 +0100
 @@ -48,6 +48,8 @@ static int line_num;             /* curr
  static job_rec *last_job_rec;    /* last job stored in memory, at the moment */
  static env_rec *last_env_rec;    /* last environment assignment stored */
@@ -69,15 +69,14 @@
      jr->delay = delay;
      jr->tab_line = line_num;
      jr->ident = obstack_alloc(&tab_o, ident_len + 1);
-@@ -257,7 +272,10 @@ parse_tab_line(char *line)
- 		 &env_var, &value);
-     if ((r != -1) && (strcmp(env_var, "START_HOURS_RANGE") == NULL))
-         r = match_rx("^([[:digit:]]+)-([[:digit:]]+)$", value, 0);
--
-+    if (strncmp(env_var, "RANDOM_DELAY", 12) == NULL) {
-+        r = match_rx("([[:digit:]]+)$", value, 1);
-+        RANDOM = atoi(value);
-+    }
+@@ -258,6 +273,10 @@ parse_tab_line(char *line)
      if (r == -1) goto reg_err;
      if (r)
      {
++        if (strncmp(env_var, "RANDOM_DELAY", 12) == NULL) {
++            r = match_rx("([[:digit:]]+)$", value, 1);
++            RANDOM = atoi(value);
++        }
+         if (strcmp(env_var, "START_HOURS_RANGE") == 0)
+         {
+             r = match_rx("^[[:digit:]]+-[[:digit:]]+$", value, 0);

anacron-2.3-range.patch:

Index: anacron-2.3-range.patch
===================================================================
RCS file: /cvs/pkgs/rpms/anacron/devel/anacron-2.3-range.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- anacron-2.3-range.patch	6 Feb 2009 14:08:07 -0000	1.1
+++ anacron-2.3-range.patch	10 Feb 2009 09:58:12 -0000	1.2
@@ -1,19 +1,27 @@
 diff -up anacron-2.3/readtab.c.range anacron-2.3/readtab.c
---- anacron-2.3/readtab.c.range	2009-02-06 13:04:08.000000000 +0100
-+++ anacron-2.3/readtab.c	2009-02-06 13:05:13.000000000 +0100
-@@ -255,6 +255,9 @@ parse_tab_line(char *line)
-     /* an environment assignment? */
-     r = match_rx("^[ \t]*([^ \t=]+)[ \t]*=(.*)$", line, 2,
- 		 &env_var, &value);
-+    if ((r != -1) && (strcmp(env_var, "START_HOURS_RANGE") == NULL))
-+        r = match_rx("^([[:digit:]]+)-([[:digit:]]+)$", value, 0);
-+
+--- anacron-2.3/readtab.c.range	2009-02-10 09:20:53.000000000 +0100
++++ anacron-2.3/readtab.c	2009-02-10 09:33:38.000000000 +0100
+@@ -258,6 +258,17 @@ parse_tab_line(char *line)
      if (r == -1) goto reg_err;
      if (r)
      {
++        if (strcmp(env_var, "START_HOURS_RANGE") == 0)
++        {
++            r = match_rx("^[[:digit:]]+-[[:digit:]]+$", value, 0);
++            if (r == -1) goto reg_err;
++            if (!r)
++            {
++                complain("Invalid syntax in %s of value %s on line %d - skipping this line",
++                         anacrontab, env_var, line_num);
++                return;
++            }
++        }
+ 	register_env(env_var, value);
+ 	return;
+     }
 diff -up anacron-2.3/runjob.c.range anacron-2.3/runjob.c
---- anacron-2.3/runjob.c.range	2009-02-06 13:04:08.000000000 +0100
-+++ anacron-2.3/runjob.c	2009-02-06 13:11:42.000000000 +0100
+--- anacron-2.3/runjob.c.range	2009-02-10 09:20:53.000000000 +0100
++++ anacron-2.3/runjob.c	2009-02-10 09:40:48.000000000 +0100
 @@ -34,8 +34,9 @@
  #include <stdio.h>
  #include <string.h>
@@ -25,7 +33,7 @@
  
  static int
  temp_file(job_rec *jr)
-@@ -236,14 +237,31 @@ launch_job(job_rec *jr)
+@@ -236,14 +237,40 @@ launch_job(job_rec *jr)
      int fd;
      char hostname[512];
      char *mailto;
@@ -34,8 +42,7 @@
 +    char *from;
 +    char *to;
 +    time_t now;
-+    struct tm t;
-+    int len;
++    struct tm *t;
      /* get hostname */
      if (gethostname(hostname, 512)) {
        strcpy (hostname,"unknown machine");
@@ -45,16 +52,26 @@
 -   
 +
 +    limit = getenv("START_HOURS_RANGE");
-+    time(&now);
-+    t = *localtime(&now);
-+    if (limit != NULL) {
++    if (limit != NULL)
++        limit = strdup(limit);
++    if (limit != NULL)
++    {
++        time(&now);
++        t = localtime(&now);
 +        if ((match_rx("^([[:digit:]]+)-([[:digit:]]+)$", limit, 2, &from, &to) == -1) ||
 +           (from == NULL) || (to == NULL))
-+            explain("START_HOURS_RANGE wasn't set correctly: %s", limit);
-+        if (!((atoi(from) < t.tm_hour) && (t.tm_hour < atoi(to)))) {
++        {
++            complain("START_HOURS_RANGE wasn't set correctly: %s", limit);
++            free(limit);
++            return;
++        }
++        if (!((atoi(from) < t->tm_hour) && (t->tm_hour < atoi(to))))
++        {
 +            Debug(("Limit for start of job is set between %s and %s hours, which passed already.", from, to));
-+            return 1;
++            free(limit);
++            return;
 +        }
++        free(limit);
 +    }
      /* Get the destination email address if set, or current user otherwise */
      mailto = getenv("MAILTO");


Index: anacron.spec
===================================================================
RCS file: /cvs/pkgs/rpms/anacron/devel/anacron.spec,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- anacron.spec	6 Feb 2009 14:08:07 -0000	1.58
+++ anacron.spec	10 Feb 2009 09:58:12 -0000	1.59
@@ -1,7 +1,7 @@
 Summary: A cron-like program that can run jobs lost during downtime
 Name: anacron
 Version: 2.3
-Release: 68%{?dist}
+Release: 69%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 URL: http://packages.debian.org/stable/source/anacron
@@ -90,6 +90,10 @@
 %attr(755,root,root) /etc/cron.hourly/0anacron
 
 %changelog
+* Tue Feb 10 2009 Marcela Mašláňová <mmaslano at redhat.com> 2.3-69
+- apply fix of my previous range patch from tmraz
+- fix man page
+
 * Fri Feb  6 2009 Marcela Mašláňová <mmaslano at redhat.com> 2.3-68
 - add two new options:
 - 481775 some people don't want to run daily jobs at all, if they


Index: anacrontab
===================================================================
RCS file: /cvs/pkgs/rpms/anacron/devel/anacrontab,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- anacrontab	6 Feb 2009 14:08:07 -0000	1.6
+++ anacrontab	10 Feb 2009 09:58:12 -0000	1.7
@@ -5,10 +5,10 @@
 SHELL=/bin/sh
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 MAILTO=root
-# the maximal random delay
+# the maximal random delay added to the base delay of the jobs
 RANDOM_DELAY=45
-# in between this hours will started daily jobs
-#START_HOURS_RANGE=3-22
+# the jobs will be started during the following hours only
+START_HOURS_RANGE=3-22
 
 1	5	cron.daily		nice run-parts /etc/cron.daily
 7	25	cron.weekly		nice run-parts /etc/cron.weekly

manAUX_Limit.patch:

Index: manAUX_Limit.patch
===================================================================
RCS file: /cvs/pkgs/rpms/anacron/devel/manAUX_Limit.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- manAUX_Limit.patch	6 Feb 2009 14:08:07 -0000	1.1
+++ manAUX_Limit.patch	10 Feb 2009 09:58:12 -0000	1.2
@@ -1,26 +1,37 @@
 diff -up anacron-2.3/anacrontab.5.mmm anacron-2.3/anacrontab.5
---- anacron-2.3/anacrontab.5.mmm	2009-02-04 14:40:29.000000000 +0100
-+++ anacron-2.3/anacrontab.5	2009-02-04 14:56:56.000000000 +0100
+--- anacron-2.3/anacrontab.5.mmm	2009-02-10 10:42:17.000000000 +0100
++++ anacron-2.3/anacrontab.5	2009-02-10 10:51:26.000000000 +0100
 @@ -1,4 +1,4 @@
 -.TH ANACRONTAB 5 2004-07-11 "Pascal Hakim" "Anacron Users' Manual"
 +.TH ANACRONTAB 5 2009-02-02 "Marcela Mašláňová" "Anacron Users' Manual"
  .SH NAME
  /etc/anacrontab \- configuration file for anacron
  .SH DESCRIPTION
-@@ -19,7 +19,11 @@ The
+@@ -15,11 +15,20 @@ Job-description lines are of one of thes
+ .PP
+    @period_name delay job-identify command
+ .PP
+-The
++The 
  .I period
- is specified in days, the
+-is specified in days, the
++is specified in days, the 
  .I delay
 -in minutes.  The
-+in minutes. It could be also defined random delay which is set by value of
++in minutes. In addition, if the 
 +.I RANDOM_DELAY
-+. The value in this variable denotes maximal delay. 
-+The random delay is added to normal delay from anacrontab. Also the random delay could
-+be set to zero or not set at all. The
++environment variable is set, then the value of 
++.I RANDOM_DELAY 
++is added to the delay. The value in 
++.I RANDOM_DELAY 
++denotes a maximal additional delay in minutes, where the minimum delay value is set, to user delay from anacrontab. A 
++.I RANDOM_DELAY 
++set to 12 would therefore add, randomly, between 0 and 12 minutes to the user defined delay.
++The
  .I job-identifier
  can contain any non-blank character, except slashes.  It is used to identify
  the job in Anacron messages,
-@@ -42,12 +46,28 @@ are removed.  No spaces around
+@@ -42,12 +51,28 @@ are removed.  No spaces around
  .I VALUE
  are allowed (unless you want them to be part of the value).  The assignment
  takes effect from the next line to the end of the file, or to the next
@@ -35,7 +46,7 @@
  You can continue a line onto the next line by ending it with a '\'.
 +.SH EXAMPLE
 +.nf
-+# environment variable
++# environment variables
 +SHELL=/bin/sh
 +PATH=/sbin:/bin:/usr/sbin:/usr/bin
 +MAILTO=root




More information about the scm-commits mailing list