summaryrefslogtreecommitdiffstats
path: root/perl-install/install/ftp.pm
blob: 292fd2d3dc13732d7a4275484c4c06e619897f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package install
Diffstat (limited to 'perl-install/security')
-rw-r--r--perl-install/security/main.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/perl-install/security/main.pm b/perl-install/security/main.pm
index 4fed477a5..37b56a00f 100644
--- a/perl-install/security/main.pm
+++ b/perl-install/security/main.pm
@@ -92,7 +92,7 @@ sub network_generate_page {
my @items;
foreach my $tmp (@network_options) {
-# my $hbutton = gtksignal_connect(new Gtk::Button(_('Help')),
+# my $hbutton = gtksignal_connect(new Gtk::Button(_("Help")),
# 'clicked' => sub { show_msec_help($tmp) } );
my $default = $msec->get_function_default('', $tmp);
if (member($default, @yesno_choices) || member($default, @alllocal_choices)) {
@@ -111,7 +111,7 @@ sub network_generate_page {
$$rsecurity_net_hash{$tmp}->set_popdown_strings(@alllocal_choices);
$$rsecurity_net_hash{$tmp}->entry->set_text($msec->get_check_value('', $tmp));
}
- push @items, [ new Gtk::Label(_($tmp." (default: ".$default.")")), $$rsecurity_net_hash{$tmp} ]; #, $hbutton];
+ push @items, [ new Gtk::Label($tmp._(" (default: %s)",$default)), $$rsecurity_net_hash{$tmp} ]; #, $hbutton];
}
gtkpack(new Gtk::VBox(0, 0),
@@ -128,7 +128,7 @@ sub system_generate_page {
my @items;
foreach my $tmp (@system_options) {
-# my $hbutton = gtksignal_connect(new Gtk::Button(_('Help')),
+# my $hbutton = gtksignal_connect(new Gtk::Button(_("Help")),
# 'clicked' => sub { show_msec_help($tmp) } );
my $default = $msec->get_function_default('', $tmp);
my $item_hbox = new Gtk::HBox(0, 0);
@@ -147,7 +147,7 @@ sub system_generate_page {
$$rsecurity_system_hash{$tmp}->set_popdown_strings(@alllocal_choices);
$$rsecurity_system_hash{$tmp}->entry->set_text($msec->get_check_value('', $tmp));
}
- push @items, [ new Gtk::Label(_($tmp." (default: ".$default.")")), $$rsecurity_system_hash{$tmp} ]; #, $hbutton ];
+ push @items, [ new Gtk::Label($tmp._(" (default: %s)",$default)), $$rsecurity_system_hash{$tmp} ]; #, $hbutton ];
}
createScrolledWindow(gtkpack(new Gtk::VBox(0, 0),
@@ -165,7 +165,7 @@ sub checks_generate_page {
my @items;
foreach my $tmp (@security_checks) {
if (!member(@ignore_list, $tmp)) {
-# my $hbutton = gtksignal_connect(new Gtk::Button(_('Help')),
+# my $hbutton = gtksignal_connect(new Gtk::Button(_("Help")),
# 'clicked' => sub { show_msec_help($tmp) } );
$$rsecurity_checks_hash{$tmp} = new Gtk::Combo();
$$rsecurity_checks_hash{$tmp}->entry->set_editable(0);
wb">$ftp
&& $ftp->login($login, $password) and last; log::l("ftp login failed, sleeping before trying again"); sleep 5 * $_; } $ftp or die "unable to open ftp connection to $host\n"; $ftp->binary; $ftp->cwd($prefix); my @l = ($ftp, \ (my $_retr)); $hosts{"$host$prefix"} = \@l; @l; } sub getFile { my ($f, $url) = @_; my ($_size, $fh) = get_file_and_size($f, $url) or return; $fh; } sub get_file_and_size { my ($f, $url) = @_; foreach (1..3) { my ($ftp, $retr) = _new($url); eval { $$retr->close if $$retr }; if ($@) { log::l("FTP: closing previous retr failed ($@)"); _rewindGetFile(); #- in case Timeout got us on "->close" redo; } my $size = $ftp->size($f); $$retr = $ftp->retr($f) and return $size, $$retr; my $error = $ftp->code; $error == 550 and log::l("FTP: 550 file unavailable"), return; _rewindGetFile(); log::l("ftp get failed, sleeping before trying again (error:$error)"); sleep 1; } } #-sub closeFiles() { #- #- close any existing connections #- foreach (values %hosts) { #- my $retr = $_->[1] if ref $_; #- $$retr->close if $$retr; #- undef $$retr; #- } #-} sub _rewindGetFile() { #- close any existing connection. foreach (values %hosts) { my ($ftp, $retr) = @{$_ || []}; #- do not let Timeout kill us! eval { $$retr->close } if $$retr; eval { $ftp->close } if $ftp; } #- make sure to reconnect to server. %hosts = (); }