Add patch to fix __default behavior

This commit is contained in:
Stanislav Ochotnicky 2013-09-30 11:39:57 +02:00
parent e89e332c70
commit 0a729ae83a
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,54 @@
From 0a89668a07d873d1942f702a595f438025d526fd Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 30 Sep 2013 11:05:41 +0200
Subject: [PATCH] Don't assume package has a single name
One package can have different names, for example "" and "__default".
---
.../maven/installer/impl/DefaultInstaller.java | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java
index a3e9f9b..9472c08 100644
--- a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java
+++ b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/DefaultInstaller.java
@@ -97,7 +97,7 @@ public class DefaultInstaller
private Configuration configuration;
- private Map<String, Package> packages;
+ private Map<Package, Package> packages;
private PackagingRule ruleForArtifact( Artifact artifact )
{
@@ -134,13 +134,12 @@ public class DefaultInstaller
String packageName = rule.getTargetPackage();
if ( StringUtils.isEmpty( packageName ) )
packageName = Package.MAIN;
- Package pkg = packages.get( packageName );
- if ( pkg == null )
- {
- pkg = new Package( packageName, settings, logger );
- packages.put( packageName, pkg );
- }
+ Package pkg = new Package( packageName, settings, logger );
+ if ( packages.containsKey( pkg ) )
+ pkg = packages.get( pkg );
+ else
+ packages.put( pkg, pkg );
if ( logger.isDebugEnabled() )
{
@@ -464,7 +463,7 @@ public class DefaultInstaller
packages = new TreeMap<>();
Package mainPackage = new Package( Package.MAIN, settings, logger );
- packages.put( Package.MAIN, mainPackage );
+ packages.put( mainPackage, mainPackage );
Set<Artifact> artifactSet = request.getArtifacts();
--
1.8.3.1

View File

@ -10,6 +10,7 @@ Patch0: 0001-Don-t-try-to-relativize-symlink-targets.patch
Patch1: 0002-Try-to-resolve-cannonical-artifact-files.patch
Patch2: 0003-Restotre-support-for-relative-symlinks.patch
Patch3: 0004-Add-special-value-__default-to-install-artifact-to-d.patch
Patch4: 0005-Don-t-assume-package-has-a-single-name.patch
BuildRequires: maven >= 3.1.0
BuildRequires: maven-local
@ -40,6 +41,7 @@ This package provides %{summary}.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1 -F2
# remove dependency plugin maven-binaries execution
# we provide apache-maven by symlink