I've been having problems installing since this update. I'm using FC4
with make test from the most current trunk. I also tried last
night's nightly just to confirm. Here's the output I'm getting
in oscar_wizard:
=============================================================================
== Prerequisites installed
=============================================================================
--> OSCAR version: 5.0a1r5075
--> Command line invocation: ./install_cluster eth0
--> Hostname: headnode
--> DNS domain name:
--> Network interface: eth0
--> Linux distribution: fedora 4
--> Kernel version: 2.6.11-1.1369_FC4smp
--> Architecture: i386
--> Running in directory: /tmp/oscar-trunk
--> PATH:
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
--> Running: "./oscar_wizard"
Global symbol "$values" requires explicit package name at
/tmp/oscar-trunk/lib/OSCAR/Configbox.pm line 272.
Compilation failed in require at /tmp/oscar-trunk/lib/OSCAR/Configurator.pm
line 39.
BEGIN failed--compilation aborted at
/tmp/oscar-trunk/lib/OSCAR/Configurator.pm line 39.
Compilation failed in require at ./oscar_wizard line 49.
BEGIN failed--compilation aborted at ./oscar_wizard line 49.
Oscar Wizard failed to run successfully at ./install_cluster line 302.
On Wed, 28 Jun 2006, [EMAIL PROTECTED] wrote:
> Author: efocht
> Date: 2006-06-28 14:58:59 -0400 (Wed, 28 Jun 2006)
> New Revision: 5066
>
> Modified:
> trunk/lib/OSCAR/Configbox.pm
> trunk/lib/OSCAR/Configurator.pm
> trunk/lib/OSCAR/Database.pm
> trunk/packages/ganglia/scripts/edit_ganglia_conf
> trunk/packages/ganglia/scripts/post_rpm_nochroot
> trunk/packages/kernel_picker/scripts/post_clients
> trunk/packages/ntpconfig/scripts/post_server_install
> trunk/packages/oda/scripts/oscar_table.sql
> trunk/packages/sge/scripts/post_install
> trunk/packages/sge/scripts/post_rpm_nochroot
> trunk/packages/sge/scripts/post_server_install
> trunk/packages/switcher/scripts/user_settings.pm
> Log:
> Moved per opkg configuration variables to the OSCAR database.
> This means: .configurator.values files are not created any more!
> The values go to the Packages_config table in the OSCAR database.
>
> The Configbox.pm module was modified a bit to access the configurator
> variables from the ODA. Also some packages' API scripts needed changes. I
> tested this to work for ganglia and ntpconfig, I hope I cought all scripts
> which needed to be changed. If you find anything which still needs to be
> changed, please tell me.
>
> Configbox.pm takes care of the configurator values handling. Use
> use OSCAR::Configbox;
> my $values = readInConfigValues($cfile,$opkg,$context,[noarray=>1]);
>
> The noarray arg is optional.
> You'll get back a hash reference, as you were used to.
>
> If you want to interact directly with the database use the routines:
> set_pkgconfig_var
> get_pkgconfig_vars
> del_pkgconfig_vars
> pkgconfig_values
> from OSCAR::Database.pm (this is addressed to Wesley for CLI).
>
> Otherwise nothing changed.
>
>
> Modified: trunk/lib/OSCAR/Configbox.pm
> ===================================================================
> --- trunk/lib/OSCAR/Configbox.pm 2006-06-28 18:52:02 UTC (rev 5065)
> +++ trunk/lib/OSCAR/Configbox.pm 2006-06-28 18:58:59 UTC (rev 5066)
> @@ -1,3 +1,6 @@
> +package OSCAR::Configbox;
> +
> +##############################################################
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> # the Free Software Foundation; either version 2 of the License, or
> @@ -17,11 +20,12 @@
> #
> # Written by Terrence G. Fleury ([EMAIL PROTECTED])
> #
> +# Extensions for configurator data stored in OSCAR database were
> +# written by Erich Focht <[EMAIL PROTECTED]>
> +# Copyright (c) 2006 Erich Focht
> +#
> # $Id$
> ##############################################################
> -# MOVE THE STUFF BELOW TO THE TOP OF THE PERL SOURCE FILE! #
> -##############################################################
> -package OSCAR::Configbox;
>
> use strict;
> use base qw(Exporter);
> @@ -33,13 +37,14 @@
> use XML::Simple;
> no warnings qw(closure);
> use OSCAR::Tk;
> +use File::Basename;
> +use OSCAR::Database;
>
> my($top); # The Toplevel widget for the config box.
> my($web); # The Tk::Web widget for displaying HTML file.
> my($packagedir);
> +my ($my_opkg, $my_context);
> ##############################################################
> -# MOVE THE STUFF ABOVE TO THE TOP OF THE PERL SOURCE FILE! #
> -##############################################################
>
> # Sample SpecTcl main program for testing GUI
>
> @@ -243,24 +248,33 @@
>
> #########################################################################
> # Subroutine: readInConfigValues #
> -# Parameter : The name of the simple XML config file to read in. #
> -# Returns : A HASH containing all of the XML tags and their values. #
> -# This subroutine takes the name of a file and reads it as if it was #
> -# a simple configuration file suitable for XML::Simple. It returns #
> -# a reference to a HASH containing the key/value pairs. Note that #
> -# the values are actually ARRAYS, so you must either iterate through #
> -# each hash entry, or assume that there is but a single element in the #
> -# array and thus access the 0th element. #
> +# Parameter : 1. the configurator.html file location #
> +# 2. the OSCAR package name #
> +# 3. context (see Packages_config table in ODA) #
> +# 4. selection arguments e.g. noarray => 1 #
> +# Returns : A HASH reference with all related variable names (as #
> +# keys) and their values (as anonymous array references) #
> #########################################################################
> sub readInConfigValues # ($filename) -> $values
> {
> - my($filename) = @_;
> + my ($conffile, $opkg, $context, %sel) = @_;
>
> - my($values) = eval
> - { XMLin($filename, suppressempty => '', forcearray => '1'); };
> - undef $values if ($@);
> + my @res = &get_pkgconfig_vars(opkg => "$opkg", context => "$context");
> + if ([EMAIL PROTECTED]) {
> + &defaultConfigToDB($conffile, $opkg, $context);
> + @res = &get_pkgconfig_vars(opkg => "$opkg", context => "$context");
> + }
>
> - return $values;
> + my %values = &pkgconfig_values(@res);
> +
> + if (exists($sel{noarray})) {
> + for my $k (keys(%values)) {
> + if (scalar(@$values{$k}) <= 1) {
> + $values{$k} = $values{$k}[0];
> + }
> + }
> + }
> + return \%values;
> }
>
> #########################################################################
> @@ -375,7 +389,92 @@
> }
> }
>
> +
> +
> #########################################################################
> +# Subroutine: extractDefaultConfig #
> +# Parameters: 1. The HTML tree generated by readInDefaultConfig. #
> +# Returns : Values hash #
> +# Tries to read in all input fields and sets the values hash #
> +# accordingly. Used for filling the database with default #
> +# config values. #
> +#########################################################################
> +sub extractDefaultConfig # ($tree)
> +{
> + my($tree) = @_;
> +
> + my %values;
> +
> + # Scan through all "input" tags which are "checked" and
> + # set their values accordingly
> + for my $d ($tree->look_down(
> + sub {
> + return 1 if (($_[0]->tag eq 'input') &&
> + ($_[0]->attr('checked')));
> + return 0;
> + }
> + )) {
> + my $name = $d->attr('name');
> + $values{"$name"} = [ 1 ];
> + }
> +
> + # Scan through all "input" tags which are neither checkboxes
> + # nor radiobuttons
> + for my $d ($tree->look_down(
> + sub {
> + return 1 if (($_[0]->tag eq 'input') &&
> + ($_[0]->attr('type') ne 'checkbox') &&
> + ($_[0]->attr('type') ne 'radio'));
> + return 0;
> + }
> + )) {
> + my $name = $d->attr('name');
> + next if exists($values{"$name"});
> + next if !$name;
> + my $val = $d->attr('value');
> + $values{"$name"} = [ "$val" ];
> + }
> +
> + # Search for "select" tags and collect their subtree names
> + # with "option" tags 'selected'.
> + for my $d ($tree->look_down(
> + sub {
> + return 1 if ($_[0]->tag() eq 'select');
> + return 0;
> + } )) {
> + my $name = $d->attr('name');
> + # SELECT tag has OPTION tags as its children.
> + my @kids = $d->content_list();
> + for my $kid (@kids) {
> + next if (!ref $kid); # Ignore any text elements
> + if (($kid->tag() eq 'option') && $kid->attr('selected')) {
> + my $val = $kid->attr('value');
> + if (!exists($values{"$name"})) {
> + $values{"$name"} = [ "$val" ];
> + } else {
> + push @{$values{"$name"}}, "$val";
> + }
> + }
> + }
> + }
> +
> + # extract textareas content
> + for my $d ($tree->look_down(
> + sub {
> + return 1 if (($_[0]->tag eq 'textarea') &&
> + ($_[0]->attr('name')));
> + return 0;
> + }
> + )) {
> + my $name = $d->attr('name');
> + my $text = $d->as_text();
> + $values{"$name"} = [ "$text" ];
> + }
> +
> + return %values;
> +}
> +
> +#########################################################################
> # Subroutine: writeOutTempConfig #
> # Parameter : An HTML::Tree tree to output to file #
> # Returns : Nothing #
> @@ -446,13 +545,11 @@
> }
> }
>
> - # We created the %result hash, now write it out to a Simple XML file.
> - XMLout(\%result,
> - outputfile => "$packagedir/.configurator.values",
> - noescape => 1,
> - rootname => 'config',
> - noattr=> 1,
> - ) if (scalar(keys %result) > 0);
> + # now write config variables to the database
> + for my $name (keys(%result)) {
> + &set_pkgconfig_var(opkg => "$my_opkg", context => "$my_context",
> + name => "$name", value => $result{$name});
> + }
> }
>
> #########################################################################
> @@ -567,6 +664,8 @@
> # Subroutine: configurePackage #
> # Parameters: 1. The parent of the Config Box (eg. $top or $root). #
> # 2. The full path for an OSCAR package's directory. #
> +# 3. The opkg name. #
> +# 4. The "context" for these variables #
> # Returns : Nothing #
> # This subroutine takes the full path name of a subdirectory under the #
> # OSCAR "packages" directory and attempts to render the configuration #
> @@ -576,22 +675,46 @@
> {
> my $parent = shift;
> $packagedir = shift;
> + my $opkg = shift;
> + my $context = shift;
>
> + $my_opkg = $opkg;
> + $my_context = $context;
> +
> # Check for the configuration HTML file
> return if ((-s "$packagedir/.selection.ignore") ||
> (!(-s "$packagedir/configurator.html")));
>
> - my($tree) = readInDefaultConfig("$packagedir/configurator.html");
> + my $tree = readInDefaultConfig("$packagedir/configurator.html");
> return if (!$tree);
> - my($values) = readInConfigValues("$packagedir/.configurator.values");
> - preprocessConfig($tree,$values) if $values;
> - writeOutTempConfig($tree);
> +
> + my $values = &readInConfigValues("$packagedir/configurator.html",
> + $opkg, $context);
> + &preprocessConfig($tree,$values) if $values;
> + &writeOutTempConfig($tree);
> $tree->delete; # Always delete the tree when you are done with it.
>
> displayWebPage($parent,"$packagedir/.configurator.temp.html");
> }
>
> +#
> +# Read default config from configurator.html file and store results in
> +# the OSCAR database.
> +#
> +sub defaultConfigToDB
> +{
> + my ($conffile, $opkg, $context) = @_;
> + return if (-s "$conffile");
>
> + my($tree) = readInDefaultConfig("$conffile");
> + return if (!$tree);
> + my %values = &extractDefaultConfig($tree);
> + for my $name (keys(%values)) {
> + &set_pkgconfig_var(opkg => "$opkg", context => "$context",
> + name => "$name", value => $values{$name});
> + }
> +}
> +
> #configurePackage($top,'/home/tfleury/develop/oscar/packages/kernel_picker');
>
>
>
> Modified: trunk/lib/OSCAR/Configurator.pm
> ===================================================================
> --- trunk/lib/OSCAR/Configurator.pm 2006-06-28 18:52:02 UTC (rev 5065)
> +++ trunk/lib/OSCAR/Configurator.pm 2006-06-28 18:58:59 UTC (rev 5066)
> @@ -271,6 +271,7 @@
> -command => [ \&OSCAR::Configbox::configurePackage,
> $root,
> $packagedir,
> + $package,
> ],
> -padx => 4,
> );
>
> Modified: trunk/lib/OSCAR/Database.pm
> ===================================================================
> --- trunk/lib/OSCAR/Database.pm 2006-06-28 18:52:02 UTC (rev 5065)
> +++ trunk/lib/OSCAR/Database.pm 2006-06-28 18:58:59 UTC (rev 5066)
> @@ -94,6 +94,7 @@
> delete_node
> delete_group_packages
> delete_groups
> + del_pkgconfig_vars
> do_select
> get_client_nodes
> get_client_nodes_info
> @@ -119,6 +120,7 @@
> get_packages_switcher
> get_packages_servicelists
> get_packages_with_class
> + get_pkgconfig_vars
> get_selected_group
> get_selected_group_packages
> get_unselected_group_packages
> @@ -128,6 +130,7 @@
> link_node_nic_to_network
> list_selected_packages
> pkgs_of_opkg
> + pkgconfig_values
> set_all_groups
> set_group_packages
> set_group_nodes
> @@ -138,6 +141,7 @@
> set_install_mode
> set_nics_with_node
> set_node_with_group
> + set_pkgconfig_var
> set_status
> update_node
> update_node_package_status
> @@ -2599,7 +2603,127 @@
> return do_update($sql, "Clusters", $options_ref, $error_strings_ref);
> }
>
> +# set package configuration name/value pair
> +# Usage example:
> +# set_pkgconfig_var(opkg => "ganglia" , context => "",
> +# name => "gmond_if", value => [ "eth0" ]);
> +#
> +# "value" needs to point to an anonymous array reference!
> +# The arguments "name" and "context" are optional.
> +sub set_pkgconfig_var {
> + my (%val) = @_;
> + if (!exists($val{opkg}) || !exists($val{name}) || !exists($val{value})) {
> + croak("missing one of opkg/name/value : ".Dumper(%val));
> + }
> + if (!exists($val{context}) || $val{context} eq "") {
> + $val{context} = "global";
> + }
> + my (%options, @errors);
> + my %sel = %val;
> + delete $sel{value};
> + my $sql;
> + # delete all existing records
> + &del_pkgconfig_vars(%sel);
>
> + # get opkg_id first
> + my $opkg = $val{opkg};
> + delete $val{opkg};
> +
> + my $pref = get_package_info_with_name($opkg,\%options,[EMAIL PROTECTED]);
> + croak("No package $opkg found!") if (!$pref);
> + my $opkg_id = $pref->{id};
> + $val{package_id} = $opkg_id;
> + my @values = @{$val{value}};
> + delete $val{value};
> +
> + for my $v (@values) {
> + $val{value} = $v;
> + $sql = "INSERT INTO Packages_config (".join(", ",(keys(%val))).") " .
> + "VALUES ('" . join("', '",values(%val)) . "')";;
> + croak("$0:Failed to insert values via << $sql >>")
> + if !do_insert($sql, "Packages_config", \%options, [EMAIL
> PROTECTED]);
> + }
> + return 1;
> +}
> +
> +# get package configuration values
> +# Usage example:
> +# get_pkgconfig_vars(opkg => "ganglia", context => "",
> +# name => "gmond_if");
> +# The arguments "name" and "context" are optional.
> +#
> +sub get_pkgconfig_vars {
> + my (%sel) = @_;
> + croak("opkg not specified!") if (!exists($sel{opkg}));
> + if (!exists($sel{context}) || $sel{context} eq "") {
> + $sel{context} = "global";
> + }
> + my (%options, @errors);
> + my $opkg = $sel{opkg};
> + delete $sel{opkg};
> + my $sql = "SELECT Packages.package AS opkg, " .
> + "Packages_config.config_id AS config_id, " .
> + "Packages_config.package_id AS package_id, " .
> + "Packages_config.name AS name, " .
> + "Packages_config.value AS value, " .
> + "Packages_config.context AS context ".
> + "FROM Packages_config, Packages " .
> + "WHERE Packages_config.package_id=Packages.id AND ".
> + "Packages.package='$opkg' AND ";
> + my @where = map { "Packages_config.$_='".$sel{$_}."'" } keys(%sel);
> + $sql .= join(" AND ", @where);
> + my @result;
> + die "$0:Failed to query values via << $sql >>"
> + if (!do_select($sql,[EMAIL PROTECTED], \%options, [EMAIL
> PROTECTED]));
> +
> + return @result;
> +}
> +
> +# convert pkgconfig vars query result into a values hash tree
> +# good to be used with the configurator routines
> +sub pkgconfig_values {
> + my (@result) = @_;
> + my %values;
> + for my $r (@result) {
> + my $name = $r->{name};
> + my $val = $r->{value};
> + if (!exists($values{$name})) {
> + $values{"$name"} = [ "$val" ];
> + } else {
> + push @{$values{"$name"}}, "$val";
> + }
> + }
> + return %values;
> +}
> +
> +# delete package configuration values
> +# Usage example:
> +# del_pkgconfig_vars(opkg => "ganglia", context => "",
> +# name => "gmond_if");
> +# At least the "opkg" selection must be specified!
> +# The arguments "name" and "context" are optional.
> +sub del_pkgconfig_vars {
> + my (%sel) = @_;
> + croak("opkg not specified!") if (!exists($sel{opkg}));
> + if (!exists($sel{context}) || $sel{context} eq "") {
> + $sel{context} = "global";
> + }
> + my (%options, @errors);
> +
> + my @exists = &get_pkgconfig_vars(%sel);
> + return 1 if (!scalar(@exists));
> +
> + for my $e (@exists) {
> + my $id = $e->{config_id};
> +
> + my $sql = "DELETE FROM Packages_config WHERE config_id='$id'";
> + my @result;
> + die "$0:Failed to delete values via << $sql >>"
> + if (!do_update($sql,[EMAIL PROTECTED], \%options, [EMAIL
> PROTECTED]));
> + }
> + return 1;
> +}
> +
> sub set_node_with_group {
> my ($node,
> $group,
>
> Modified: trunk/packages/ganglia/scripts/edit_ganglia_conf
> ===================================================================
> --- trunk/packages/ganglia/scripts/edit_ganglia_conf 2006-06-28 18:52:02 UTC
> (rev 5065)
> +++ trunk/packages/ganglia/scripts/edit_ganglia_conf 2006-06-28 18:58:59 UTC
> (rev 5066)
> @@ -22,7 +22,6 @@
> # Copyright 2005 Erich Focht <[EMAIL PROTECTED]>
> #
>
> -use XML::Simple;
> use Carp;
> use strict;
> use Getopt::Long;
> @@ -32,6 +31,7 @@
> use SIS::Image;
> use SIS::Client;
> use Data::Dumper;
> +use OSCAR::Configbox;
> use OSCAR::Database;
> use OSCAR::Opkg;
>
> @@ -52,8 +52,8 @@
> $gmond_conf = "gmond.conf";
> $ENV{OSCAR_PACKAGE_HOME} = ".";
> }
> -my $xml_data = "$ENV{OSCAR_PACKAGE_HOME}/.configurator.values";
> -my $xml_imgd = "$ENV{OSCAR_PACKAGE_HOME}/.configs";
> +my $masterconf = "$ENV{OSCAR_PACKAGE_HOME}/configurator.html";
> +my $imgconfd = "$ENV{OSCAR_PACKAGE_HOME}/.configs";
>
> my $hostname = `hostname`;
> chomp($hostname);
> @@ -101,8 +101,8 @@
>
>
> my $master_conf;
> -if (-e $xml_data) {
> - $master_conf = XMLin($xml_data);
> +if (-e $masterconf) {
> + $master_conf = readInConfigValues($masterconf, "ganglia", "",
> noarray=>1);
> } else {
> $master_conf = \%default;
> }
> @@ -114,13 +114,13 @@
> #
> # per image configuration
> #
> - my $xml_img = "$xml_imgd/$image/.configurator.values";
> + my $imgconf = "$imgconfd/$image/configurator.html";
> #
> # read in per image configurator data, if it exists
> #
> - if (-e $xml_img) {
> - vprint("using per image values file $xml_img\n");
> - my $img_conf = XMLin($xml_img);
> + if (-e $imgconf) {
> + vprint("using per image config $imgconf\n");
> + my $img_conf = readInConfigValues($imgconf, "ganglia",
> "image:$image", noarray=>1);
> vprint(Dumper(%{$img_conf}));
> add_missing_keys($master_conf, $img_conf);
> &edit_gmond_conf($gmond_img, $img_conf);
> @@ -261,7 +261,7 @@
> my $master_port = $config{udp_recv_channel__port};
> my $master_iface = $config{udp_recv_channel__mcast_if};
> # images configured
> - my @imgs = glob("$xml_imgd/*");
> + my @imgs = glob("$imgconfd/*");
> vprint("img_datasources: images: ".join(" ",@imgs)."\n");
> foreach (@imgs) {
> s/.*\///g; # basename
> @@ -270,9 +270,9 @@
> vprint("finding gmetad config for image $img\n");
> # get cluster name and port from per image config
> # if same port as master, skip
> - my $xml_img = "$xml_imgd/$img/.configurator.values";
> - if (-e $xml_img) {
> - %imgcfg = %{XMLin($xml_img)};
> + my $imgconf = "$imgconfd/$img/configurator.html";
> + if (-e $imgconf) {
> + %imgcfg =
> %{readInConfigValues($imgconf,"ganglia","image:$img",noarray=>1)};
> } else {
> opkg_print "configurator values for image $img not found!\n";
> next;
>
> Modified: trunk/packages/ganglia/scripts/post_rpm_nochroot
> ===================================================================
> --- trunk/packages/ganglia/scripts/post_rpm_nochroot 2006-06-28 18:52:02 UTC
> (rev 5065)
> +++ trunk/packages/ganglia/scripts/post_rpm_nochroot 2006-06-28 18:58:59 UTC
> (rev 5066)
> @@ -33,6 +33,7 @@
> use XML::Simple;
> use Tk;
> use OSCAR::Configbox;
> +use OSCAR::Database;
> use lib '/usr/lib/systeminstaller';
> use SIS::DB;
> use SIS::Image;
> @@ -51,12 +52,11 @@
> #####################
>
> my $imageconf = $configdir."/".$image;
> -my $valuesfile = $imageconf."/.configurator.values";
> -my $mastervals = $ENV{OSCAR_PACKAGE_HOME}."/.configurator.values";
> +my $masterconf = $ENV{OSCAR_PACKAGE_HOME}."/configurator.html";
>
> my $master_conf;
> -if (-e $mastervals) {
> - $master_conf = XMLin($mastervals);
> +if (-e $masterconf) {
> + $master_conf = readInConfigValues($masterconf,"ganglia","",noarray=>1);
> # exit if no per-image config
> exit 0 if ($master_conf->{gmond_per_image} ne "YES");
> } else {
> @@ -77,7 +77,7 @@
> exit 1;
> }
>
> -print "configuring gmond for image=$image valuesfile=$valuesfile\n";
> +print "configuring gmond for image=$image\n";
>
> if (! -d $imageconf) {
> !system("mkdir ".$imageconf) || do {
> @@ -94,8 +94,10 @@
> print "Found $imageconf\n";
> }
>
> -if (!-f $valuesfile) {
> - OSCAR::Configbox::configurePackage(0, $imageconf);
> +# configure this only if no config values found in database
> +my @res = get_pkgconfig_vars(opkg => "ganglia", context => "image:$image");
> +if ([EMAIL PROTECTED]) {
> + OSCAR::Configbox::configurePackage(0,
> $imageconf,"ganglia","image:$image");
> MainLoop();
> }
>
>
> Modified: trunk/packages/kernel_picker/scripts/post_clients
> ===================================================================
> --- trunk/packages/kernel_picker/scripts/post_clients 2006-06-28 18:52:02 UTC
> (rev 5065)
> +++ trunk/packages/kernel_picker/scripts/post_clients 2006-06-28 18:58:59 UTC
> (rev 5066)
> @@ -20,11 +20,10 @@
> use lib "$ENV{OSCAR_HOME}/lib";
> use Carp;
> use POSIX;
> -use XML::Simple;
> use OSCAR::Configbox;
>
> my $VERSION = '$Id';
> -my($valuesfile) = "$ENV{OSCAR_PACKAGE_HOME}/.configurator.values";
> +my $valuesfile = "$ENV{OSCAR_PACKAGE_HOME}/configurator.html";
>
> #####################
> # BEGIN MAIN SCRIPT #
> @@ -32,7 +31,7 @@
>
> if (-e $valuesfile)
> {
> - my($values) = OSCAR::Configbox::readInConfigValues($valuesfile);
> + my $values = readInConfigValues($valuesfile,"kernel_picker","");
>
> # First, get any optional values
> my $bootkernel = "";
>
> Modified: trunk/packages/ntpconfig/scripts/post_server_install
> ===================================================================
> --- trunk/packages/ntpconfig/scripts/post_server_install 2006-06-28
> 18:52:02 UTC (rev 5065)
> +++ trunk/packages/ntpconfig/scripts/post_server_install 2006-06-28
> 18:58:59 UTC (rev 5066)
> @@ -23,13 +23,13 @@
> use lib "$ENV{OSCAR_HOME}/lib";
> use OSCAR::Network;
> use OSCAR::Database;
> -use XML::Simple;
> +use OSCAR::Configbox;
> use Carp;
>
> my $ntpBuffer = "";
> my $ntp_conf = "/etc/ntp.conf";
> my $step_tickers = "/etc/ntp/step-tickers";
> -my $xml_data = "$ENV{OSCAR_PACKAGE_HOME}/.configurator.values";
> +my $configurator = "$ENV{OSCAR_PACKAGE_HOME}/configurator.html";
> my $ntpd = "ntpd";
>
> # SUSE Linux's ntpd initscript name is "ntp"
> @@ -53,8 +53,8 @@
> $network = join(".", @results);
>
> # User has configured ntpconfig package with a NTP server
> -if (-e $xml_data) {
> - $ref = XMLin($xml_data);
> +if (-e $configurator) {
> + $ref = readInConfigValues($configurator,"ntpconfig","",noarray=>1);
> # If ntpconfig package has configured NTP server before, replace
> if ($ntpBuffer =~ /User selected NTP Server/) {
> $ntpBuffer =~ s/^server.*\nrestrict.*\n/server
> $ref->{ntpserver}\nrestrict $ref->{ntpserver} mask 255.255.255.255\n/m;
>
> Modified: trunk/packages/oda/scripts/oscar_table.sql
> ===================================================================
> --- trunk/packages/oda/scripts/oscar_table.sql 2006-06-28 18:52:02 UTC
> (rev 5065)
> +++ trunk/packages/oda/scripts/oscar_table.sql 2006-06-28 18:58:59 UTC
> (rev 5066)
> @@ -219,6 +219,18 @@
> CONSTRAINT Packages_provides_ibfk_1 FOREIGN KEY (p1_id) REFERENCES
> Packages (id) ON DELETE CASCADE
> )TYPE=INNODB;
>
> +-- Packages_provides
> +CREATE TABLE IF NOT EXISTS Packages_config(
> + config_id integer auto_increment not null unique,
> + package_id integer not null,
> + name VARCHAR(100) not null,
> + value VARCHAR(256),
> + context VARCHAR(100),
> + PRIMARY KEY (config_id, package_id),
> + KEY package_id ( package_id ),
> + CONSTRAINT Packages_config_ibfk_1 FOREIGN KEY (package_id) REFERENCES
> Packages (id) ON DELETE CASCADE
> +)TYPE=INNODB;
> +
> -- Node_Package_Status
> CREATE TABLE IF NOT EXISTS Node_Package_Status(
> current integer,
>
> Modified: trunk/packages/sge/scripts/post_install
> ===================================================================
> --- trunk/packages/sge/scripts/post_install 2006-06-28 18:52:02 UTC (rev
> 5065)
> +++ trunk/packages/sge/scripts/post_install 2006-06-28 18:58:59 UTC (rev
> 5066)
> @@ -23,9 +23,9 @@
>
> use strict;
> use Carp;
> -use XML::Simple;
>
> use lib "/usr/lib/systeminstaller","$ENV{OSCAR_HOME}/lib";
> +use OSCAR::Configbox;
> use OSCAR::Database;
> use OSCAR::Opkg;
> use SystemInstaller::Machine;
> @@ -109,11 +109,11 @@
>
> if (%nodes) {
> # Obtain any custom configure values from the user
> - my $xml_data = "$ENV{OSCAR_PACKAGE_HOME}/.configurator.values";
> + my $xml_data = "$ENV{OSCAR_PACKAGE_HOME}/configurator.html";
>
> # If user has configured the package, use the custom values, otherwise
> use the default
> if (-e $xml_data) {
> - my $ref = XMLin($xml_data);
> + my $ref = readInConfigValues($xml_data,"sge","",noarray=>1);
> $cell = $ref->{cellname};
> }
>
>
> Modified: trunk/packages/sge/scripts/post_rpm_nochroot
> ===================================================================
> --- trunk/packages/sge/scripts/post_rpm_nochroot 2006-06-28 18:52:02 UTC
> (rev 5065)
> +++ trunk/packages/sge/scripts/post_rpm_nochroot 2006-06-28 18:58:59 UTC
> (rev 5066)
> @@ -20,7 +20,8 @@
>
> use strict;
> use Carp;
> -use XML::Simple;
> +use lib "$ENV{OSCAR_HOME}/lib";
> +use OSCAR::Configbox;
>
> my $imagedir = shift;
>
> @@ -30,11 +31,11 @@
> my $cell = "default";
>
> # Obtain any custom configure values from the user
> -my $xml_data = "$ENV{OSCAR_PACKAGE_HOME}/.configurator.values";
> +my $xml_data = "$ENV{OSCAR_PACKAGE_HOME}/configurator.html";
>
> # If user has configured the package, use the custom values, otherwise use
> the default
> if (-e $xml_data) {
> - my $ref = XMLin($xml_data);
> + my $ref = readInConfigValues($xml_data,"sge","",noarray=>1);
> $cell = $ref->{cellname};
> }
>
>
> Modified: trunk/packages/sge/scripts/post_server_install
> ===================================================================
> --- trunk/packages/sge/scripts/post_server_install 2006-06-28 18:52:02 UTC
> (rev 5065)
> +++ trunk/packages/sge/scripts/post_server_install 2006-06-28 18:58:59 UTC
> (rev 5066)
> @@ -23,9 +23,9 @@
>
> use Carp;
> use File::Copy;
> -use XML::Simple;
>
> use lib "$ENV{OSCAR_HOME}/lib";
> +use OSCAR::Configbox;
> use OSCAR::Database;
> use OSCAR::Opkg;
>
> @@ -46,7 +46,7 @@
> my $admin_user = "sge";
>
> # Obtain any custom configure values from the user
> -my $xml_data = "$ENV{OSCAR_PACKAGE_HOME}/.configurator.values";
> +my $xml_data = "$ENV{OSCAR_PACKAGE_HOME}/configurator.html";
>
> my $qmasterBuffer = "";
>
> @@ -57,7 +57,7 @@
>
> # If user has configured the package, use the custom values, otherwise use
> the default
> if (-e $xml_data) {
> - my $ref = XMLin($xml_data);
> + my $ref = readInConfigValues($xml_data,"sge","",noarray=>1);
> $fullserver = $ref->{fullserver};
> $cellname = $ref->{cellname};
> $gidrange = $ref->{gidrange};
>
> Modified: trunk/packages/switcher/scripts/user_settings.pm
> ===================================================================
> --- trunk/packages/switcher/scripts/user_settings.pm 2006-06-28 18:52:02 UTC
> (rev 5065)
> +++ trunk/packages/switcher/scripts/user_settings.pm 2006-06-28 18:58:59 UTC
> (rev 5066)
> @@ -36,11 +36,10 @@
>
> # Read in the data from the results of the configurator step
>
> - my $infile = "$ENV{OSCAR_PACKAGE_HOME}/.configurator.values";
> - my $xs = new XML::Simple(keyattr => {});
> + my $infile = "$ENV{OSCAR_PACKAGE_HOME}/configurator.html";
> my $results;
> if (-e $infile) {
> - $results = $xs->XMLin($infile);
> + $results = readInConfigValues($infile,"switcher","",noarray=>1);
> }
>
> # Read in all the <switcher> blocks from the package
>
>
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Oscar-checkins mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/oscar-checkins
>
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Oscar-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oscar-devel