Accepting request 242801 from home:pgajdos

- introduced -o <timeformat> switch for atq [bnc#879402]
  * added at-atq-timeformat.patch

OBS-URL: https://build.opensuse.org/request/show/242801
OBS-URL: https://build.opensuse.org/package/show/Base:System/at?expand=0&rev=85
This commit is contained in:
Stephan Kulow 2014-07-31 11:11:32 +00:00 committed by Git OBS Bridge
parent c5cb2a434b
commit 0a1227f19f
3 changed files with 101 additions and 0 deletions

92
at-atq-timeformat.patch Normal file
View File

@ -0,0 +1,92 @@
Index: at.c
===================================================================
--- at.c.orig 2014-07-25 10:59:06.264608764 +0200
+++ at.c 2014-07-25 11:00:04.036607665 +0200
@@ -132,9 +132,10 @@
char *namep;
char atfile[] = ATJOB_DIR "/12345678901234";
-char *atinput = (char *) 0; /* where to get input from */
-char atqueue = 0; /* which queue to examine for jobs (atq) */
-char atverify = 0; /* verify time instead of queuing job */
+char *atinput = (char *) 0; /* where to get input from */
+char atqueue = 0; /* which queue to examine for jobs (atq) */
+char atverify = 0; /* verify time instead of queuing job */
+char *timeformat = TIMEFORMAT_POSIX; /* time format (atq) */
/* Function declarations */
@@ -494,7 +495,7 @@
runtime = localtime(&runtimer);
- strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime);
+ strftime(timestr, TIMESIZE, timeformat, runtime);
fprintf(stderr, "job %ld at %s\n", jobno, timestr);
/* Signal atd, if present. Usual precautions taken... */
@@ -608,7 +609,7 @@
runtimer = 60 * (time_t) ctm;
runtime = localtime(&runtimer);
- strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime);
+ strftime(timestr, TIMESIZE, timeformat, runtime);
if ((pwd = getpwuid(buf.st_uid)))
printf("%ld\t%s %c %s\n", jobno, timestr, queue, pwd->pw_name);
@@ -805,7 +806,7 @@
*/
if (strcmp(pgm, "atq") == 0) {
program = ATQ;
- options = "hq:V";
+ options = "hq:Vo:";
} else if (strcmp(pgm, "atrm") == 0) {
program = ATRM;
options = "hV";
@@ -889,6 +890,10 @@
timer -= timer % 60;
break;
+ case 'o':
+ timeformat = optarg;
+ break;
+
default:
usage();
break;
Index: at.1.in
===================================================================
--- at.1.in.orig 2014-07-25 10:59:06.204608765 +0200
+++ at.1.in 2014-07-25 11:17:27.828587820 +0200
@@ -29,6 +29,8 @@
.RB [ -V ]
.RB [ -q
.IR queue ]
+.RB [ -o
+.IR timeformat ]
.br
.B at
.RB [ -rd ]
@@ -254,6 +256,9 @@
.B
\-c
cats the jobs listed on the command line to standard output.
+.TP 8
+.BI \-o " fmt"
+strftime-like time format used for the job list
.SH FILES
.I @ATJBD@
.br
Index: panic.c
===================================================================
--- panic.c.orig 2014-07-25 10:59:06.168608765 +0200
+++ panic.c 2014-07-25 11:06:20.232600513 +0200
@@ -96,7 +96,7 @@
" at [-V] [-q x] [-f file] [-mMlbv] -t time\n"
" at -c job ...\n"
" at [-V] -l [job ...]\n"
- " atq [-V] [-q x]\n"
+ " atq [-V] [-q x] [-o timeformat]\n"
" at [ -rd ] job ...\n"
" atrm [-V] job ...\n"
" batch\n");

View File

@ -10,6 +10,12 @@ Mon Jul 28 03:32:36 UTC 2014 - crrodriguez@opensuse.org
- Restore needed call to fillup_only that went lost in the
previous change.
-------------------------------------------------------------------
Fri Jul 25 09:20:31 UTC 2014 - pgajdos@suse.com
- introduced -o <timeformat> switch for atq [bnc#879402]
* added at-atq-timeformat.patch
-------------------------------------------------------------------
Mon Jun 16 14:27:26 UTC 2014 - vdziewiecki@suse.com

View File

@ -58,6 +58,8 @@ Patch22: at-piddir.patch
Patch23: at-secure_getenv.patch
#PATCH-FIX-OPENSUSE backport privs from 3.1.8 (bnc#849720)
Patch24: at-backport-old-privs.patch
#PATCH-FEATURE-UPSTREAM introduce -o <timeformat> argument for atq (bnc#879402)
Patch25: at-atq-timeformat.patch
BuildRequires: autoconf >= 2.69
BuildRequires: automake
@ -102,6 +104,7 @@ This program allows you to run jobs at specified times.
%patch22
%patch23 -p1
%patch24 -p1
%patch25
%build
rm -fv y.tab.c y.tab.h lex.yy.c lex.yy.o y.tab.o