help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: convert : to + for module support on Windows


From: Jeremy Mates
Subject: Patch: convert : to + for module support on Windows
Date: Sat, 27 Aug 2005 09:39:14 -0700
User-agent: Mutt/1.4.2i

The following patch for cfengine 2.1.15 converts : in filenames to +
This works around the special meaning of : in Windows filenames. For
additional (as yet incomplete) information about cfengine on
Windows, see:

http://sial.org/howto/cfengine/windows/


--- cfengine-2.1.15/src/image.c.orig    2005-05-29 04:04:05.000000000 -0700
+++ cfengine-2.1.15/src/image.c 2005-08-27 09:15:24.000000000 -0700
@@ -716,6 +716,16 @@
 
 ExpandVarstring(ip->server,server,NULL);
 
+#ifdef NT
+int colon_location;
+for (colon_location = 0; colon_location < strlen(destfile); colon_location++) {
+  if (destfile[colon_location] == ':') {
+    Debug2("Found : in filename on NT, replacing with +\n");
+    destfile[colon_location] = '+';
+  }
+}
+#endif
+
 if ((strcmp(sourcefile,destfile) == 0) && (strcmp(ip->server,"localhost") == 
0))
    {
    snprintf(OUTPUT,CF_BUFSIZE*2,"Image loop: file/dir %s copies to 
itself",sourcefile);
--- cfengine-2.1.15/src/modules.c.orig  2005-02-08 03:50:02.000000000 -0800
+++ cfengine-2.1.15/src/modules.c       2005-08-27 09:15:30.000000000 -0700
@@ -63,6 +63,16 @@
    CfLog(cferror,OUTPUT,"");
    }
 
+#ifdef NT
+      int i;
+      for (i = 0; i < strlen(actiontxt); i++) {
+         if (actiontxt[i] == ':') {
+            Debug2("Found : in modulename on NT, replacing with +\n");
+            actiontxt[i] = '+';
+         }
+      }
+#endif
+
 if (GetMacroValue(CONTEXTID,"moduledirectory"))
    {
    ExpandVarstring("$(moduledirectory)",ebuff,NULL);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]