File package-version.patch of Package kiwi

diff -Nrup a/modules/KIWICollect.pm b/modules/KIWICollect.pm
--- a/modules/KIWICollect.pm	2012-03-02 16:26:37.000000000 +0100
+++ b/modules/KIWICollect.pm	2012-04-26 15:30:44.429708363 +0200
@@ -916,6 +916,9 @@ sub setupPackageFiles
 		my $nofallback = 0;
 		my @archs;
 		$count_packs++;
+		if(defined($packOptions->{'version'})) {
+			$packOptions->{'requireVersion'}->{ $packOptions->{'version'} } = 1;
+		}       
 		if ( $mode == 2 ) {
 			# use src or nosrc only for this package
 			push @archs, $packOptions->{'arch'};
@@ -1003,7 +1006,9 @@ sub setupPackageFiles
 					     && ! defined( $packOptions->{requireVersion}->
 							   {$packPointer->{version}
 							    . "-"
-								. $packPointer->{release}} ) )
+								. $packPointer->{release}} ) 
+                         && ! defined( $packOptions->{requireVersion}->
+                               {$packPointer->{version}} ) )
 					{
 						if ($this->{m_debug} >= 4) {
 							my $msg = "	    => package "
@@ -1731,19 +1736,15 @@ sub lookUpAllPackages
 					# needs to be a string or sort breaks later
 					$package->{'priority'} = "$this->{m_repos}->{$r}->{priority}";
 
-					# We can have a package only once per architecture and in
-					# one repo
-					my $repokey = $r."@".$arch;
-					# BUT src, nosrc and debug packages need to be available
-					# in all versions.
-					if ( !$flags{'SOURCERPM'} || $name =~ /-debugsource$/
-					     || $name =~ /-debuginfo$/ )
-					{
-						$repokey .= "@"
-						    . $package->{'version'}
-						. "@"
-						    . $package->{'release'};
-					}
+					# If we have more than one version of the package per architecture and in
+					# one repo, pick the version specified (if specified).
+					my $repokey = $r."@"
+									.$arch
+									."@"
+									.$package->{'version'}
+									."@"
+									.$package->{'release'};
+
 					if ( $packPool->{$name}->{$repokey} ) {
 						# we have it already from a more important repo.
 						next;
diff -Nrup a/modules/KIWISchema.rnc b/modules/KIWISchema.rnc
--- a/modules/KIWISchema.rnc	2012-03-02 16:26:37.000000000 +0100
+++ b/modules/KIWISchema.rnc	2012-04-26 15:25:15.758758409 +0200
@@ -600,6 +600,10 @@ div {
 		## Specifies that the package with
 		## the given arch should be used in any case
 		attribute onlyarch { text }
+	k.repopackage.version.attribute =
+		## Specifies that the package with
+		## the given version-release should be used
+		attribute version { text }
 	k.repopackage.medium.attribute =
 		## Specifies that the package will be put
 		## to the specific medium number (CD1, DVD7, ...)
@@ -613,6 +617,7 @@ div {
 		k.repopackage.addarch.attribute? &
 		k.repopackage.removearch.attribute? &
 		k.repopackage.onlyarch.attribute? &
+		k.repopackage.version.attribute? &
 		k.repopackage.source.attribute? &
 		k.repopackage.script.attribute? &
 		k.repopackage.medium.attribute?
diff -Nrup a/modules/KIWIXML.pm b/modules/KIWIXML.pm
--- a/modules/KIWIXML.pm	2012-03-02 16:26:37.000000000 +0100
+++ b/modules/KIWIXML.pm	2012-04-26 15:25:15.759758448 +0200
@@ -3174,7 +3174,7 @@ sub getInstSourcePackageAttributes {
 	my %result;
 	my @attrib = (
 		"forcerepo" ,"addarch", "removearch", "arch",
-		"onlyarch", "source", "script", "medium"
+		"onlyarch", "version", "source", "script", "medium"
 	);
 	if(not defined($this->{m_rpacks})) {
 		my @nodes = ();