summaryrefslogtreecommitdiffstats
path: root/drakpxelinux.pl
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-08-11 09:03:00 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-08-11 09:03:00 +0000
commit791ae0f00f068662e15f1c033450bde0d8f80982 (patch)
tree3f788b9a4abf46a3c12d16bd8eff95606624801f /drakpxelinux.pl
parente7a62535783db512bb6fb7c8b3eb413f1fa0c064 (diff)
downloaddrakpxelinux-791ae0f00f068662e15f1c033450bde0d8f80982.tar
drakpxelinux-791ae0f00f068662e15f1c033450bde0d8f80982.tar.gz
drakpxelinux-791ae0f00f068662e15f1c033450bde0d8f80982.tar.bz2
drakpxelinux-791ae0f00f068662e15f1c033450bde0d8f80982.tar.xz
drakpxelinux-791ae0f00f068662e15f1c033450bde0d8f80982.zip
perl_checker fixes
Diffstat (limited to 'drakpxelinux.pl')
-rw-r--r--drakpxelinux.pl36
1 files changed, 21 insertions, 15 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl
index 57f95fb..0a20e30 100644
--- a/drakpxelinux.pl
+++ b/drakpxelinux.pl
@@ -160,8 +160,8 @@ sub get_items() {
my ($allopt) = m!\s*APPEND\s(.*)!;
my ($autocomp) = m!\bautomatic\b=(.*?)\s!;
my ($devram) = m!root=/dev/ram3\srw!;
- my $optionsall = join(' ', grep { ! /$devram/ and ! /initrd=$initall/ and ! /display=$displayall/ and ! /ramdisk_size=$ramdiskall/ and ! /automatic=$autocomp/ and ! /vga=$vgaall/ } split(' ', $allopt));
- if ($label and $kernel and $initall) {
+ my $optionsall = join(' ', grep { ! /$devram/ && ! /initrd=$initall/ && !/display=$displayall/ && ! /ramdisk_size=$ramdiskall/ && ! /automatic=$autocomp/ && !/vga=$vgaall/ } split(' ', $allopt));
+ if ($label && $kernel && $initall) {
my $information = get_information($label);
# now push data in @
push @listpxe, {
@@ -244,13 +244,13 @@ label local
EOF
foreach my $a (@listpxe) {
- if ($a->{interface} and ! $a->{display}) {
+ if ($a->{interface} && !$a->{display}) {
append_to_file($conf, "
label $a->{label}
KERNEL $a->{kernel}
APPEND initrd=$a->{initrd} automatic=method:$a->{automatic},interface:$a->{interface},network:$a->{network},server:$a->{server},directory:$a->{directory} ramdisk_size=$a->{ramdisk} root=/dev/ram3 rw vga=$a->{vga}
");
- } elsif ($a->{interface} and $a->{display}) {
+ } elsif ($a->{interface} && $a->{display}) {
append_to_file($conf, "
label $a->{label}
KERNEL $a->{kernel}
@@ -317,7 +317,7 @@ sub wizard_add_entry {
next => 'addimg',
},
addimg => {
- name => N("At the end of this wizard, the all.rdz image and kernel vmlinuz will be copied into \n%s.\n\nPXE menu list will be updated with this new entry",$IMGPATH),
+ name => N("At the end of this wizard, the all.rdz image and kernel vmlinuz will be copied into \n%s.\n\nPXE menu list will be updated with this new entry", $IMGPATH),
data => [
{ label => N("PXE label:"), val => \$WPXENAME,
help => N("name displayed in PXE menu (please provide a word or a number, with no space)") },
@@ -330,10 +330,11 @@ sub wizard_add_entry {
],
complete => sub {
if (any { /^$WPXENAME :/ } cat_($PXEHELP)) {
- err_dialog(N("Error!"), N("Found a similar entry in PXE list labeled: %s.\nChoose another label please",$WPXENAME)) and return 'addimg';
+ err_dialog(N("Error !"), N("Found a similar entry in PXE list labeled : %s.\nChoose another label please", $WPXENAME)) and return 'addimg';
}
if ($WPXENAME != /^\d+$/) {
- err_dialog(N("Error!"), N("PXE label should be a name/number without space. Please adjust")) and return 'addimg';
+ err_dialog(N("Error !"), N("PXE label should be a name/number without space. Please adjust"));
+ return 'addimg';
}
},
next => 'endadd',
@@ -429,7 +430,11 @@ sub test_similar_label {
# err_dialog(N("hmm.."), N("You should provide a new label name.")) and return 0;
# } els
if (any { /^label\s$newlabel$/ } cat_($conf)) {
+<<<<<<< drakpxelinux.pl
+ err_dialog(N("Error !"), N("Found a similar entry in PXE list labeled : %s.\nChoose another label please", $newlabel)) and return 0;
+=======
err_dialog(N("Error!"), N("Found a similar entry in PXE list labeled: %s.\nChoose another label please",$newlabel)) and return 0;
+>>>>>>> 1.24
} else { return 1 };
}
@@ -701,7 +706,7 @@ sub cell_edited {
}
} elsif ($column == COLUMN_AUTOMATIC) {
my $i = ($path->get_indices)[0];
- if (!member($new_text, @list_method) or ($listpxe[$i]{kernel} =~ /memdisk/)) {
+ if (!member($new_text, @list_method) || ($listpxe[$i]{kernel} =~ /memdisk/)) {
return;
} else {
$listpxe[$i]{automatic} = $new_text;
@@ -709,7 +714,7 @@ sub cell_edited {
}
} elsif ($column == COLUMN_INTERFACE) {
my $i = ($path->get_indices)[0];
- if (member($new_text, @list_eth) or ($listpxe[$i]{kernel} != /memdisk/)) {
+ if (member($new_text, @list_eth) || ($listpxe[$i]{kernel} != /memdisk/)) {
$listpxe[$i]{interface} = $new_text;
$model->set($iter, $column, $listpxe[$i]{interface});
}
@@ -761,6 +766,7 @@ sub show_help { info_dialog("help",
gtkpack_(gtkset_border_width(Gtk2::VBox->new, 3),
0, $help,
0, gtksignal_connect(set_help_tip(Gtk2::Button->new(N("online PXE documentation")), 'helponline'),
+ # FIXME: we lacks a web programe here:
clicked => sub { open(F, "http://clic.mandrakesoft.com/documentation/pxe/ |") }
),
),
@@ -807,10 +813,10 @@ sub wizard_pxe_server {
summaryserver => {
name => N("The wizard will now prepare all default files to set your PXE server"),
data => [
- { label => N("TFTP directory:") . "\t\t" . "$TFTPDIR" },
- { label => N("Boot image path:") . "\t\t" . "$IMGPATH" },
- { label => N("PXE config file:") . "\t\t" . "$pxeconf" },
- { label => N("PXE help file:") . "\t\t" . "$PXEHELP" },
+ { label => N("TFTP directory: %s", $TFTPDIR) },
+ { label => N("Boot image path: %s", $IMGPATH) },
+ { label => N("PXE config file: %s", $pxeconf) },
+ { label => N("PXE help file: %s", $PXEHELP) },
],
post => \&do_it_pxe,
no_back => 1,
@@ -929,7 +935,7 @@ sub add_columns {
my $model = $treeview->get_model;
# horrible hack to avoid: GLib-GObject-CRITICAL **: file gobject.c: line 1019 (g_object_set_property): assertion `G_IS_VALUE (value)' failed at drakpxe2.pl line 640.
my $t = "0";
- my @j = qw/Label Info Kernel Initrd Method Interface Network Server Directory Ramdisk vga Display Extra Options/;
+ my @j = qw(Label Info Kernel Initrd Method Interface Network Server Directory Ramdisk vga Display Extra Options);
each_index {
my $renderer = Gtk2::CellRendererText->new;
$renderer->set(editable => 0);
@@ -937,7 +943,7 @@ sub add_columns {
$renderer->set_data(column => $::i);
$treeview->insert_column_with_attributes(-1, $j[$t], $renderer, 'text' => $::i);
$t++;
- } (qw/x x x x x x x x x x x x x/);
+ } (qw(x x x x x x x x x x x x x));
#(("Label"), ("Info"), ("Kernel"), ("Initrd"), ("Method"), ("Interface"), ("Network"), ("Server"), ("Directory"), ("Ramdisk"), ("vga"), ("Display"), ("Extra"), ("Options"));
}