From 10be1b164d2ee27786f8dc8e38f1d7e8dd77fa62 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 3 Mar 2003 09:06:29 +0000 Subject: =?UTF-8?q?fix=20bug=20reported=20by=20C=C3=A9dric=20Th=C3=A9venet?= =?UTF-8?q?=20(impossible=20to=20save=20newly=20edited=20rules)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perl-install/standalone/drakperm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'perl-install') diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm index d0feb3aec..02bbf23a9 100755 --- a/perl-install/standalone/drakperm +++ b/perl-install/standalone/drakperm @@ -181,12 +181,16 @@ sub display_perm { sub save_perm { $modified or return 0; + my $val; local *F; - open F, '>'.$local_path.'perm.local' or die("F CHIER BORDEL"); - foreach my $i (0..$rows_cnt) { - my $line = $permList->get_text($i, 0) . "\t" . $permList->get_text($i,1) . ($permList->get_text($i,2) ? "." . $permList->get_text($i,2) : "") . "\t" . $permList->get_text($i,3) . "\n"; - print F $line; - } + open F, '>'.$local_path.'perm.local' or die("Impssible to process \"", $local_path, "perm.local\""); + $treeModel->foreach(sub { + my ($model, $_path, $iter) = @_; + my $module = $model->get($iter, 0); + my $line = $model->get($iter, 0) . "\t" . $model->get($iter,1) . ($model->get($iter,2) ? "." . $model->get($iter,2) : "") . "\t" . $model->get($iter,3) . "\n"; + print F $line; + return 0; + }, $val); close F; $modified = 0; } -- cgit v1.2.1