Hi,

I notice that my patch again did not make it to an official Debian
release :-(

Attached is the patch updated for 3.2.5.


Paul
diff -ru at-3.2.5.orig/at.1.in at-3.2.5/at.1.in
--- at-3.2.5.orig/at.1.in.orig  2022-02-05 11:00:57.000000000 +0100
+++ at-3.2.5.orig/at.1.in       2023-06-22 16:02:59.448801528 +0200
@@ -10,7 +10,7 @@
 .IR file ]
 .RB [ \-u
 .IR username ]
-.RB [ \-mMlv ]
+.RB [ \-mMlvs ]
 .IR timespec " ...\&"
 .br
 .B at
@@ -21,7 +21,7 @@
 .IR file ]
 .RB [ \-u
 .IR username ]
-.RB [ \-mMkv ]
+.RB [ \-mMkvs ]
 .RB [ \-t
 .IR time ]
 .br
@@ -278,6 +278,9 @@
 .P
 Times displayed will be in the format "Thu Feb 20 14:50:00 1997".
 .TP
+.B \-s
+Be silent; don't output "job xx at xxx" or "warning: commands will be executed 
using /bin/sh" messages when jobs are created.
+.TP
 .B
 \-c
 cats the jobs listed on the command line to standard output.
diff -ru at-3.2.5.orig/at.c at-3.2.5/at.c
--- at-3.2.5.orig/at.c.orig     2022-02-05 11:00:57.000000000 +0100
+++ at-3.2.5.orig/at.c  2023-06-22 16:05:26.998399592 +0200
@@ -122,6 +122,7 @@
     "TERM", "DISPLAY", "_", "SHELLOPTS", "BASH_VERSINFO", "EUID", "GROUPS", 
"PPID", "UID"
 };
 static int send_mail = 0;
+static int silent = 0;
 
 /* External variables */
 
@@ -543,10 +544,12 @@
     close(fd2);
 
     /* This line maybe superfluous after commit 
11cb731bb560eb7bff4889c5528d5f776606b0d3 */
-    runtime = localtime(&runtimer);
+    if (!silent) {
+       runtime = localtime(&runtimer);
 
-    strftime(timestr, TIMESIZE, timeformat, runtime);
-    fprintf(stderr, "job %ld at %s\n", jobno, timestr);
+       strftime(timestr, TIMESIZE, timeformat, runtime);
+       fprintf(stderr, "job %ld at %s\n", jobno, timestr);
+    }
 
     /* Signal atd, if present. Usual precautions taken... */
     fd = open(PIDFILE, O_RDONLY);
@@ -834,7 +837,7 @@
     char *pgm;
 
     int program = AT;          /* our default program */
-    char *options = "q:f:Mmu:bvlrdhVct:";      /* default options for at */
+    char *options = "q:f:Mmu:bvlrdhVct:s";     /* default options for at */
     int disp_version = 0;
     time_t timer = 0;
     long *joblist = NULL;
@@ -957,6 +960,10 @@
            timeformat = optarg;
             break;
 
+       case 's':
+           silent = 1;
+           break;
+
        default:
            usage();
            break;
@@ -1040,7 +1047,9 @@
           It also alows a warning diagnostic to be printed.  Because of the
           possible variance, we always output the diagnostic. */
 
-       fprintf(stderr, "warning: commands will be executed using /bin/sh\n");
+       if (!silent) {
+           fprintf(stderr, "warning: commands will be executed using 
/bin/sh\n");
+       }
 
        writefile(timer, queue);
        break;
diff -ru at-3.2.5.orig/panic.c at-3.2.5/panic.c
--- at-3.2.5.orig/panic.c.orig  2022-02-05 11:00:57.000000000 +0100
+++ at-3.2.5.orig/panic.c       2023-06-22 16:06:14.354912480 +0200
@@ -92,8 +92,8 @@
 {
 /* Print usage and exit.
  */
-    fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-u username] [-mMlbv] 
timespec ...\n"
-            "       at [-V] [-q x] [-f file] [-u username] [-mMlbv] -t time\n"
+    fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-u username] [-mMlbvs] 
timespec ...\n"
+            "       at [-V] [-q x] [-f file] [-u username] [-mMlbvs] -t time\n"
            "       at -c job ...\n"
            "       at [-V] -l [-o timeformat] [job ...]\n"
            "       atq [-V] [-q x] [-o timeformat] [job ...]\n"

Reply via email to