Resolves: #2058686 - make `df --direct` work again

This commit is contained in:
Kamil Dudka 2022-03-01 10:25:55 +01:00
parent d00a2dffe1
commit c25beef1ca
2 changed files with 12 additions and 11 deletions

View File

@ -5,16 +5,16 @@ Subject: [PATCH] coreutils-df-direct.patch
---
doc/coreutils.texi | 7 ++++++
src/df.c | 36 ++++++++++++++++++++++++++++--
src/df.c | 34 ++++++++++++++++++++++++++--
tests/df/direct.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 96 insertions(+), 2 deletions(-)
3 files changed, 94 insertions(+), 2 deletions(-)
create mode 100755 tests/df/direct.sh
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 5b9a597..6810c15 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12067,6 +12067,13 @@ some systems (notably Solaris), doing this yields more up to date results,
@@ -12074,6 +12074,13 @@ some systems (notably Solaris), doing this yields more up to date results,
but in general this option makes @command{df} much slower, especially when
there are many or very busy file systems.
@ -71,7 +71,7 @@ index 48025b9..c8efa5b 100644
if (columns[col]->field == SIZE_FIELD
&& (header_mode == DEFAULT_MODE
@@ -1486,6 +1494,19 @@ get_point (char const *point, const struct stat *statp)
@@ -1486,6 +1494,17 @@ get_point (char const *point, const struct stat *statp)
static void
get_entry (char const *name, struct stat const *statp)
{
@ -80,9 +80,7 @@ index 48025b9..c8efa5b 100644
+ char *resolved = canonicalize_file_name (name);
+ if (resolved)
+ {
+ char *mp = find_mount_point (name, statp);
+ get_dev (NULL, mp, resolved, NULL, NULL, false, false, NULL, false);
+ free(mp);
+ get_dev (NULL, resolved, name, NULL, NULL, false, false, NULL, false);
+ free (resolved);
+ return;
+ }
@ -91,7 +89,7 @@ index 48025b9..c8efa5b 100644
if ((S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
&& get_device (name))
return;
@@ -1556,6 +1577,7 @@ or all file systems by default.\n\
@@ -1556,6 +1575,7 @@ or all file systems by default.\n\
-B, --block-size=SIZE scale sizes by SIZE before printing them; e.g.,\n\
'-BM' prints sizes in units of 1,048,576 bytes;\n\
see SIZE format below\n\
@ -99,7 +97,7 @@ index 48025b9..c8efa5b 100644
-h, --human-readable print sizes in powers of 1024 (e.g., 1023M)\n\
-H, --si print sizes in powers of 1000 (e.g., 1.1G)\n\
"), stdout);
@@ -1646,6 +1668,9 @@ main (int argc, char **argv)
@@ -1646,6 +1666,9 @@ main (int argc, char **argv)
xstrtol_fatal (e, oi, c, long_options, optarg);
}
break;
@ -109,7 +107,7 @@ index 48025b9..c8efa5b 100644
case 'i':
if (header_mode == OUTPUT_MODE)
{
@@ -1742,6 +1767,13 @@ main (int argc, char **argv)
@@ -1742,6 +1765,13 @@ main (int argc, char **argv)
}
}

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 9.0
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv3+
Url: https://www.gnu.org/software/coreutils/
Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
@ -266,6 +266,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir
%license COPYING
%changelog
* Tue Mar 01 2022 Kamil Dudka <kdudka@redhat.com> - 9.0-4
- make `df --direct` work again (#2058686)
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild