Add patch to fix Files.size() failing when symlink target is non-existant
This commit is contained in:
parent
017413bf40
commit
d754d042bd
@ -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
|
||||||
|
|
@ -6,13 +6,15 @@
|
|||||||
Name: apache-commons-io
|
Name: apache-commons-io
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 2.8.0
|
Version: 2.8.0
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: Utilities to assist with developing IO functionality
|
Summary: Utilities to assist with developing IO functionality
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
|
|
||||||
URL: https://commons.apache.org/io
|
URL: https://commons.apache.org/io
|
||||||
Source0: https://archive.apache.org/dist/commons/io/source/%{srcname}-%{version}-src.tar.gz
|
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
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: maven-local
|
BuildRequires: maven-local
|
||||||
@ -41,6 +43,7 @@ API documentation for %{name}.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{srcname}-%{version}-src
|
%setup -q -n %{srcname}-%{version}-src
|
||||||
|
%patch0 -p1
|
||||||
sed -i 's/\r//' *.txt
|
sed -i 's/\r//' *.txt
|
||||||
|
|
||||||
%if %{with tests}
|
%if %{with tests}
|
||||||
@ -79,6 +82,9 @@ rm src/test/java/org/apache/commons/io/output/XmlStreamWriterTest.java
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%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
|
* 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
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user