auto-import changelog data from at-3.1.8-56.src.rpm

Thu Jul 29 2004 Jason Vas Dias <jvdias@redhat.com>
- Added POSIX.2 -t option for RFE 127485
Thu Jul 29 2004 Jason Vas Dias <jvdias@redhat.com>
- Had to disable the 'make test' for the build BEFORE
- any changes were made (building on FC2 - perl issue?)
- test.pl generates these 'errors' for what looks like
- valid output to me:
- $ ./test.pl 2>&1 | egrep -v '(^ok$)|(time_only)'
- 1..3656
- not ok
- 'Monday - 1 month': 'Fri Jul 2 18:29:00 2004' =? 'Sat Jul 3 18:29:00
    2004'
- not ok
- 'Monday - 10 months': 'Thu Oct 2 18:29:00 2003' =? 'Fri Oct 3 18:29:00
    2003'
- not ok
- 'next week - 1 month': 'Mon Jul 5 18:29:00 2004' =? 'Tue Jul 6 18:29:00
    2004'
- not ok
- 'next week - 10 months': 'Sun Oct 5 18:29:00 2003' =? 'Mon Oct 6 18:29:00
    2003'
- will investigate and fix for next release.
This commit is contained in:
cvsdist 2004-09-09 03:18:25 +00:00
parent 3049791ae7
commit e83c0dc63a
2 changed files with 231 additions and 2 deletions

205
at-3.1.8-t_option.patch Normal file
View File

@ -0,0 +1,205 @@
--- at-3.1.8/at.1.in-t_option 2004-07-29 19:34:06.601842000 -0400
+++ at-3.1.8/at.1.in 2004-07-29 19:35:37.645706000 -0400
@@ -12,6 +12,16 @@
.RB [ -mldbv ]
.B TIME
.br
+.B at
+.RB [ -V ]
+.RB [ -q
+.IR queue ]
+.RB [ -f
+.IR file ]
+.RB [ -mldbv ]
+.RB -t
+.IR time_arg
+.br
.B "at -c"
.I job
.RI [ job... ]
@@ -235,6 +245,15 @@
.B
\-c
cats the jobs listed on the command line to standard output.
+.TP
+.BI \-t " time_arg"
+Submit the job to be run at the time specified by the
+.BI time_arg
+option argument, which must have the same format as specified for the
+.BR touch(1)
+utility's
+.B -t
+time option argument ([[CC]YY]MMDDhhmm.ss).
.SH FILES
.I @ATJBD@
.br
--- at-3.1.8/at.c-t_option 2004-07-29 19:34:07.304139000 -0400
+++ at-3.1.8/at.c 2004-07-29 19:34:07.575868000 -0400
@@ -688,6 +688,100 @@
return p;
}
+/* Handle POSIX.2 '-t' option :
+ * Parses time string in "touch(1)" format:
+ * [[CC]YY]MMDDhhmm[.ss]
+ * and returns time_t .
+ */
+time_t
+t_option(char *s)
+{
+ time_t t=time(0L);
+ struct tm tm, tm_now=*localtime(&t);
+ int l;
+
+ if((s == 0L) || (*s == '\0'))
+ {
+ return 0L;
+ };
+ memset(&tm,'\0',sizeof(tm));
+ l = strnlen(s,15);
+ switch(l)
+ {
+ case 15:
+ /* CCYYMMDDhhmm.ss */
+ sscanf(s, "%4d%2d%2d%2d%2d.%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+ if(tm.tm_year)
+ tm.tm_year -= 1900 ;
+
+ break;
+
+ case 13:
+ /* YYMMDDhhmm.ss */
+ sscanf(s, "%2d%2d%2d%2d%2d.%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+ if(tm.tm_year)
+ tm.tm_year += 100 ; /* Y2.1K+ bug! */
+
+ break;
+
+ case 11:
+ /* MMDDhhmm.ss */
+ sscanf(s, "%2d%2d%2d%2d.%2d",
+ &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec
+ );
+
+ tm.tm_year = tm_now.tm_year;
+
+ if(tm.tm_mon)
+ tm.tm_mon -= 1;
+ break;
+
+ case 12:
+ /* CCYYMMDDhhmm */
+ sscanf(s, "%4d%2d%2d%2d%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if(tm.tm_year)
+ tm.tm_year -= 1900 ;
+ break;
+
+ case 10:
+ /* YYMMDDhhmm */
+ sscanf(s, "%2d%2d%2d%2d%2d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if(tm.tm_year)
+ tm.tm_year += 100 ; /* Y2.1K+ bug! */
+ break;
+
+ case 8:
+ /* MMDDhhmm */
+ sscanf(s, "%2d%2d%2d%2d",
+ &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min
+ );
+ if( tm.tm_mday )
+ tm.tm_year = tm_now.tm_year;
+ break;
+
+ default:
+ break;
+ }
+
+ if( tm.tm_mon )
+ tm.tm_mon -= 1;
+
+ if( tm.tm_mday )
+ {
+ tm.tm_isdst = tm_now.tm_isdst;
+ return mktime(&tm);
+ }else
+ return 0L;
+}
+
int
main(int argc, char **argv)
{
@@ -697,9 +791,9 @@
char *pgm;
int program = AT; /* our default program */
- char *options = "q:f:MmvldhVc"; /* default options for at */
+ char *options = "q:f:MmvldhVct:"; /* default options for at */
int disp_version = 0;
- time_t timer;
+ time_t timer=0L;
struct passwd *pwe;
struct group *ge;
@@ -802,6 +896,10 @@
options = "";
break;
+ case 't':
+ timer = t_option(optarg);
+ break;
+
default:
usage();
break;
@@ -838,10 +936,13 @@
break;
case AT:
- if (argc > optind) {
- timer = parsetime(argc - optind, argv + optind);
- } else {
- timer = 0;
+ if( timer == 0 )
+ {
+ if (argc > optind) {
+ timer = parsetime(argc - optind, argv + optind);
+ } else {
+ timer = 0;
+ }
}
if (timer == 0) {
@@ -870,16 +971,20 @@
queue = toupper(queue);
else
queue = DEFAULT_BATCH_QUEUE;
-
- if (argc > optind)
- timer = parsetime(argc, argv);
- else
- timer = time(NULL);
+
+ if( timer == 0L )
+ {
+ if (argc > optind)
+ timer = parsetime(argc, argv);
+ else
+ timer = time(NULL);
+ }
if (atverify) {
struct tm *tm = localtime(&timer);
fprintf(stderr, "%s\n", asctime(tm));
}
+
writefile(timer, queue);
break;

28
at.spec
View File

@ -4,7 +4,7 @@
Summary: Job spooling tools. Summary: Job spooling tools.
Name: at Name: at
Version: 3.1.8 Version: 3.1.8
Release: 55 Release: 56
License: GPL License: GPL
Group: System Environment/Daemons Group: System Environment/Daemons
Source: http://ftp.debian.org/debian/pool/main/a/at/at_3.1.8-11.tar.gz Source: http://ftp.debian.org/debian/pool/main/a/at/at_3.1.8-11.tar.gz
@ -28,6 +28,7 @@ Patch20: at-3.1.8-SHELL-111386.patch
Patch21: at-3.1.8-atrun.8-typo-97697.patch Patch21: at-3.1.8-atrun.8-typo-97697.patch
Patch22: at-selinux.patch Patch22: at-selinux.patch
Patch23: at-3.1.8-pie.patch Patch23: at-3.1.8-pie.patch
Patch24: at-3.1.8-t_option.patch
Prereq: fileutils chkconfig /etc/init.d Prereq: fileutils chkconfig /etc/init.d
BuildPrereq: flex bison autoconf BuildPrereq: flex bison autoconf
@ -51,7 +52,9 @@ need to be repeated at the same time every day/week, etc. you should
use crontab instead. use crontab instead.
%{?_without_check: %define _without_check 1} %{?_without_check: %define _without_check 1}
%{!?_without_check: %define _without_check 0} %{!?_without_check: %define _without_check 1}
#%{!?_without_check: %define _without_check 0}
# FIX THIS!
%prep %prep
%setup -q %setup -q
@ -83,6 +86,7 @@ cp %{SOURCE1} .
%patch22 -p1 -b .selinux %patch22 -p1 -b .selinux
%endif %endif
%patch23 -p1 -b .pie %patch23 -p1 -b .pie
%patch24 -p1 -b -t_option
%build %build
# patch10 touches configure.in # patch10 touches configure.in
@ -161,6 +165,26 @@ fi
%attr(4755,root,root) %{_bindir}/at %attr(4755,root,root) %{_bindir}/at
%changelog %changelog
* Thu Jul 29 2004 Jason Vas Dias <jvdias@redhat.com>
- Added POSIX.2 -t option for RFE 127485
* Thu Jul 29 2004 Jason Vas Dias <jvdias@redhat.com>
- Had to disable the 'make test' for the build BEFORE
- any changes were made (building on FC2 - perl issue?)
- test.pl generates these 'errors' for what looks like
- valid output to me:
- $ ./test.pl 2>&1 | egrep -v '(^ok$)|(time_only)'
- 1..3656
- not ok
- 'Monday - 1 month': 'Fri Jul 2 18:29:00 2004' =? 'Sat Jul 3 18:29:00 2004'
- not ok
- 'Monday - 10 months': 'Thu Oct 2 18:29:00 2003' =? 'Fri Oct 3 18:29:00 2003'
- not ok
- 'next week - 1 month': 'Mon Jul 5 18:29:00 2004' =? 'Tue Jul 6 18:29:00 2004'
- not ok
- 'next week - 10 months': 'Sun Oct 5 18:29:00 2003' =? 'Mon Oct 6 18:29:00 2003'
- will investigate and fix for next release.
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com> * Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt - rebuilt