Author: jkeenan
Date: Sun Mar 25 09:41:10 2007
New Revision: 17735
Modified:
branches/reconfigure/lib/Parrot/Configure.pm
branches/reconfigure/lib/Parrot/Configure/Step.pm
Log:
Applying to recon branch patch submitted for trunk (not yet applied) in RT
41201: remove 'temporary hack' from Configure.pl by making Parrot::Configure
object into a singleton.
Modified: branches/reconfigure/lib/Parrot/Configure.pm
==============================================================================
--- branches/reconfigure/lib/Parrot/Configure.pm (original)
+++ branches/reconfigure/lib/Parrot/Configure.pm Sun Mar 25 09:41:10 2007
@@ -67,18 +67,33 @@
=cut
-sub new {
- my $class = shift;
-
- my $self = {
+#sub new {
+# my $class = shift;
+#
+# my $self = {
+# steps => [],
+# data => Parrot::Configure::Data->new,
+# options => Parrot::Configure::Data->new,
+# };
+#
+# bless $self, ref $class || $class;
+#
+# return $self;
+#}
+
+my $singleton;
+BEGIN {
+ $singleton = {
steps => [],
data => Parrot::Configure::Data->new,
options => Parrot::Configure::Data->new,
};
+ bless $singleton, "Parrot::Configure";
+}
- bless $self, ref $class || $class;
-
- return $self;
+sub new {
+ my $class = shift;
+ return $singleton;
}
=back
Modified: branches/reconfigure/lib/Parrot/Configure/Step.pm
==============================================================================
--- branches/reconfigure/lib/Parrot/Configure/Step.pm (original)
+++ branches/reconfigure/lib/Parrot/Configure/Step.pm Sun Mar 25 09:41:10 2007
@@ -33,9 +33,13 @@
use File::Copy ();
use File::Spec;
use File::Which;
+use lib ("lib");
+use Parrot::Configure;
-# XXX $conf is a temporary hack
-our $conf;
+## XXX $conf is a temporary hack
+#our $conf;
+
+my $conf = Parrot::Configure->new();
our @EXPORT = ();
our @EXPORT_OK = qw(prompt genfile copy_if_diff move_if_diff integrate