diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-06-21 12:38:44 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-06-21 12:38:44 +0000 |
commit | 4e3b7d85bb195162cbaec3b140530f3076dc4858 (patch) | |
tree | 4b30506a25a71347843d5f80ac03b11d94863cdb | |
parent | ef041447abd94345b3fd90fb8052e9f897d6b31c (diff) | |
download | drakx-backup-do-not-use-4e3b7d85bb195162cbaec3b140530f3076dc4858.tar drakx-backup-do-not-use-4e3b7d85bb195162cbaec3b140530f3076dc4858.tar.gz drakx-backup-do-not-use-4e3b7d85bb195162cbaec3b140530f3076dc4858.tar.bz2 drakx-backup-do-not-use-4e3b7d85bb195162cbaec3b140530f3076dc4858.tar.xz drakx-backup-do-not-use-4e3b7d85bb195162cbaec3b140530f3076dc4858.zip |
- add profiles_exist
- enhance find_next_profile_name
- add_empty_profile now needs a profile name
-rw-r--r-- | perl-install/network/pxe.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/perl-install/network/pxe.pm b/perl-install/network/pxe.pm index a75aa18eb..ec0d1de53 100644 --- a/perl-install/network/pxe.pm +++ b/perl-install/network/pxe.pm @@ -239,16 +239,21 @@ sub list_pxelinux_profiles { sort(uniq(map { keys %{$profiles_conf->{profiles}{$_}} } qw(boot install))); } +sub profiles_exist { + my ($profiles_conf, $profile) = @_; + member($profile, network::pxe::list_pxelinux_profiles($profiles_conf)); +} + sub find_next_profile_name { my ($profiles_conf, $prefix) = @_; - my $i = 1; - /^$prefix(\d+)$/ && $1 >= $i and $i = $1 + 1 foreach network::pxe::list_pxelinux_profiles($profiles_conf); + my $i = undef; + /^$prefix(\d*)$/ && $1 >= $i and $i = $1 + 1 foreach network::pxe::list_pxelinux_profiles($profiles_conf); "$prefix$i"; } sub add_empty_profile { - my ($profiles_conf) = @_; - my $profile = find_next_profile_name($profiles_conf, "profile_"); + my ($profiles_conf, $profile, $to_install) = @_; + $to_install and $profiles_conf->{profiles}{install}{$profile} = 1; $profiles_conf->{profiles}{boot}{$profile} = 1; } |