diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-10-28 20:22:36 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-10-28 20:22:36 +0000 |
commit | c3327e6b1a783c8afee54c5ccd2b5d44afdba66b (patch) | |
tree | 1f58d66be04bb7edad61b7fe7a48cb556d33b5fe | |
parent | e40ef60401883d797a8772911bb0af92f17ff3ff (diff) | |
download | drakiso-c3327e6b1a783c8afee54c5ccd2b5d44afdba66b.tar drakiso-c3327e6b1a783c8afee54c5ccd2b5d44afdba66b.tar.gz drakiso-c3327e6b1a783c8afee54c5ccd2b5d44afdba66b.tar.bz2 drakiso-c3327e6b1a783c8afee54c5ccd2b5d44afdba66b.tar.xz drakiso-c3327e6b1a783c8afee54c5ccd2b5d44afdba66b.zip |
move get_live_name as get_name method in MDV::Draklive::Live object
-rwxr-xr-x | draklive | 23 | ||||
-rw-r--r-- | lib/MDV/Draklive/Live.pm | 5 |
2 files changed, 14 insertions, 14 deletions
@@ -368,19 +368,14 @@ my %overlay = ( }, ); -sub get_live_name { - my ($live) = @_; - join('-', grep { $_ } @{$live->{settings}}{qw(name product version desktop region media arch)}); -} - sub get_builddir { my ($live) = @_; - $live->{settings}{builddir} . '/' . get_live_name($live); + $live->{settings}{builddir} . '/' . $live->get_name; } sub get_system_root { my ($live) = @_; - $live->{settings}{chroot} . '/' . get_live_name($live); + $live->{settings}{chroot} . '/' . $live->get_name; } sub get_initrd_path { @@ -941,16 +936,16 @@ sub post_install_system { sub write_dist_lists { my ($live) = @_; - my $lst = get_builddir($live) . $live->{prefix}{build}{dist} . '/' . get_live_name($live) . '.lst'; + my $lst = get_builddir($live) . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.lst'; mkdir_p(dirname($lst)); run_("chroot " . get_system_root($live) . " rpm -qa | sort > " . $lst); - my $full = get_builddir($live) . $live->{prefix}{build}{dist} . '/' . get_live_name($live) . '.lst.full'; + my $full = get_builddir($live) . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.lst.full'; mkdir_p(dirname($full)); run_("chroot " . get_system_root($live) . qq( sh -c "rpm -qa --qf '%{size} \t%{name}\n' | sort -n" > ) . $full); - my $leaves = get_builddir($live) . $live->{prefix}{build}{dist} . '/' . get_live_name($live) . '.lst.leaves'; + my $leaves = get_builddir($live) . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.lst.leaves'; mkdir_p(dirname($leaves)); run_("chroot " . get_system_root($live) . qq( sh -c "urpmi_rpm-find-leaves | xargs rpm -q --qf '%{size} \t%{name}\n' | sort -n" > ) . $leaves); @@ -958,7 +953,7 @@ sub write_dist_lists { require lang; my @live_langs = get_langs($live); my @langs = grep { member(lang::locale_to_main_locale($_), @live_langs) } lang::list_langs(); - my $langs_file = get_builddir($live) . $live->{prefix}{build}{dist} . '/' . get_live_name($live) . '.langs'; + my $langs_file = get_builddir($live) . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.langs'; output_p($langs_file, map { lang::l2name($_) . " (" . $_ . ")\n" } sort(@langs)); } @@ -1212,7 +1207,7 @@ sub set_device_label { sub get_cdrom_master_path { my ($live, $opts) = @_; - get_builddir($live) . $live->{prefix}{build}{dist} . '/' . get_live_name($live) . ($opts->{boot} && "-boot-$opts->{boot}") . '.iso'; + get_builddir($live) . $live->{prefix}{build}{dist} . '/' . $live->get_name . ($opts->{boot} && "-boot-$opts->{boot}") . '.iso'; } sub create_cdrom_master { @@ -1275,7 +1270,7 @@ sub create_cdrom_master { sub get_disk_master_path { my ($live) = @_; - get_builddir($live) . $live->{prefix}{build}{dist} . '/' . get_live_name($live) . '.img'; + get_builddir($live) . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.img'; } sub allocate_master { @@ -1660,7 +1655,7 @@ sub create_image { sub get_disk_replicator_path { my ($live) = @_; - get_builddir($live) . $live->{prefix}{build}{dist} . '/' . get_live_name($live) . '.rest.img'; + get_builddir($live) . $live->{prefix}{build}{dist} . '/' . $live->get_name . '.rest.img'; } sub get_disk_replicator_files { diff --git a/lib/MDV/Draklive/Live.pm b/lib/MDV/Draklive/Live.pm index 1f3bd3d..7d5a3fd 100644 --- a/lib/MDV/Draklive/Live.pm +++ b/lib/MDV/Draklive/Live.pm @@ -7,4 +7,9 @@ sub new { bless {}, $class; } +sub get_name { + my ($live) = @_; + join('-', grep { $_ } @{$live->{settings}}{qw(name product version desktop region media arch)}); +} + 1; |