public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - config: Record time/date rather than path
@ 2009-09-09 13:39 Lon Hohberger
0 siblings, 0 replies; only message in thread
From: Lon Hohberger @ 2009-09-09 13:39 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7b104c967022cf1d1b961e65ebd9796edf485c4f
Commit: 7b104c967022cf1d1b961e65ebd9796edf485c4f
Parent: 64b7b036cdbb228508bbe2c3c667fc775b940c79
Author: Lon Hohberger <lhh@redhat.com>
AuthorDate: Wed Sep 9 09:38:01 2009 -0400
Committer: Lon Hohberger <lhh@redhat.com>
CommitterDate: Wed Sep 9 09:38:01 2009 -0400
config: Record time/date rather than path
Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
config/plugins/ldap/99cluster.ldif | 2 +-
config/tools/ldap/rng2ldif/rng2ldif.c | 14 +++++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/config/plugins/ldap/99cluster.ldif b/config/plugins/ldap/99cluster.ldif
index a894abb..5fc9ee8 100644
--- a/config/plugins/ldap/99cluster.ldif
+++ b/config/plugins/ldap/99cluster.ldif
@@ -1,4 +1,4 @@
-# Auto-generated from ../../xml/cluster.rng
+# Auto-generated @ 2009-09-09 09:35:50
dn: cn=schema
attributeTypes: (
1.3.6.1.4.1.2312.8.1.1.15 NAME 'rhcsAlias'
diff --git a/config/tools/ldap/rng2ldif/rng2ldif.c b/config/tools/ldap/rng2ldif/rng2ldif.c
index 39e2cbc..ea99e8b 100644
--- a/config/tools/ldap/rng2ldif/rng2ldif.c
+++ b/config/tools/ldap/rng2ldif/rng2ldif.c
@@ -3,6 +3,7 @@
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
+#include <time.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
@@ -126,6 +127,9 @@ write_ldap_schema(const char *rng, const char *arg,
struct ldap_object_node *obj = NULL;
char filename[4096];
FILE *out_ldap = NULL;
+ char now_asc[128];
+ time_t now;
+ struct tm now_tm;
int fd = -1;
if (!strcmp(arg, "-")) {
@@ -146,7 +150,15 @@ write_ldap_schema(const char *rng, const char *arg,
}
}
- fprintf(out_ldap, "# Auto-generated from %s\n", rng);
+ now = time(NULL);
+ memset(&now_tm, 0, sizeof(now_tm));
+ if (localtime_r(&now, &now_tm) == NULL) {
+ snprintf(now_asc, sizeof(now_asc), "???");
+ } else {
+ strftime(now_asc, sizeof(now_asc), "%F %T", &now_tm);
+ }
+
+ fprintf(out_ldap, "# Auto-generated @ %s\n", now_asc);
fprintf(out_ldap, "dn: cn=schema\n");
for (attr = attrs; attr; attr = attr->next)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-09 13:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-09 13:39 cluster: STABLE3 - config: Record time/date rather than path Lon Hohberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).