Author: sandervanderburg
Date: Tue Apr 26 22:25:49 2011
New Revision: 26982
URL: https://svn.nixos.org/websvn/nix/?rev=26982&sc=1
Log:
It's now possivle to write nested attribute sets inside the infrastructure
model without getting a segfault. These attributes are not available in
activation scripts, however
Modified:
disnix/disnix/trunk/src/libmanifest/activationmapping.c
disnix/disnix/trunk/tests/manifest/infrastructure-single.nix
disnix/disnix/trunk/tests/manifest/infrastructure.nix
Modified: disnix/disnix/trunk/src/libmanifest/activationmapping.c
==============================================================================
--- disnix/disnix/trunk/src/libmanifest/activationmapping.c Tue Apr 26
20:57:21 2011 (r26981)
+++ disnix/disnix/trunk/src/libmanifest/activationmapping.c Tue Apr 26
22:25:49 2011 (r26982)
@@ -207,7 +207,11 @@
if(xmlStrcmp(target_children->name, (xmlChar*) "text")
!= 0) /* It seems that a text node is added when the manifest is pretty printed
*/
{
property->name = g_strdup(target_children->name);
- property->value =
g_strdup(target_children->children->content);
+
+ if(target_children->children == NULL)
+ property->value = NULL;
+ else
+ property->value =
g_strdup(target_children->children->content);
g_array_append_val(target, property);
}
@@ -250,7 +254,11 @@
if(xmlStrcmp(target_children->name,
(xmlChar*) "text") != 0) /* It seems that a text node is added when the
manifest is pretty printed */
{
property->name =
g_strdup(target_children->name);
- property->value =
g_strdup(target_children->children->content);
+
+ if(target_children->children ==
NULL)
+ property->value = NULL;
+ else
+ property->value =
g_strdup(target_children->children->content);
g_array_append_val(target,
property);
}
Modified: disnix/disnix/trunk/tests/manifest/infrastructure-single.nix
==============================================================================
--- disnix/disnix/trunk/tests/manifest/infrastructure-single.nix Tue Apr
26 20:57:21 2011 (r26981)
+++ disnix/disnix/trunk/tests/manifest/infrastructure-single.nix Tue Apr
26 22:25:49 2011 (r26982)
@@ -2,5 +2,9 @@
testtarget1 = {
hostname = "testtarget1";
supportedTypes = [ "echo" "process" "wrapper" ];
+
+ meta = {
+ description = "A single test target";
+ };
};
}
Modified: disnix/disnix/trunk/tests/manifest/infrastructure.nix
==============================================================================
--- disnix/disnix/trunk/tests/manifest/infrastructure.nix Tue Apr 26
20:57:21 2011 (r26981)
+++ disnix/disnix/trunk/tests/manifest/infrastructure.nix Tue Apr 26
22:25:49 2011 (r26982)
@@ -2,10 +2,18 @@
testtarget1 = {
hostname = "testtarget1";
supportedTypes = [ "echo" "process" "wrapper" ];
+
+ meta = {
+ description = "The first test target";
+ };
};
testtarget2 = {
hostname = "testtarget2";
supportedTypes = [ "echo" "process" "wrapper" ];
+
+ meta = {
+ description = "The second test target";
+ };
};
}
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits