summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--boot-conf.in14
-rwxr-xr-xdisks-conf.in18
-rwxr-xr-xhardware-conf.in8
-rw-r--r--media.pl.in10
-rwxr-xr-xmemory-conf.in10
-rwxr-xr-xnetwork-conf.in6
-rw-r--r--removable-media.pl.in4
-rwxr-xr-xtime-conf.in10
-rw-r--r--users-conf.in38
-rw-r--r--xml.pl.in25
11 files changed, 89 insertions, 68 deletions
diff --git a/ChangeLog b/ChangeLog
index babaf8b..9c5666a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2001-03-12 Hans Petter Jansson <hpj@ximian.com>
+
+ * xml.pl.in (xst_xml_indent): -> xst_xml_print_indent.
+ (xst_xml_vspace): -> xst_xml_print_vspace.
+ (xst_xml_print_string): Implement.
+ (xst_xml_print_line): Use xst_xml_print_string().
+
+ * boot-conf.in disks-conf.in hardware-conf.in
+ media.pl.in memory-conf.in network-conf.in
+ removable-media.pl.in time-conf.in users-conf.in:
+
+ xst_xml_indent -> xst_xml_print_indent.
+ xst_xml_vspace -> xst_xml_print_vspace.
+
2001-03-08 Arturo Espinosa <arturo@ximian.com>
* service.pl.in: New functions to handle SysV rc
diff --git a/boot-conf.in b/boot-conf.in
index 61e3fd5..9029478 100644
--- a/boot-conf.in
+++ b/boot-conf.in
@@ -176,7 +176,7 @@ sub xml_print_images
foreach $entry (@$array)
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<entry>\n");
&xst_xml_enter ();
@@ -192,7 +192,7 @@ sub xml_print_images
&xst_xml_print_line ("</entry>\n");
}
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
}
@@ -203,20 +203,20 @@ sub xml_print
print "<?xml version='1.0' encoding='ISO-8859-1' standalone='yes'?>\n";
print "<!DOCTYPE boot []>\n\n";
print "<boot>\n";
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_enter ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- Configuration starts here -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xml_print_global_kws ($h);
&xml_print_globals ($h);
&xml_print_images ($h, 'images');
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- End of configuration -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_leave ();
&xst_xml_print_line ("</boot>\n");
diff --git a/disks-conf.in b/disks-conf.in
index a9d0d6f..7ee3f07 100755
--- a/disks-conf.in
+++ b/disks-conf.in
@@ -654,11 +654,11 @@ sub xml_print
print "<disks>\n";
&xst_xml_enter ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- Configuration starts here -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- Local fixed media and partitions -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
my @disks = @cf_disks;
@@ -668,7 +668,7 @@ sub xml_print
{
my $disk = $disks[0];
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<disk>\n");
&xst_xml_enter ();
@@ -681,7 +681,7 @@ sub xml_print
{
my $partition = $$partitions[0];
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<partition>\n");
&xst_xml_enter ();
@@ -696,7 +696,7 @@ sub xml_print
&xst_xml_print_line ("<bootable state='" . &xst_print_boolean_truefalse(%$partition->{bootable}) . "'/>");
print "<integritycheck state='" . &xst_print_boolean_truefalse(%$partition->{check}) . "'/>\n";
- &xst_xml_indent ();
+ &xst_xml_print_indent ();
print "<mounted state='" . &xst_print_boolean_truefalse(%$partition->{mounted}) . "'/>";
print "<listed state='" . &xst_print_boolean_truefalse(%$partition->{listed}) . "'/>";
print "<detected state='" . &xst_print_boolean_truefalse(%$partition->{detected}) . "'/>\n";
@@ -709,15 +709,15 @@ sub xml_print
&xst_xml_leave ();
&xst_xml_print_line ("</disk>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
}
shift @disks;
}
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- End of configuration -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_leave ();
print "</disks>\n";
diff --git a/hardware-conf.in b/hardware-conf.in
index 417f7d6..54e4da4 100755
--- a/hardware-conf.in
+++ b/hardware-conf.in
@@ -254,9 +254,9 @@ sub xml_print
print "<hardware>\n";
&xst_xml_enter ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- Configuration starts here -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
foreach $entry (@cf_hardware)
{
@@ -311,11 +311,11 @@ sub xml_print
}
&xst_xml_print_line ("</device>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
}
&xst_xml_print_line ("<!-- End of configuration -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_leave ();
print "</hardware>\n";
diff --git a/media.pl.in b/media.pl.in
index 09a4e16..e6890f1 100644
--- a/media.pl.in
+++ b/media.pl.in
@@ -151,13 +151,13 @@ sub xst_media_xml_print
{
my @devices = @_;
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<media>\n");
&xst_xml_enter ();
for $dev (@devices)
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<device>\n");
&xst_xml_enter ();
&xst_xml_print_line ("<name>" . $dev->{"device"} . "</name>\n");
@@ -168,7 +168,7 @@ sub xst_media_xml_print
if ($dev->{"media"} ne "disk")
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
if ($dev->{"point_listed"})
{
&xst_xml_print_line ("<point_listed>" . $dev->{"point_listed"} . "</point_listed>\n");
@@ -179,12 +179,12 @@ sub xst_media_xml_print
&xst_xml_leave ();
&xst_xml_print_line ("</device>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
}
&xst_xml_leave ();
&xst_xml_print_line ("</media>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
}
diff --git a/memory-conf.in b/memory-conf.in
index 4f90a49..1b5cf83 100755
--- a/memory-conf.in
+++ b/memory-conf.in
@@ -184,16 +184,16 @@ sub xml_print
print "<memory>\n";
&xst_xml_enter ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- Configuration starts here -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
foreach $entry (@cf_memory) {
&xst_xml_print_line ("<memsize>$entry->{MemTotal}</memsize>\n");
&xst_xml_print_line ("<swapsize>$entry->{SwapTotal}</swapsize>\n");
}
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
foreach $entry (@cf_partition) {
&xst_xml_print_line ("<partition>\n");
@@ -204,7 +204,7 @@ sub xml_print
&xst_xml_print_line ("</partition>\n");
}
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
foreach $entry (@cf_swapinfo) {
&xst_xml_print_line ("<swapdev>\n");
@@ -226,7 +226,7 @@ sub xml_print
}
&xst_xml_print_line ("<!-- End of configuration -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_leave ();
print "</memory>\n";
diff --git a/network-conf.in b/network-conf.in
index 8eaa840..5096800 100755
--- a/network-conf.in
+++ b/network-conf.in
@@ -212,7 +212,7 @@ sub xml_print_statichost
my ($h) = $_[0];
my $statichost, $i, $j, $val;
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
foreach $i (keys %{$$h{"statichost"}})
{
$statichost = $ {$$h{"statichost"}}{$i};
@@ -242,7 +242,7 @@ sub xml_print
print "<?xml version='1.0' encoding='ISO-8859-1' standalone='yes'?>\n";
print "<!DOCTYPE network []>\n\n";
print "<network>\n";
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_enter ();
# Hostname, domain, search domains, nameservers.
@@ -255,7 +255,7 @@ sub xml_print
&xst_xml_print_hash_hash ($$h{"dialing"}, "dialing");
&xst_xml_leave ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("</network>\n");
}
diff --git a/removable-media.pl.in b/removable-media.pl.in
index 47604df..34a754e 100644
--- a/removable-media.pl.in
+++ b/removable-media.pl.in
@@ -49,7 +49,7 @@ sub xst_removable_media_get_list
sub xst_removable_media_xml_print
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<removables>\n");
&xst_xml_enter ();
@@ -57,5 +57,5 @@ sub xst_removable_media_xml_print
&xst_xml_leave ();
&xst_xml_print_line ("</removables>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
}
diff --git a/time-conf.in b/time-conf.in
index ce1bd34..956fc2a 100755
--- a/time-conf.in
+++ b/time-conf.in
@@ -168,12 +168,12 @@ sub xml_print
print "<!DOCTYPE time []>\n\n";
print "<time>\n";
&xst_xml_enter ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_hash ($$h{"local_time"}, "local_time");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<sync active='" . &xst_print_boolean_yesno ($sync_active) . "'>\n");
&xst_xml_enter ();
@@ -184,10 +184,10 @@ sub xml_print
&xst_xml_leave ();
&xst_xml_print_line ("</sync>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_scalars ($h, @scalar_keys);
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_leave ();
&xst_xml_print_line ("</time>\n");
diff --git a/users-conf.in b/users-conf.in
index b383557..ad08943 100644
--- a/users-conf.in
+++ b/users-conf.in
@@ -720,7 +720,7 @@ sub xml_print_nis
&xst_xml_enter ();
foreach $i (@users)
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<user>\n");
&xst_xml_enter ();
for ($j = 0; $j < ($#users_prop_array - 1) / 2; $j++) {
@@ -731,17 +731,17 @@ sub xml_print_nis
}
&xst_xml_leave ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("</nis_userdb>\n");
&xst_xml_print_line ("<!-- Now the groups -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<nis_groupdb>\n");
&xst_xml_enter ();
foreach $i (@groups)
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<group>\n");
&xst_xml_enter ();
for ($j = 0; $j < ($#groups_prop_array - 1) / 2 - 1; $j++) {
@@ -761,7 +761,7 @@ sub xml_print_nis
&xst_xml_print_line ("</group>\n");
}
&xst_xml_leave ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("</nis_groupdb>\n");
}
@@ -774,9 +774,9 @@ sub xml_print
print "<users>\n";
&xst_xml_enter ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- login.defs configuration starts here -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<logindefs>\n");
&xst_xml_enter ();
@@ -788,20 +788,20 @@ sub xml_print
}
&xst_xml_leave ();
&xst_xml_print_line ("</logindefs>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- Now the users -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- When was the passwd file last modified (since the epoch)? -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<passwd_last_modified>$passwd_last_modified</passwd_last_modified>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<userdb>\n");
&xst_xml_enter ();
foreach $i (@users)
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<user>\n");
&xst_xml_enter ();
for ($j = 0; $j < ($#users_prop_array - 1) / 2; $j++) {
@@ -811,22 +811,22 @@ sub xml_print
&xst_xml_print_line ("</user>\n");
}
&xst_xml_leave ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("</userdb>\n");
&xst_xml_print_line ("<!-- Now the groups -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<!-- When was the group file last modified (since the epoch)? -->\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<group_last_modified>$group_last_modified</group_last_modified>\n");
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<groupdb>\n");
&xst_xml_enter ();
foreach $i (@groups)
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<group>\n");
&xst_xml_enter ();
for ($j = 0; $j < ($#groups_prop_array - 1) / 2 - 1; $j++) {
@@ -846,13 +846,13 @@ sub xml_print
&xst_xml_print_line ("</group>\n");
}
&xst_xml_leave ();
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("</groupdb>\n");
# This for test purposes only
&xml_print_nis () if $TEST_NIS;
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_leave ();
print "</users>\n";
}
diff --git a/xml.pl.in b/xml.pl.in
index 59d74e1..e9901a6 100644
--- a/xml.pl.in
+++ b/xml.pl.in
@@ -32,8 +32,8 @@ require "___scriptsdir___/debug.pl";
# &xst_xml_enter: Call after entering a block. Increases indent level.
# &xst_xml_leave: Call before leaving a block. Decreases indent level.
-# &xst_xml_indent: Call before printing a line. Indents to current level.
-# &xst_xml_vspace: Ensures there is a vertical space of one and only one line.
+# &xst_xml_print_indent: Call before printing a line. Indents to current level.
+# &xst_xml_print_vspace: Ensures there is a vertical space of one and only one line.
# &xst_xml_print: Indent, then print all arguments. Just for sugar.
@@ -53,7 +53,14 @@ sub xst_xml_leave
}
-sub xst_xml_indent
+sub xst_xml_print_string
+{
+ print $_[0];
+ &xst_debug_print_string_to_file ("out.xml", @_[0]);
+}
+
+
+sub xst_xml_print_indent
{
my $i;
my $indent_string;
@@ -64,7 +71,7 @@ sub xst_xml_indent
}
-sub xst_xml_vspace
+sub xst_xml_print_vspace
{
if (not $xst_have_vspace)
{
@@ -76,14 +83,14 @@ sub xst_xml_vspace
sub xst_xml_print_line
{
- &xst_xml_indent;
- print @_;
+ &xst_xml_print_indent ();
+ &xst_xml_print_string ($_[0]);
}
sub xst_xml_print_state
{
- &xst_xml_indent;
+ &xst_xml_print_indent;
print "<" . @_[0] . " state='" . &xst_print_boolean_truefalse (@_[1]) . "'/>";
}
@@ -112,7 +119,7 @@ sub xst_xml_print_arrays
{
if (exists $$h{$i})
{
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
foreach $j (@{$$h{$i}})
{
$val = &xst_xml_quote ($j);
@@ -129,7 +136,7 @@ sub xst_xml_print_hash
my ($hash, $tag) = @_;
my $j, $val;
- &xst_xml_vspace ();
+ &xst_xml_print_vspace ();
&xst_xml_print_line ("<$tag>\n");
&xst_xml_enter ();