Don't try to relativize symlink targets

This commit is contained in:
Mikolaj Izdebski 2013-09-23 17:09:40 +02:00
parent 2af3fb268c
commit 38ca401b57
2 changed files with 35 additions and 4 deletions

View File

@ -0,0 +1,26 @@
From 51259942aacc2a3b02564ae43dfabebb98aebf58 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Mon, 23 Sep 2013 14:38:34 +0200
Subject: [PATCH] Don't try to relativize symlink targets
---
.../src/main/java/org/fedoraproject/maven/installer/impl/Package.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/Package.java b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/Package.java
index 95faa06..1ab04b6 100644
--- a/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/Package.java
+++ b/xmvn-core/src/main/java/org/fedoraproject/maven/installer/impl/Package.java
@@ -89,8 +89,7 @@ class Package
public void addSymlink( Path symlink, Path target )
throws IOException
{
- Path symlinkTarget = symlink.getParent().relativize( target );
- Path symlinkFile = FileUtils.createAnonymousSymlink( symlinkTarget );
+ Path symlinkFile = FileUtils.createAnonymousSymlink( target );
addFile( symlinkFile, symlink, 0644 );
}
--
1.8.1.4

View File

@ -1,11 +1,12 @@
Name: xmvn
Version: 1.0.2
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Local Extensions for Apache Maven
License: ASL 2.0
URL: http://mizdebsk.fedorapeople.org/xmvn
BuildArch: noarch
Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.xz
Patch0: 0001-Don-t-try-to-relativize-symlink-targets.patch
BuildRequires: maven >= 3.1.0
BuildRequires: maven-local
@ -32,6 +33,7 @@ This package provides %{summary}.
%prep
%setup -q
%patch0 -p1
# Add cglib test dependency as a workaround for rhbz#911365
#pom_add_dep cglib:cglib::test %{name}-core
@ -53,7 +55,6 @@ ln -s %{_datadir}/maven target/dependency/apache-maven-$mver
rm -rf src/it
%build
%mvn_file ":{xmvn-{core,connector}}" %{name}/@1 ../%{name}/lib/@1
%mvn_build -X
tar --delay-directory-restore -xvf target/*tar.bz2
@ -63,6 +64,7 @@ chmod -R +rwX %{name}-%{version}*
%install
%mvn_install
install -d -m 755 %{buildroot}%{_datadir}/%{name}
cp -r %{name}-%{version}*/* %{buildroot}%{_datadir}/%{name}/
ln -sf %{_datadir}/maven/bin/mvn %{buildroot}%{_datadir}/%{name}/bin/mvn
ln -sf %{_datadir}/maven/bin/mvnDebug %{buildroot}%{_datadir}/%{name}/bin/mvnDebug
@ -90,11 +92,11 @@ done
# copy over maven lib directory
cp -r %{_datadir}/maven/lib/* %{buildroot}%{_datadir}/%{name}/lib/
# possibly recreate symlinks that can be automated with xmvn-subst
%{name}-subst %{buildroot}%{_datadir}/%{name}/
for jar in core connector;do
ln -sf %{_javadir}/%{name}/%{name}-$jar.jar %{buildroot}%{_datadir}/%{name}/lib
done
# possibly recreate symlinks that can be automated with xmvn-subst
%{name}-subst %{buildroot}%{_datadir}/%{name}/
for tool in subst resolver bisect installer;do
# sisu doesn't contain pom.properties. Manually replace with symlinks
@ -141,6 +143,9 @@ end
%doc LICENSE NOTICE
%changelog
* Mon Sep 23 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.0.2-2
- Don't try to relativize symlink targets
* Fri Sep 20 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.0.2-1
- Update to upstream version 1.0.2