From ba228278eb40ddc90c67486bf6722786a89e502d Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Tue, 31 Mar 2015 13:35:02 +0200 Subject: [PATCH] Don't use NioFiles.copy as it doesn't follow symlinks --- 0001-Don-t-use-NioFiles.copy.patch | 38 ++++++++++++++++++++++++++++++ plexus-utils.spec | 15 ++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 0001-Don-t-use-NioFiles.copy.patch diff --git a/0001-Don-t-use-NioFiles.copy.patch b/0001-Don-t-use-NioFiles.copy.patch new file mode 100644 index 0000000..bd9a531 --- /dev/null +++ b/0001-Don-t-use-NioFiles.copy.patch @@ -0,0 +1,38 @@ +From f9d81b7f32f11c2446e6392c09e2655e803a758a Mon Sep 17 00:00:00 2001 +From: Michael Simacek +Date: Mon, 30 Mar 2015 17:10:07 +0200 +Subject: [PATCH] Don't use NioFiles.copy + +--- + src/main/java/org/codehaus/plexus/util/FileUtils.java | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/main/java/org/codehaus/plexus/util/FileUtils.java b/src/main/java/org/codehaus/plexus/util/FileUtils.java +index 3a036a7..8f05b76 100644 +--- a/src/main/java/org/codehaus/plexus/util/FileUtils.java ++++ b/src/main/java/org/codehaus/plexus/util/FileUtils.java +@@ -1081,14 +1081,14 @@ public static void copyFile( final File source, final File destination ) + return; + } + mkdirsFor( destination ); +- if (Java7Detector.isJava7()) +- { +- NioFiles.copy( source, destination ); +- } +- else +- { ++ // if (Java7Detector.isJava7()) ++ // { ++ // NioFiles.copy( source, destination ); ++ // } ++ // else ++ // { + doCopyFile( source, destination ); +- } ++ // } + + if ( source.length() != destination.length() ) + { +-- +2.1.0 + diff --git a/plexus-utils.spec b/plexus-utils.spec index 92f9996..3ac3c3e 100644 --- a/plexus-utils.spec +++ b/plexus-utils.spec @@ -3,7 +3,7 @@ Name: plexus-utils Version: 3.0.21 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Plexus Common Utilities # ASL 1.1: several files in src/main/java/org/codehaus/plexus/util/ # xpp: src/main/java/org/codehaus/plexus/util/xml/pull directory @@ -15,9 +15,14 @@ Summary: Plexus Common Utilities # rest is ASL 2.0 License: ASL 1.1 and ASL 2.0 and xpp and BSD and Public Domain URL: http://plexus.codehaus.org/ +BuildArch: noarch + Source0: https://github.com/sonatype/%{name}/archive/%{name}-%{version}.tar.gz Source1: http://apache.org/licenses/LICENSE-2.0.txt -BuildArch: noarch + +# https://github.com/sonatype/plexus-utils/issues/18 +# patch not submitted as it's just a workaround +Patch0: 0001-Don-t-use-NioFiles.copy.patch BuildRequires: maven-local BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) @@ -38,8 +43,11 @@ Javadoc for %{name}. %prep %setup -q -n %{name}-%{name}-%{version} + cp %{SOURCE1} . +%patch0 -p1 + %mvn_file : plexus/utils %mvn_alias : plexus:plexus-utils @@ -71,6 +79,9 @@ cp %{SOURCE1} . %doc NOTICE.txt LICENSE-2.0.txt %changelog +* Mon Mar 30 2015 Michael Simacek - 3.0.21-2 +- Don't use NioFiles.copy as it doesn't follow symlinks + * Tue Mar 24 2015 Michael Simacek - 3.0.21-1 - Update to upstream version 3.0.21