Use ISO format instead of posix.

This commit is contained in:
Marcela Mašláňová 2008-03-25 14:00:46 +00:00
parent 6635d052b3
commit 82024fce9a
2 changed files with 48 additions and 1 deletions

View File

@ -6,7 +6,7 @@
Summary: Job spooling tools
Name: at
Version: 3.1.10
Release: 22%{?dist}
Release: 23%{?dist}
License: GPLv2+
Group: System Environment/Daemons
URL: http://ftp.debian.org/debian/pool/main/a/at
@ -32,6 +32,7 @@ Patch14: at-3.1.10-pam_keyring.patch
Patch15: at-3.1.10-PIE.patch
Patch16: at-3.1.10-pamfix.patch
Patch17: at-3.1.10-setuids.patch
Patch18: nonposix.patch
BuildRequires: fileutils chkconfig /etc/init.d
BuildRequires: flex bison autoconf
@ -83,6 +84,7 @@ cp %{SOURCE1} .
%patch15 -p1 -b .PIE
%patch16 -p1 -b .pamfix
%patch17 -p1 -b .setuids
%patch18 -p1 -b .nonposix
%build
# patch10 touches configure.in
@ -185,6 +187,9 @@ fi
%attr(4755,root,root) %{_bindir}/at
%changelog
* Tue Mar 25 2008 Marcela Maslanova <mmaslano@redhat.com> - 3.1.10-23
- 436952 use local instead of posix output date/time format.
* Thu Feb 28 2008 Marcela Maslanova <mmaslano@redhat.com> - 3.1.10-22
- #435250 mixed OPTS and OPTIONS variable in sysconfig

42
nonposix.patch Normal file
View File

@ -0,0 +1,42 @@
diff -up at-3.1.10/at.c.nonposix at-3.1.10/at.c
--- at-3.1.10/at.c.nonposix 2008-03-25 14:54:09.000000000 +0100
+++ at-3.1.10/at.c 2008-03-25 14:57:46.000000000 +0100
@@ -92,6 +92,7 @@
#define SIZE 255
#define TIMEFORMAT_POSIX "%a %b %e %T %Y"
+#define TIMEFORMAT_ISO "%Y-%m-%d %H:%M"
#define TIMESIZE 50
enum {
@@ -490,7 +491,15 @@ writefile(time_t runtimer, char queue)
runtime = localtime(&runtimer);
- strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime);
+ /* We only use the sick POSIX time format if POSIXLY_CORRECT
+ is set. Otherwise, we use ISO format.
+ */
+
+ if (getenv("POSIXLY_CORRECT") != NULL) {
+ strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime);
+ } else {
+ strftime(timestr, TIMESIZE, TIMEFORMAT_ISO, runtime);
+ }
fprintf(stderr, "job %ld at %s\n", jobno, timestr);
/* Signal atd, if present. Usual precautions taken... */
@@ -588,8 +597,11 @@ list_jobs(void)
runtimer = 60 * (time_t) ctm;
runtime = localtime(&runtimer);
- strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime);
-
+ if (getenv("POSIXLY_CORRECT") != NULL) {
+ strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime);
+ } else {
+ strftime(timestr, TIMESIZE, TIMEFORMAT_ISO, runtime);
+ }
if ((pwd = getpwuid(buf.st_uid)))
printf("%ld\t%s %c %s\n", jobno, timestr, queue, pwd->pw_name);
else