Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (6330dd89166b7298b3c46f7b3a8947b78afb5892)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Vlad Glagolev <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (6330dd89166b7298b3c46f7b3a8947b78afb5892)
  • Date: Mon, 11 Apr 2016 15:49:14 +0000

GIT changes to master grimoire by Vlad Glagolev <stealth AT sourcemage.org>:

utils/newsyslog/CONFIGURE | 1 +
utils/newsyslog/DETAILS | 1 +
utils/newsyslog/HISTORY | 6 ++++++
utils/newsyslog/PRE_BUILD | 6 ++++++
utils/newsyslog/offset.patch | 35 +++++++++++++++++++++++++++++++++++
5 files changed, 49 insertions(+)

New commits:
commit 6330dd89166b7298b3c46f7b3a8947b78afb5892
Author: Vlad Glagolev <stealth AT sourcemage.org>
Commit: Vlad Glagolev <stealth AT sourcemage.org>

newsyslog: added offset patch

diff --git a/utils/newsyslog/CONFIGURE b/utils/newsyslog/CONFIGURE
new file mode 100755
index 0000000..f9271b1
--- /dev/null
+++ b/utils/newsyslog/CONFIGURE
@@ -0,0 +1 @@
+config_query NEWSYSLOG_OFFSET "Apply offset patch (allows to properly
rotate/archive logs with '-s' flag using proper expansion of date)?" n
diff --git a/utils/newsyslog/DETAILS b/utils/newsyslog/DETAILS
index 9ce5f3d..e86d3b2 100755
--- a/utils/newsyslog/DETAILS
+++ b/utils/newsyslog/DETAILS
@@ -1,5 +1,6 @@
SPELL=newsyslog
VERSION=1.9
+ PATCHLEVEL=1
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE2=$SOURCE.asc
SOURCE_URL[0]=http://archives.eyrie.org/software/system/$SOURCE
diff --git a/utils/newsyslog/HISTORY b/utils/newsyslog/HISTORY
index 04d5473..c604f21 100644
--- a/utils/newsyslog/HISTORY
+++ b/utils/newsyslog/HISTORY
@@ -1,3 +1,9 @@
+2016-04-08 Vlad Glagolev <stealth AT sourcemage.org>
+ * DETAILS: PATCHLEVEL=1
+ * CONFIGURE: added, introduces NEWSYSLOG_OFFSET option
+ * PRE_BUILD: added, to apply patch
+ * offset.patch: added, to proper expand date when using '-s' flag
+
2012-03-09 Vlad Glagolev <stealth AT sourcemage.org>
* DETAILS: updated spell to 1.9
* 0AFC7476.gpg: deleted
diff --git a/utils/newsyslog/PRE_BUILD b/utils/newsyslog/PRE_BUILD
new file mode 100755
index 0000000..27b1e6e
--- /dev/null
+++ b/utils/newsyslog/PRE_BUILD
@@ -0,0 +1,6 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+
+if [[ $NEWSYSLOG_OFFSET == y ]]; then
+ patch -p0 < "$SPELL_DIRECTORY/offset.patch"
+fi
diff --git a/utils/newsyslog/offset.patch b/utils/newsyslog/offset.patch
new file mode 100644
index 0000000..6e87e86
--- /dev/null
+++ b/utils/newsyslog/offset.patch
@@ -0,0 +1,35 @@
+--- main.c.orig 2011-12-16 16:48:41.000000000 -0500
++++ main.c 2016-04-08 00:31:08.000000000 -0400
+@@ -22,6 +22,7 @@
+
+ #include <internal.h>
+ #include <util/messages.h>
++#include <util/xmalloc.h>
+
+ /* Global variable saying whether to use bzip2 for log compression. */
+ bool use_bzip2 = false;
+@@ -86,11 +87,13 @@
+ {
+ struct class *class, *current;
+ struct log *log;
++ char *template, *path;
+ int opt;
+ const char *conffile;
+ char *end;
+ bool check_only = false;
+ struct stat st;
++ time_t now;
+
+ /* Look for command-line options. */
+ while ((opt = getopt(argc, argv, "bchs:v")) != EOF)
+@@ -141,6 +144,10 @@
+ * non-regular files properly anyway.
+ */
+ for (log = current->logs; log != NULL; log = log->next) {
++ now = time(NULL) - (skew_minutes * 60);
++ template = expand(log->archive->template, log->name, now);
++ xasprintf(&log->path, "%s", template);
++ free(template);
+ if (stat(log->path, &st) < 0)
+ syswarn("Cannot stat %s", log->path);
+ else if (!S_ISREG(st.st_mode)) {



  • [SM-Commit] GIT changes to master grimoire by Vlad Glagolev (6330dd89166b7298b3c46f7b3a8947b78afb5892), Vlad Glagolev, 04/11/2016

Archive powered by MHonArc 2.6.24.

Top of Page