Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 21549 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-6 / +9 lines)
Lines 19-24 Link Here
19
# Set the location of Perl.
19
# Set the location of Perl.
20
PERL = /usr/bin/perl
20
PERL = /usr/bin/perl
21
21
22
# Blank by default, but set to QUIET to ask essential questions only
23
INSTALL_VERBOSITY?= STANDARD
24
22
# can't load Bric since it loads Bric::Config which has dependencies
25
# can't load Bric since it loads Bric::Config which has dependencies
23
# that won't be solved till make install.
26
# that won't be solved till make install.
24
BRIC_VERSION = `$(PERL) -ne '/VERSION.*?([\d\.]+)/ and print $$1 and exit' < lib/Bric.pm`
27
BRIC_VERSION = `$(PERL) -ne '/VERSION.*?([\d\.]+)/ and print $$1 and exit' < lib/Bric.pm`
Lines 31-54 Link Here
31
                  bconf/bricolage.conf build_done
34
                  bconf/bricolage.conf build_done
32
35
33
required.db	: inst/required.pl
36
required.db	: inst/required.pl
34
	$(PERL) inst/required.pl
37
	$(PERL) inst/required.pl $(INSTALL_VERBOSITY)
35
38
36
modules.db 	: inst/modules.pl lib/Bric/Admin.pod
39
modules.db 	: inst/modules.pl lib/Bric/Admin.pod
37
	$(PERL) inst/modules.pl
40
	$(PERL) inst/modules.pl $(INSTALL_VERBOSITY)
38
41
39
apache.db	: inst/apache.pl required.db
42
apache.db	: inst/apache.pl required.db
40
	$(PERL) inst/apache.pl
43
	$(PERL) inst/apache.pl $(INSTALL_VERBOSITY)
41
44
42
# This shoudl be updated to something more database-independent. In fact,
45
# This should be updated to something more database-independent. In fact,
43
# what should happen is that a script should present a list of supported
46
# what should happen is that a script should present a list of supported
44
# databases, the user picks which one (each with a key name for the DBD
47
# databases, the user picks which one (each with a key name for the DBD
45
# driver, e.g., "Pg", "mysql", "Oracle", etc.), and then the rest of the
48
# driver, e.g., "Pg", "mysql", "Oracle", etc.), and then the rest of the
46
# work should just assume that database and do the work for that database.
49
# work should just assume that database and do the work for that database.
47
postgres.db 	: inst/postgres.pl required.db
50
postgres.db 	: inst/postgres.pl required.db
48
	$(PERL) inst/postgres.pl
51
	$(PERL) inst/postgres.pl $(INSTALL_VERBOSITY)
49
52
50
config.db	: inst/config.pl required.db apache.db postgres.db
53
config.db	: inst/config.pl required.db apache.db postgres.db
51
	$(PERL) inst/config.pl
54
	$(PERL) inst/config.pl $(INSTALL_VERBOSITY)
52
55
53
bconf/bricolage.conf	:  required.db inst/conf.pl
56
bconf/bricolage.conf	:  required.db inst/conf.pl
54
	$(PERL) inst/conf.pl INSTALL $(BRIC_VERSION)
57
	$(PERL) inst/conf.pl INSTALL $(BRIC_VERSION)
(-)inst/config.pl (-10 / +15 lines)
Lines 36-41 Link Here
36
use Config;
36
use Config;
37
use Cwd;
37
use Cwd;
38
38
39
# check whether questions should be asked
40
our $QUIET;
41
$QUIET = 1 if $ARGV[0] and $ARGV[0] eq 'QUIET';
42
39
print "\n\n==> Gathering User Configuration <==\n\n";
43
print "\n\n==> Gathering User Configuration <==\n\n";
40
our %CONFIG;
44
our %CONFIG;
41
45
Lines 71-78 Link Here
71
75
72
END
76
END
73
77
74
    $CONFIG{set} = ask_choice("Your choice?", 
78
    $CONFIG{set} = "s";
75
                              [ "s", "m" ], "s");
79
    $CONFIG{set} = ask_choice("Your choice?", [ "s", "m" ], "s", $QUIET);
76
80
77
    # setup the default
81
    # setup the default
