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
This commit is contained in:
DistroBaker 2021-02-05 23:23:06 +00:00
parent 5da3b9853f
commit 38c3db7193
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 610065347bbbc8fea366de32e558de4977807e52 Mon Sep 17 00:00:00 2001
From: Mat Booth <mat.booth@redhat.com>
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

View File

@ -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 <mat.booth@redhat.com> - 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 <releng@fedoraproject.org> - 1:2.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild