summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2016-11-12 14:33:04 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2016-11-12 14:33:04 +0000
commit81e203dcfbded9880bc84c22766d67f2372d442d (patch)
tree550f9c61e0637abe85a297e7de7a0e8261049ec5 /lib
parent7ea33eb861be71a8bfc0245a7d4764582d42f930 (diff)
downloaddraklive-81e203dcfbded9880bc84c22766d67f2372d442d.tar
draklive-81e203dcfbded9880bc84c22766d67f2372d442d.tar.gz
draklive-81e203dcfbded9880bc84c22766d67f2372d442d.tar.bz2
draklive-81e203dcfbded9880bc84c22766d67f2372d442d.tar.xz
draklive-81e203dcfbded9880bc84c22766d67f2372d442d.zip
Don't include region in the product name when region is 'all'.
Diffstat (limited to 'lib')
-rw-r--r--lib/MDV/Draklive/Live.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/MDV/Draklive/Live.pm b/lib/MDV/Draklive/Live.pm
index 545c96c..d2adb1f 100644
--- a/lib/MDV/Draklive/Live.pm
+++ b/lib/MDV/Draklive/Live.pm
@@ -7,9 +7,17 @@ sub new {
bless {}, $class;
}
+sub default_name_fields {
+ my ($live) = @_;
+ [ qw(name version product desktop),
+ if_($live->{settings}{region} ne 'all', region),
+ qw(arch media)
+ ];
+}
+
sub get_name {
my ($live) = @_;
- my $fields = $live->{name_fields} || [ qw(name version product desktop region arch media) ];
+ my $fields = $live->{name_fields} || default_name_fields($live);
join('-', grep { $_ } @{$live->{settings}}{@$fields});
}