78
    if ($CONFIG{set} eq 's') {
82
    if ($CONFIG{set} eq 's') {
Lines 123-129 Link Here
123
127
124
sub confirm_settings {
128
sub confirm_settings {
125
  my $default_root = $CONFIG{BRICOLAGE_ROOT};
129
  my $default_root = $CONFIG{BRICOLAGE_ROOT};
126
  ask_confirm("\nBricolage Root Directory", \$CONFIG{BRICOLAGE_ROOT});
130
  ask_confirm("\nBricolage Root Directory", \$CONFIG{BRICOLAGE_ROOT}, $QUIET);
127
131
128
  # make sure this directory isn't the same at the source directory
132
  # make sure this directory isn't the same at the source directory
129
  if (canonpath($CONFIG{BRICOLAGE_ROOT}) eq canonpath(cwd())) {
133
  if (canonpath($CONFIG{BRICOLAGE_ROOT}) eq canonpath(cwd())) {
Lines 150-163 Link Here
150
    $CONFIG{$_} = eval qq{"$CONFIG{$_}"};
154
    $CONFIG{$_} = eval qq{"$CONFIG{$_}"};
151
  }
155
  }
152
156
153
  ask_confirm("Temporary Directory",       \$CONFIG{TEMP_DIR});
157
  ask_confirm("Temporary Directory",       \$CONFIG{TEMP_DIR}, $QUIET);
154
  ask_confirm("Perl Module Directory",     \$CONFIG{MODULE_DIR});
158
  ask_confirm("Perl Module Directory",     \$CONFIG{MODULE_DIR}, $QUIET);
155
  ask_confirm("Executable Directory",      \$CONFIG{BIN_DIR});
159
  ask_confirm("Executable Directory",      \$CONFIG{BIN_DIR}, $QUIET);
156
  ask_confirm("Man-Page Directory (! to skip)", \$CONFIG{MAN_DIR});
160
  ask_confirm("Man-Page Directory (! to skip)", \$CONFIG{MAN_DIR}, $QUIET);
157
  ask_confirm("Log Directory",             \$CONFIG{LOG_DIR});
161
  ask_confirm("Log Directory",             \$CONFIG{LOG_DIR}, $QUIET);
158
  ask_confirm("PID File Location",         \$CONFIG{PID_FILE});
162
  ask_confirm("PID File Location",         \$CONFIG{PID_FILE});
163
  ask_confirm("Mason Component Directory", \$CONFIG{MASON_COMP_ROOT}, $QUIET);
164
  ask_confirm("Mason Data Directory",      \$CONFIG{MASON_DATA_ROOT}, $QUIET);
165
159
  $CONFIG{PID_FILE} = catfile($CONFIG{PID_FILE}, 'httpd.pid')
166
  $CONFIG{PID_FILE} = catfile($CONFIG{PID_FILE}, 'httpd.pid')
160
    if -d $CONFIG{PID_FILE};
167
    if -d $CONFIG{PID_FILE};
161
  ask_confirm("Mason Component Directory", \$CONFIG{MASON_COMP_ROOT});
162
  ask_confirm("Mason Data Directory",      \$CONFIG{MASON_DATA_ROOT});
163
}
168
}
(-)inst/postgres.pl (-2 / +6 lines)
Lines 36-41 Link Here
36
use File::Spec::Functions;
36
use File::Spec::Functions;
37
use Data::Dumper;
37
use Data::Dumper;
38
38
39
# check whether questions should be asked
40
our $QUIET;
41
$QUIET = 1 if $ARGV[0] and $ARGV[0] eq 'QUIET';
42
39
print "\n\n==> Probing PostgreSQL Configuration <==\n\n";
43
print "\n\n==> Probing PostgreSQL Configuration <==\n\n";
40
44
41
our %PG;
45
our %PG;
Lines 122-134 Link Here
122
# ask the user for user settings
126
# ask the user for user settings
123
sub get_users {
127
sub get_users {
124
    print "\n";
128
    print "\n";
125
    ask_confirm("Postgres Root Username", \$PG{root_user});
129
    ask_confirm("Postgres Root Username", \$PG{root_user}, $QUIET);
126
    ask_confirm("Postgres Root Password (leave empty for no password)",
130
    ask_confirm("Postgres Root Password (leave empty for no password)",
127
		\$PG{root_pass});
131
		\$PG{root_pass});
128
132
129
    while(1) {
133
    while(1) {
130
	$PG{system_user} = $PG{root_user};
134
	$PG{system_user} = $PG{root_user};
131
	ask_confirm("Postgres System Username", \$PG{system_user});
135
        ask_confirm("Postgres System Username", \$PG{system_user}, $QUIET);
132
	$PG{system_user_uid} = (getpwnam($PG{system_user}))[2];
136
	$PG{system_user_uid} = (getpwnam($PG{system_user}))[2];
133
	last if defined $PG{system_user_uid};
137
	last if defined $PG{system_user_uid};
134
	print "User \"$PG{system_user}\" not found!  This user must exist ".
138
	print "User \"$PG{system_user}\" not found!  This user must exist ".
(-)inst/modules.pl (-3 / +7 lines)
Lines 36-41 Link Here
36
use File::Spec::Functions;
36
use File::Spec::Functions;
37
use Data::Dumper;
37
use Data::Dumper;
38
38
39
# check whether questions should be asked
40
our $QUIET;
41
$QUIET = 1 if $ARGV[0] and $ARGV[0] eq 'QUIET';
42
39
print "\n\n==> Probing Required Perl Modules <==\n\n";
43
print "\n\n==> Probing Required Perl Modules <==\n\n";
40
44
41
our @MOD;
45
our @MOD;
Lines 49-56 Link Here
49
    $rec->{found} = check_module($rec);
53
    $rec->{found} = check_module($rec);
50
    unless ($rec->{found}) {
54
    unless ($rec->{found}) {
51
        if ($rec->{optional} and 
55
        if ($rec->{optional} and 
52
            not ask_yesno("Do you want to install the optional module " . 
56
            not ask_yesno("Do you want to install the optional module " .
53
                          "$rec->{name}? [no] ", 0)) {
57
                          "$rec->{name}? [no] ", 0, $QUIET)) {
54
            $rec->{found} = 1;
58
            $rec->{found} = 1;
55
        } else {
59
        } else {
56
            $MISSING = 1;
60
            $MISSING = 1;
Lines 73-79 Link Here
73
END
77
END
74
78
75
    # for some reason an "exit 1" here doesn't stop the make run.
79
    # for some reason an "exit 1" here doesn't stop the make run.
76
    kill(2, $$) unless ask_yesno("Continue? [yes] ", 1);
80
    kill(2, $$) unless ask_yesno("Continue? [yes] ", 1, $QUIET);
77
}
81
}
78
82
79
83
(-)inst/required.pl (-4 / +8 lines)
Lines 67-72 Link Here
67
our %REQ;
67
our %REQ;
68
our %RESULTS;
68
our %RESULTS;
69
69
70
# check to see whether we should ask questions or not
71
our $QUIET;
72
$QUIET = 1 if $ARGV[0] and $ARGV[0] eq 'QUIET';
73
70
# collect data - configuration requirements data goes into %REQ, raw
74
# collect data - configuration requirements data goes into %REQ, raw
71
# binary pass/fail goes into %RESULTS.
75
# binary pass/fail goes into %RESULTS.
72
76
Lines 125-137 Link Here
125
    # confirm or deny
129
    # confirm or deny
126
    if ($REQ{PG_CONFIG}) {
130
    if ($REQ{PG_CONFIG}) {
127
        print "Found PostgreSQL's pg_config at '$REQ{PG_CONFIG}'.\n";
131
        print "Found PostgreSQL's pg_config at '$REQ{PG_CONFIG}'.\n";
128
        unless (ask_yesno("Is this correct? [yes] ", 1)) {
132
        unless (ask_yesno("Is this correct? [yes] ", 1, $QUIET)) {
129
            ask_confirm("Enter path to pg_config", \$REQ{PG_CONFIG});
133
            ask_confirm("Enter path to pg_config", \$REQ{PG_CONFIG});
130
        }
134
        }
131
    } else {
135
    } else {
132
        print "Failed to find pg_config.\n";
136
        print "Failed to find pg_config.\n";
133
        if (ask_yesno("Do you want to provide a path to pg_config? [no] ",
137
        if (ask_yesno("Do you want to provide a path to pg_config? [no] ",
134
                      0)) {
138
                      0, $QUIET)) {
135
            $REQ{PG_CONFIG} = 'NONE';
139
            $REQ{PG_CONFIG} = 'NONE';
136
            ask_confirm("Enter path to pg_config", \$REQ{PG_CONFIG});
140
            ask_confirm("Enter path to pg_config", \$REQ{PG_CONFIG});
137
        } else {
141
        } else {
Lines 188-194 Link Here
188
    # confirm or deny
192
    # confirm or deny
189
    if ($REQ{APACHE_EXE}) {
193
    if ($REQ{APACHE_EXE}) {
190
        print "Found Apache server binary at '$REQ{APACHE_EXE}'.\n";
194
        print "Found Apache server binary at '$REQ{APACHE_EXE}'.\n";
191
        unless (ask_yesno("Is this correct? [yes] ", 1)) {
195
        unless ($QUIET or ask_yesno("Is this correct? [yes] ", 1)) {
192
            ask_confirm("Enter path to Apache server binary", 
196
            ask_confirm("Enter path to Apache server binary", 
193
                        \$REQ{APACHE_EXE});
197
                        \$REQ{APACHE_EXE});
194
        }
198
        }
Lines 196-202 Link Here
196
        print "Failed to find Apache server binary.\n";
200
        print "Failed to find Apache server binary.\n";
197
        if (ask_yesno("Do you want to provide a path to the Apache server " .
201
        if (ask_yesno("Do you want to provide a path to the Apache server " .
198
                      "binary? [no] ",
202
                      "binary? [no] ",
199
                      0)) {
203
                      0, $QUIET)) {
200
            $REQ{APACHE_EXE} = 'NONE';
204
            $REQ{APACHE_EXE} = 'NONE';
201
            ask_confirm("Enter path to Apache server binary", 
205
            ask_confirm("Enter path to Apache server binary", 
202
                        \$REQ{APACHE_EXE});
206
                        \$REQ{APACHE_EXE});
(-)inst/apache.pl (-5 / +9 lines)
Lines 36-41 Link Here
36
use File::Spec::Functions;
36
use File::Spec::Functions;
37
use Data::Dumper;
37
use Data::Dumper;
38
38
39
# check whether questions should be asked
40
our $QUIET;
41
$QUIET = 1 if $ARGV[0] and $ARGV[0] eq 'QUIET';
42
39
print "\n\n==> Probing Apache Configuration <==\n\n";
43
print "\n\n==> Probing Apache Configuration <==\n\n";
40
44
41
our %AP;
45
our %AP;
Lines 296-312 Link Here
296
300
297
END
301
END
298
302
299
    ask_confirm("Apache User:\t\t\t",  \$AP{user});
303
    ask_confirm("Apache User:\t\t\t",  \$AP{user}, $QUIET);
300
    ask_confirm("Apache Group:\t\t\t", \$AP{group});
304
    ask_confirm("Apache Group:\t\t\t", \$AP{group}, $QUIET);
301
    ask_confirm("Apache Port:\t\t\t",  \$AP{port});
305
    ask_confirm("Apache Port:\t\t\t",  \$AP{port}, $QUIET);
302
    ask_confirm("Apache Server Name:\t\t",  \$AP{server_name});
306
    ask_confirm("Apache Server Name:\t\t",  \$AP{server_name}, $QUIET);
303
307
304
    # install fails if this is wrong
308
    # install fails if this is wrong
305
    $AP{ssl_key} = catfile($AP{HTTPD_ROOT}, "conf", "ssl.key", "server.key");
309
    $AP{ssl_key} = catfile($AP{HTTPD_ROOT}, "conf", "ssl.key", "server.key");
306
    $AP{ssl_cert} = catfile($AP{HTTPD_ROOT}, "conf", "ssl.crt","server.crt");
310
    $AP{ssl_cert} = catfile($AP{HTTPD_ROOT}, "conf", "ssl.crt","server.crt");
307
311
308
    if ($AP{ssl} or $AP{apache_ssl}) {
312
    if ($AP{ssl} or $AP{apache_ssl}) {
309
        if (ask_yesno("Do you want to use SSL? [no] ", 0)) {
313
        if (ask_yesno("Do you want to use SSL? [no] ", 0, $QUIET)) {
310
            if ($AP{ssl} and $AP{apache_ssl}) {
314
            if ($AP{ssl} and $AP{apache_ssl}) {
311
                $AP{ssl} = ask_choice("Which SSL module do you use? " .
315
                $AP{ssl} = ask_choice("Which SSL module do you use? " .
312
                                      "(apache_ssl or mod_ssl) ",
316
                                      "(apache_ssl or mod_ssl) ",
(-)inst/lib/Bric/Inst.pm (-10 / +56 lines)
Lines 76-95 Link Here
76
    exit 1;
76
    exit 1;
77
}
77
}
78
78
79
=item ask_yesno($question, $default)
79
=item ask_yesno($question, $default, $quiet_mode)
80
80
81
Asks the user a yes/no question.  Default to $default if they just
81
Asks the user a yes/no question.  Default to $default if they just
82
press [return].  Returns 1 for a yes answer and 0 for no.
82
press [return].  Returns 1 for a yes answer and 0 for no.
83
83
84
If $quiet_mode is true the default answer is returned without
85
asking for user input (useful for unattended execution where
86
appropriate default values can be passed to this sub).
87
88
Be careful when using ask_yesno in quiet mode: if you're asking
89
confirmation for a potentially dangerous task either be sure
90
to set the "forget it" answer as default or don't allow
91
quiet mode at all.
92
84
=cut
93
=cut
85
94
86
sub ask_yesno {
95
sub ask_yesno {
87
    my ($question, $default) = @_;
96
    my ($question, $default, $quiet_mode) = @_;
88
    my $tries = 1;
97
    my $tries = 1;
89
    local $| = 1;
98
    local $| = 1;
90
    while (1) {
99
    while (1) {
91
        print $question;
100
        print $question;
92
        my $answer = <STDIN>;
101
        # just print a newline after the question to keep
102
        # output tidy, if we are in quiet mode
103
        print "\n" if $quiet_mode;
104
        
105
        my $answer= '';
106
        # do not wait for user input if we are in quiet mode
107
        $answer = <STDIN> unless $quiet_mode;
93
        chomp($answer);
108
        chomp($answer);
94
        return $default if not length $answer;
109
        return $default if not length $answer;
95
        return 0 if $answer and $answer =~ /^no?$/i;
110
        return 0 if $answer and $answer =~ /^no?$/i;
Lines 100-149 Link Here
100
}
115
}
101
116
102
117
103
=item ask_confirm($description, $ref_to_setting)
118
=item ask_confirm($description, $ref_to_setting, $quiet_mode)
104
119
105
Asks the user to confirm a setting.  If they enter a new value asks
120
Asks the user to confirm a setting.  If they enter a new value asks
106
"are you sure."  Directly updates the setting and returns when done.
121
"are you sure."  Directly updates the setting and returns when done.
107
122
108
A default setting of "NONE" will force the user to enter a value.
123
A default setting of "NONE" will force the user to enter a value.
109
124
125
If $quiet_mode is true the default answer is returned without
126
asking for user input (useful for unattended execution where
127
appropriate default values can be passed to this sub).
128
129
The question is printed anyway, so that the default value appears
130
in the output.
131
110
=cut
132
=cut
111
133
112
sub ask_confirm {
134
sub ask_confirm {
113
    my ($desc, $ref) = @_;
135
    my ($desc, $ref, $quiet_mode) = @_;
114
    my $tries = 1;
136
    my $tries = 1;
115
    local $| = 1;
137
    local $| = 1;
116
    while (1) {
138
    while (1) {
117
        print $desc, " [", $$ref, "] ";
139
        print $desc, " [", $$ref, "] ";
118
        my $answer = <STDIN>;
140
        # just print a newline after the question to keep
141
        # output tidy, if we are in quiet mode
142
        print "\n" if $quiet_mode;
143
        
144
        my $answer= '';
145
        # do not wait for user input if we are in quiet mode
146
        $answer = <STDIN> unless $quiet_mode;
119
        chomp($answer);
147
        chomp($answer);
120
        if (not length $answer or $answer eq $$ref) {
148
        if (not length $answer or $answer eq $$ref) {
149
            if($quiet_mode and $$ref eq 'NONE') {
150
                print "No default is available for this question: ",
151
                    "cannot continue quiet mode execution";
152
                return;
153
            }
121
            return unless $$ref eq 'NONE';
154
            return unless $$ref eq 'NONE';
122
            print "No default is available for this question, ",
155
            print "No default is available for this question, ",
123
                "please enter a value.\n";
156
                "please enter a value.\n";
124
            next;
157
            next;
125
        }
158
        }
126
        if (ask_yesno("Are you sure you want to use '$answer'? [yes] ", 1)) {
159
        if (ask_yesno("Are you sure you want to use '$answer'? [yes] ", 1, $quiet_mode)) {
127
            $$ref = $answer;
160
            $$ref = $answer;
128
            return;
161
            return;
129
        }
162
        }
130
    }
163
    }
131
}
164
}
132
165
133
=item ask_choice($question, [ "opt1", "opt2" ], "default")
166
=item ask_choice($question, [ "opt1", "opt2" ], "default", $quiet_mode)
134
167
135
Asks the user to choose from a list of options.  Returns the option
168
Asks the user to choose from a list of options.  Returns the option
136
selected.
169
selected.
137
170
171
If $quiet_mode is true the default answer is returned without
172
asking for user input (useful for unattended execution where
173
appropriate default values can be passed to this sub).
174
175
The question is printed anyway, so that the default value appears
176
in the output.
177
138
=cut
178
=cut
139
179
140
sub ask_choice {
180
sub ask_choice {
141
    my ($desc, $choices, $default) = @_;
181
    my ($desc, $choices, $default, $quiet_mode) = @_;
142
    my $tries = 1;
182
    my $tries = 1;
143
    local $| = 1;
183
    local $| = 1;
144
    while (1) {
184
    while (1) {
145
        print $desc, " [", $default, "] ";
185
        print $desc, " [", $default, "] ";
146
        my $answer = <STDIN>;
186
        # just print a newline after the question to keep
187
        # output tidy, if we are in quiet mode
188
        print "\n" if $quiet_mode;
189
        
190
        my $answer= '';
191
        # do not wait for user input if we are in quiet mode
192
        $answer = <STDIN> unless $quiet_mode;
147
        chomp($answer);
193
        chomp($answer);
148
        $answer = lc $answer;
194
        $answer = lc $answer;
149
        return $default if not length $answer;
195
        return $default if not length $answer;
(-)inst/clone.pl (-11 / +36 lines)
Lines 19-24 Link Here
19
install.db if available.  Outputs to the various .db files used by
19
install.db if available.  Outputs to the various .db files used by
20
later stages of the install.
20
later stages of the install.
21
21
22
The following configuration variables can be set using environment
23
variables: C<$BRICOLAGE_ROOT>, C<$CONFIG_DIR>, C<$CLONE_NAME>,
24
e.g.:
25
26
  make CLONE_NAME=unattended_archive clone
27
28
If the environment variable C<$INSTALL_VERBOSITY> is set to "QUIET"
29
this script won't ask for confirmations so that unattended
30
execution is possible:
31
32
  make INSTALL_VERBOSITY=QUIET clone
33
22
=head1 AUTHOR
34
=head1 AUTHOR
23
35
24
Sam Tregar <stregar@about-inc.com>
36
Sam Tregar <stregar@about-inc.com>
Lines 37-46 Link Here
37
use Data::Dumper;
49
use Data::Dumper;
38
use POSIX 'strftime';
50
use POSIX 'strftime';
39
51
52
# determine if clone should run in quiet mode
53
my $quiet_mode = (defined $ENV{INSTALL_VERBOSITY} and $ENV{INSTALL_VERBOSITY} eq 'QUIET') ? 1 : 0;
54
40
# make sure we're root, otherwise uninformative errors result
55
# make sure we're root, otherwise uninformative errors result
41
unless ($> == 0) {
56
unless ($> == 0) {
42
    print "This process must (usually) be run as root.\n";
57
    print "This process must (usually) be run as root.\n";
43
    exit 1 unless ask_yesno("Continue as non-root user? [yes] ", 1);
58
    exit 1 unless ask_yesno("Continue as non-root user? [yes] ", 1, $quiet_mode);
44
}
59
}
45
60
46
# setup default root
61
# setup default root
Lines 80-98 Link Here
80
# get clone name
95
# get clone name
81
sub get_clone_name {
96
sub get_clone_name {
82
    print "\n";
97
    print "\n";
83
    $CLONE{NAME} = strftime '%Y%m%d%H%M%S', localtime;
98
    $CLONE{NAME} = $ENV{CLONE_NAME} || strftime '%Y%m%d%H%M%S', localtime;
99
    
84
    ask_confirm("What would you like to name your clone ".
100
    ask_confirm("What would you like to name your clone ".
85
                "(used to name the archive)? ", \$CLONE{NAME});
101
                "(used to name the archive)? ", \$CLONE{NAME},
102
                $quiet_mode);
86
}
103
}
87
104
88
# find the bricolage to update
105
# find the bricolage to update
89
sub get_bricolage_root {
106
sub get_bricolage_root {
90
    ask_confirm("Bricolage Root Directory to Clone?",
107
    ask_confirm("Bricolage Root Directory to Clone?",
91
		\$CLONE{BRICOLAGE_ROOT});
108
		\$CLONE{BRICOLAGE_ROOT},
109
                $quiet_mode);
92
110
93
    $CLONE{CONFIG_DIR} = catdir $CLONE{BRICOLAGE_ROOT}, 'conf';
111
    $CLONE{CONFIG_DIR} = $ENV{CONFIG_DIR} || 
112
        catdir $CLONE{BRICOLAGE_ROOT}, 'conf';
113
        
94
    ask_confirm("Bricolage Config Directory",
114
    ask_confirm("Bricolage Config Directory",
95
		\$CLONE{CONFIG_DIR});
115
		\$CLONE{CONFIG_DIR},
116
                $quiet_mode);
96
117
97
    # verify that we have a Bricolage install here
118
    # verify that we have a Bricolage install here
98
    hard_fail("No Bricolage installation found in $CLONE{BRICOLAGE_ROOT}.\n")
119
    hard_fail("No Bricolage installation found in $CLONE{BRICOLAGE_ROOT}.\n")
Lines 123-129 Link Here
123
The installed version ("$VERSION") is not same as this version!  "make
144
The installed version ("$VERSION") is not same as this version!  "make
124
clone" is only designed to work with like versions.
145
clone" is only designed to work with like versions.
125
END
146
END
126
        exit 1 unless ask_yesno("Continue with clone? [no] ", 0);
147
        exit 1 unless ask_yesno("Continue with clone? [no] ", 0, $quiet_mode);
127
        @todo = ($VERSION);
148
        @todo = ($VERSION);
128
149
129
    }
150
    }
Lines 133-145 Link Here
133
sub confirm_paths {
154
sub confirm_paths {
134
    print "\nPlease confirm the Bricolage clone source directories.\n\n";
155
    print "\nPlease confirm the Bricolage clone source directories.\n\n";
135
    ask_confirm("Bricolage Perl Module Directory",
156
    ask_confirm("Bricolage Perl Module Directory",
136
		\$INSTALL->{CONFIG}{MODULE_DIR});
157
                \$INSTALL->{CONFIG}{MODULE_DIR},
158
                $quiet_mode);
137
    ask_confirm("Bricolage Executable Directory",
159
    ask_confirm("Bricolage Executable Directory",
138
		\$INSTALL->{CONFIG}{BIN_DIR});
160
                \$INSTALL->{CONFIG}{BIN_DIR},
161
                $quiet_mode);
139
    ask_confirm("Mason Component Directory",
162
    ask_confirm("Mason Component Directory",
140
		\$INSTALL->{CONFIG}{MASON_COMP_ROOT});
163
                \$INSTALL->{CONFIG}{MASON_COMP_ROOT},
164
                $quiet_mode);
141
    ask_confirm("Mason Data Directory",
165
    ask_confirm("Mason Data Directory",
142
		\$INSTALL->{CONFIG}{MASON_DATA_ROOT});
166
                \$INSTALL->{CONFIG}{MASON_DATA_ROOT},
167
                $quiet_mode);
143
}
168
}
144
169
145
# output .db files used by installation steps
170
# output .db files used by installation steps

Return to bug 21549