Since version for product files is hardcoded to a fixed value (to avoid
authorAdrian Schröter <adrian@suse.de>
Fri, 27 Feb 2009 07:10:43 +0000 (07:10 +0000)
committerAdrian Schröter <adrian@suse.de>
Fri, 27 Feb 2009 07:10:43 +0000 (07:10 +0000)
version number scheme limititations), we need to read the version from
product variable settings.

Build/Kiwi.pm

index 50f2001..093b445 100644 (file)
@@ -106,10 +106,17 @@ sub kiwiparse {
   if ($description->{'specification'}) {
     $ret->{'name'} = $description->{'specification'}->[0]->{'_content'};
   }
+  # take default version setting
   my $preferences = (($kiwi->{'preferences'} || [])->[0]) || {};
   if ($preferences->{'version'}) {
     $ret->{'version'} = $preferences->{'version'}->[0]->{'_content'};
   }
+  # override with product version, if existing
+  my $productoptions = (($kiwi->{'productoptions'} || [])->[0]) || {};
+  for my $po (@{$productoptions->{'productvar'} || []}) {
+    next unless @{$po->{'name'}} == "VERSION";
+    $ret->{'version'} = $po->{'_content'};
+  }
   for my $type (@{$preferences->{'type'} || []}) {
     next unless @{$preferences->{'type'}} == 1 || !$type->{'optional'};
     push @types, $type->{'_content'};