From 38c3db7193d1309664aa4fd11212072ea1528df9 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Fri, 5 Feb 2021 23:23:06 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/apache-commons-io.git#ecb0785573de676a72bd3cfe70466e05135f46d8 --- ...ailing-when-symlink-target-is-non-ex.patch | 25 +++++++++++++++++++ apache-commons-io.spec | 8 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-Files.size-failing-when-symlink-target-is-non-ex.patch diff --git a/0001-Fix-Files.size-failing-when-symlink-target-is-non-ex.patch b/0001-Fix-Files.size-failing-when-symlink-target-is-non-ex.patch new file mode 100644 index 0000000..336e7b5 --- /dev/null +++ b/0001-Fix-Files.size-failing-when-symlink-target-is-non-ex.patch @@ -0,0 +1,25 @@ +From 610065347bbbc8fea366de32e558de4977807e52 Mon Sep 17 00:00:00 2001 +From: Mat Booth +Date: Wed, 3 Feb 2021 19:45:13 +0000 +Subject: [PATCH] Fix Files.size failing when symlink target is non-existant + +--- + src/main/java/org/apache/commons/io/file/PathUtils.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java b/src/main/java/org/apache/commons/io/file/PathUtils.java +index d370ef0b..b38a46a0 100644 +--- a/src/main/java/org/apache/commons/io/file/PathUtils.java ++++ b/src/main/java/org/apache/commons/io/file/PathUtils.java +@@ -358,7 +358,7 @@ public static PathCounters deleteFile(final Path file, final DeleteOption... opt + } + final PathCounters pathCounts = Counters.longPathCounters(); + final boolean exists = Files.exists(file, LinkOption.NOFOLLOW_LINKS); +- final long size = exists ? Files.size(file) : 0; ++ final long size = exists && Files.exists(file) ? Files.size(file) : 0; + if (overrideReadOnly(options) && exists) { + setReadOnly(file, false, LinkOption.NOFOLLOW_LINKS); + } +-- +2.28.0 + diff --git a/apache-commons-io.spec b/apache-commons-io.spec index 81e4f24..390bebc 100644 --- a/apache-commons-io.spec +++ b/apache-commons-io.spec @@ -6,13 +6,15 @@ Name: apache-commons-io Epoch: 1 Version: 2.8.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Utilities to assist with developing IO functionality License: ASL 2.0 URL: https://commons.apache.org/io Source0: https://archive.apache.org/dist/commons/io/source/%{srcname}-%{version}-src.tar.gz +Patch0: 0001-Fix-Files.size-failing-when-symlink-target-is-non-ex.patch + BuildArch: noarch BuildRequires: maven-local @@ -41,6 +43,7 @@ API documentation for %{name}. %prep %setup -q -n %{srcname}-%{version}-src +%patch0 -p1 sed -i 's/\r//' *.txt %if %{with tests} @@ -79,6 +82,9 @@ rm src/test/java/org/apache/commons/io/output/XmlStreamWriterTest.java %changelog +* Wed Feb 3 2021 Mat Booth - 1:2.8.0-3 +- Add patch to fix Files.size() failing when symlink target is non-existant + * Tue Jan 26 2021 Fedora Release Engineering - 1:2.8.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild