Compare commits

...

96 Commits

Author SHA1 Message Date
Fedora Release Engineering 20cfbf3b45 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 03:10:43 +00:00
Kamil Dudka 3dff09407f new upstream release: findutils-4.9.0 2022-02-02 10:10:54 +01:00
Kamil Dudka 7222ae6493 make findutils build on 32bit x86 2022-01-24 10:33:46 +01:00
Fedora Release Engineering 946c1c1661 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 03:00:33 +00:00
Fedora Release Engineering ed583e8432 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 22:58:14 +00:00
Florian Weimer d0d0ad8de2 Rebuild with new binutils to fix ppc64le corruption (#1960730) 2021-05-25 12:15:29 +02:00
Fedora Release Engineering dbab70c6ed - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 05:32:53 +00:00
Robert Scheck 3ffc0bb1f8 Minor spec file optimizations 2021-01-13 01:44:43 +00:00
Kamil Dudka 7e3826d7ba new upstream release: findutils-4.8.0 2021-01-09 21:14:58 +01:00
Kamil Dudka 710681d5bd findutils.spec: keep BR list alphabetically sorted 2021-01-07 09:01:02 +01:00
Tom Stellard 7f5e33c6f3 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2020-12-18 22:38:22 +00:00
Fedora Release Engineering 253ce30f09 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 17:27:38 +00:00
Kamil Dudka 4194724211 replace weirdo constant in gnulib tests
... causing test failures on armv7hl
2020-07-24 18:54:53 +02:00
Kamil Dudka 8de28b81ab Related: #1789115 - disable -flto on ppc64le to make test-float pass 2020-07-24 18:51:12 +02:00
Kamil Dudka eebaae56fd Related: #1294016 - do not compile with -D__SUPPORT_SNAN__
It seems to break test-isinf on ppc64le this time.
2020-07-24 18:48:09 +02:00
Kamil Dudka b0ca54752d make the output of %check more verbose
... and colorful again in case a tty is attached
2020-07-24 18:44:16 +02:00
Kamil Dudka a8811e0706 make the output of %check human-readable again 2020-07-23 17:16:03 +02:00
Tom Stellard 024138372e Use make macros
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
2020-07-13 19:30:56 +00:00
Kamil Dudka d84db4f672 Resolves: #1823247 simplify leaf optimization for XFS 2020-04-17 18:25:31 +02:00
Kamil Dudka 9f5b30bd11 Resolves: #1799064 - make upstream test-suite work with root privileges 2020-02-11 10:31:17 +01:00
Fedora Release Engineering 15101dc4a6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 18:30:27 +00:00
Kamil Dudka 497096c6ae new upstream release: findutils-4.7.0 2019-08-30 12:28:32 +02:00
Fedora Release Engineering 41d9918095 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 00:34:57 +00:00
Björn Esser b1143c39d1
Remove hardcoded gzip suffix from GNU info pages 2019-04-24 14:56:31 +02:00
Fedora Release Engineering 288dd79a90 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 19:43:22 +00:00
Igor Gnatenko b3b4a0b27b Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:02 +01:00
Igor Gnatenko 1b7cb86fdf
Remove obsolete scriptlets
References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-27 15:30:28 +01:00
Kamil Dudka a6f38a9e3d fix programming mistakes detected by static analysis 2018-11-05 15:13:31 +01:00
Fedora Release Engineering 97ba2d7a18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 00:34:32 +00:00
Kamil Dudka f41447a0f4 Resolves: #1558249 - fix crash caused by mistakenly enabled leaf optimization 2018-04-20 16:52:25 +02:00
Kamil Dudka 99e4b132c2 fix build failure with glibc-2.25+
../../../gl/lib/mountlist.c: In function 'read_file_system_list':
../../../gl/lib/mountlist.c:532:26: warning: implicit declaration of function 'makedev' [-Wimplicit-function-declaration]
             me->me_dev = makedev (devmaj, devmin);
                          ^~~~~~~
[...]
gcc  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -D__SUPPORT_SNAN__  -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o find ftsfind.o ./libfindtools.a ../lib/libfind.a ../gl/lib/libgnulib.a    -lselinux   -lm -lm
../gl/lib/libgnulib.a(mountlist.o): In function `read_file_system_list':
/home/kdudka/fedora/findutils/findutils-4.6.0/build/gl/lib/../../../gl/lib/mountlist.c:532: undefined reference to `makedev'
collect2: error: ld returned 1 exit status
2018-03-06 12:32:24 +01:00
Kamil Dudka 048e4fadab fix build failure with glibc-2.28
Reported at:
https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html

freadahead.c: In function ‘freadahead’:
freadahead.c:97:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
  #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
   ^~~~~
2018-03-06 12:10:54 +01:00
Kamil Dudka 74060ab73f add explicit BR for the gcc compiler
... as instructed at:

https://fedoraproject.org/wiki/Packaging:C_and_C%2B%2B
2018-02-19 16:35:02 +01:00
Kamil Dudka 7c9da61ea1 Resolves: #1544429 - import gnulib's FTS module from upstream commit 281b825e 2018-02-12 19:03:12 +01:00
Fedora Release Engineering c3e43d3d18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 09:40:10 +00:00
Serhii Turivny 8cb9e21ac6 Add CI tests using the standard test interface 2017-10-19 11:08:24 +03:00
Fedora Release Engineering 4153c6a0f0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-02 20:35:02 +00:00
Fedora Release Engineering 906b1d5b39 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 08:23:38 +00:00
Kamil Dudka 339b378e9b Related: #1417753 - drop ppc64le workaround no longer needed 2017-03-02 09:59:17 +01:00
Fedora Release Engineering 43252cb2c9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 09:46:49 +00:00
Kamil Dudka 500388ce60 Related: #1417753 - avoid using broken memcmp() code that gcc generates on ppc64le 2017-01-30 22:59:56 +01:00
Kamil Dudka ae38feed7f add explicit BR for git as we use it in %prep 2017-01-27 11:52:13 +01:00
Kamil Dudka 99ccd52a95 test-lock: disable the rwlock test 2017-01-27 11:47:11 +01:00
Kamil Dudka 662a63d728 Resolves: #1299169 - disable leaf optimization for NFS 2016-09-16 09:25:23 +02:00
Kamil Dudka 9d8af62bd8 findutils.spec: remove non-existing option of %autopatch 2016-06-24 13:29:46 +02:00
Kamil Dudka d84a1a5914 bump release to preserve upgrade path f24 -> f25 2016-06-24 13:27:14 +02:00
Kamil Dudka 4a1c687291 findutils.spec: apply patches after cleanup in git 2016-06-24 13:19:07 +02:00
Kamil Dudka 0f2255e7b1 findutils.spec: use %autosetup to create a git repo in %prep 2016-06-17 15:02:24 +02:00
Kamil Dudka c7699fb1ac findutils.spec: use out of source build 2016-06-17 14:58:24 +02:00
Kamil Dudka 3616c1547d Resolves: #1346471 - avoid SIGSEGV in case the internal -noop option is used 2016-06-17 14:19:47 +02:00
Kamil Dudka 70d8bf926d run the test-suite in parallel in %check 2016-05-31 14:25:03 +02:00
Kamil Dudka 7be3ecab61 make sure that find -exec + passes all arguments (upstream bug #48030) 2016-05-31 14:22:27 +02:00
Kamil Dudka cbc6933054 Resolves: #1325049 - clarify exit status handling
... of -exec cmd {} + in find(1) man page
2016-04-18 17:53:32 +02:00
Dennis Gilmore 300d2a2bec - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-03 20:30:51 +00:00
Kamil Dudka 3f5b9b5d26 Related: #1294016 - prevent mbrtowc tests from failing 2016-01-06 14:21:29 +01:00
Kamil Dudka 3d8270f934 Resolves: #1294016 - prevent test-isinf from failing with gcc-5.3.1 on ppc64le 2016-01-06 14:08:28 +01:00
Kamil Dudka 73a88e7f27 new upstream release: findutils-4.6.0
- drop oldfind(1) no longer supported by upstream
2015-12-29 00:39:39 +01:00
Kamil Dudka 627c12645a new upstream release: findutils-4.5.16 2015-12-25 12:48:40 +01:00
Kamil Dudka e81850d3c1 Resolves: #1252549 - enable leaf optimization for XFS and NFS 2015-12-21 18:58:15 +01:00
Kamil Dudka c6a050e8ae findutils-4.5.15-no-locate.patch: fix typo in name 2015-12-21 18:55:40 +01:00
Kamil Dudka 968ba6867d new upstream release: findutils-4.5.15 2015-12-19 23:00:59 +01:00
Kamil Dudka 129629fda7 Resolves: #1239501 - make the test-suite ready for Perl 5.22 2015-07-07 10:38:22 +02:00
Dennis Gilmore 3c9fbaaa7f - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-17 06:20:02 +00:00
Jaromir Capik 615676bd6d Adding STAGE1 bootstrap recipe 2015-06-11 15:33:39 +02:00
Kamil Dudka 3c9d6c2bf3 make the test-suite ready for Python 3 2015-03-18 17:10:12 +01:00
Till Maas c02d7f6ff2 Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
2015-02-21 22:24:49 +01:00
Kamil Dudka d0e916c699 Resolve: #1188498 - fix a crash triggered by recursive bind mount 2015-02-16 14:29:17 +01:00
Peter Robinson a37bc7851d - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-16 12:26:14 +00:00
Kamil Dudka 9292a1d5a7 new upstream release: findutils-4.5.14 2014-07-21 10:25:04 +02:00
Kamil Dudka 412732ac50 new upstream release: findutils-4.5.13 2014-07-16 12:19:32 +02:00
Kamil Dudka cbeabfaa1e remove left over files from the repository 2014-07-16 12:18:27 +02:00
Tom Callaway 28c38b5cb0 fix license handling 2014-07-12 10:50:05 -04:00
Dennis Gilmore 02f9206900 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 07:07:19 -05:00
Kamil Dudka 59f959cc29 Resolves: #1083145 - eliminate failure of gnulib tests on little-endian PowerPC 2014-06-02 13:07:22 +02:00
Kamil Dudka 24abf73cbf fix typos and formatting of the last changelog entry 2014-06-02 13:01:52 +02:00
Peter Robinson 34282b0850 Drop ChangeLog the NEWS file contains details back to 1993 to satify even the most bored sysadmin 2014-05-31 23:13:29 +01:00
Kamil Dudka 0fb0b5c269 silence GCC warnings 2013-09-23 15:12:08 +02:00
Kamil Dudka 1c07ba6f13 new upstream release: findutils-4.5.12 2013-09-23 13:56:28 +02:00
Dennis Gilmore f76086b2b7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild 2013-08-03 06:16:15 -05:00
Kamil Dudka 893fbf4cd8 remove findutils-4.4.2-autofs.patch no longer needed
/etc/mtab is now symlink to /proc/mounts so it does not make sense
to process them separately
2013-07-10 14:36:36 +02:00
Kamil Dudka 99e476cf71 remove support for obsolete -perm +MODE syntax (#982503) 2013-07-09 11:27:18 +02:00
Kamil Dudka 2e3e66c981 new upstream release: findutils-4.5.11 2013-02-03 21:03:52 +01:00
Kamil Dudka 7590b65979 do not require gets() to be declared 2012-08-28 17:26:13 +02:00
Kamil Dudka 23afa40d98 do not use the AM_C_PROTOTYPES macro (removed in Automake 1.12) 2012-08-28 16:58:05 +02:00
Kamil Dudka 623e030f29 fix specfile issues reported by the fedora-review script 2012-08-28 16:31:32 +02:00
Dennis Gilmore 85114f5954 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild 2012-07-18 21:23:11 -05:00
Kamil Dudka b1cb7bb680 add virtual provides for bundled(gnulib) copylib (#821753) 2012-05-16 12:26:51 +02:00
Harald Hoyer 22b8a9f139 add filesystem guard 2012-01-25 21:11:25 +01:00
Harald Hoyer 72a0b8bef4 install everything in /usr
This patch is needed for the /usr-move feature
https://fedoraproject.org/wiki/Features/UsrMove

This package requires now 'filesystem' >= 3, which is only installable
on a system which has /bin, /sbin, /lib, /lib64 as symlinks to /usr and
not regular directories. The 'filesystem' package acts as a guard, to
prevent *this* package to be installed on old unconverted systems.

New installations will have the 'filesystem' >=3 layout right away, old
installations need to be converted with anaconda or dracut first; only
after that, the 'filesystem' package, and also *this* package can be
installed.

Packages *should* not install files in /bin, /sbin, /lib, /lib64, but
only in the corresponding directories in /usr. Packages *must* not
install conflicting files with the same names in the corresponding
directories in / and /usr. Especially compatibilty symlinks must not be
installed.

Feel free to modify any of the changes to the spec file, but keep the
above in mind.
2012-01-25 14:09:06 +01:00
Dennis Gilmore 0e6c05e9eb - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 2012-01-12 20:26:06 -06:00
Kamil Dudka ee3f03dfd5 new upstream release: findutils-4.5.10 2011-05-11 16:52:18 +02:00
Dennis Gilmore e41051998e - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2011-02-08 14:10:23 -06:00
Fedora Release Engineering 00c852d0f2 dist-git conversion 2010-07-28 14:26:37 +00:00
Kamil Dudka 64e03b7b07 - fix some bugs in handling of -execdir (Savannah bug #29949) 2010-05-24 15:38:38 +00:00
Kamil Dudka 0e7d687ea7 update some patches 2010-05-10 16:48:39 +00:00
Kamil Dudka 6dba51f96d - new upstream release, dropped applied patches 2010-05-05 11:38:25 +00:00
25 changed files with 1018 additions and 1023 deletions

View File

@ -1 +0,0 @@
findutils-4.5.7.tar.gz

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/findutils-4.*.*.tar.?z

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: findutils
# $Id: Makefile,v 1.2 2007/10/15 18:45:12 notting Exp $
NAME := findutils
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

9
STAGE1-findutils Normal file
View File

@ -0,0 +1,9 @@
srpm $1
mcd $BUILDDIR/$1
sed -i~ -e "s,locate/Makefile locate/testsuite/Makefile ,," $SRC/${1}-*/configure
FINDLIBS="-lselinux -ldl" $SRC/${1}-*/configure $TCONFIGARGS
sed -i~ -e "s/ locate / /" Makefile
notparallel
test -d tools/gnulib/lib && make $J V=1 -C tools/gnulib/lib
make $J V=1
make $J install DESTDIR=${ROOTFS}

View File

@ -1,90 +0,0 @@
diff --git a/Makefile.am b/Makefile.am
index c7f8f39..0dacb93 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@ DISTCLEANFILES = tool-versions.txt
# "tests" is the gnulib unit test dir.
-SUBDIRS = gnulib tests build-aux lib find xargs locate doc po m4
+SUBDIRS = gnulib tests build-aux lib find xargs doc po m4
ACLOCAL_AMFLAGS = -I gnulib/m4 -I m4
diff --git a/doc/find.texi b/doc/find.texi
index d719ccb..b509f66 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -7,7 +7,6 @@
@c %**end of header
@include version.texi
-@include ../locate/dblocation.texi
@iftex
@finalout
@@ -570,8 +569,7 @@ the databases are updated, and the directories for which they contain
entries.
Here is how to select which file name databases @code{locate}
-searches. The default is system-dependent. At the time this document
-was generated, the default was @file{@value{LOCATE_DB}}.
+searches. The default is system-dependent.
@table @code
@item --database=@var{path}
@@ -2728,13 +2726,9 @@ thrashing the network.
directories are indexed by each database file.
The default location for the locate database depends on how findutils
-is built, but the findutils installation accompanying this manual uses
-the default location @file{@value{LOCATE_DB}}.
-
-If no database exists at @file{@value{LOCATE_DB}} but the user did not
-specify where to look (by using @samp{-d} or setting
-@code{LOCATE_PATH}), then @code{locate} will also check for a
-``secure'' database in @file{/var/lib/slocate/slocate.db}.
+is built. If user did not specify where to look (by using @samp{-d}
+or setting @code{LOCATE_PATH}), then @code{locate} will also check for
+a ``secure'' database in @file{/var/lib/slocate/slocate.db}.
@node Database Formats
@section Database Formats
@@ -3213,8 +3207,7 @@ present.
@item --database=@var{path}
@itemx -d @var{path}
-Instead of searching the default @code{locate} database
-@file{@value{LOCATE_DB}}, @code{locate} searches the file
+@code{locate} searches the file
name databases in @var{path}, which is a colon-separated list of
database file names. You can also use the environment variable
@code{LOCATE_PATH} to set the list of database files to search. The
@@ -3399,8 +3392,7 @@ The environment variable @code{PRUNEFS} also sets this value. Default
is @file{nfs NFS proc}.
@item --output=@var{dbfile}
-The database file to build. The default is system-dependent, but
-when this document was formatted it was @file{@value{LOCATE_DB}}.
+The database file to build.
@item --localuser=@var{user}
The user to search the non-network directories as, using @code{su}.
@@ -5359,7 +5351,7 @@ See the description of the similar message for @code{find}.
@section Error Messages From @code{locate}
@table @samp
-@item warning: database @file{@value{LOCATE_DB}} is more than 8 days old
+@item warning: database @file{LOCATE_DB} is more than 8 days old
The @code{locate} program relies on a database which is periodically
built by the @code{updatedb} program. That hasn't happened in a long
time. To fix this problem, run @code{updatedb} manually. This can
@@ -5367,7 +5359,7 @@ often happen on systems that are generally not left on, so the
periodic ``cron'' task which normally does this doesn't get a chance
to run.
-@item locate database @file{@value{LOCATE_DB}} is corrupt or invalid
+@item locate database @file{LOCATE_DB} is corrupt or invalid
This should not happen. Re-run @code{updatedb}. If that works, but
@code{locate} still produces this error, run @code{locate --version}
and @code{updatedb --version}. These should produce the same output.

View File

@ -1,88 +0,0 @@
diff --git a/find/fstype.c b/find/fstype.c
index 21c446b..502e208 100644
--- a/find/fstype.c
+++ b/find/fstype.c
@@ -205,7 +205,72 @@ must_read_fs_list (bool need_fs_type)
return entries;
}
+/* Return the device number from MOUNT_OPTIONS, if possible.
+ Otherwise return (dev_t) -1. Taken from 'mountlist' module
+ from gnulib. */
+static dev_t
+dev_from_mount_options (char const *mount_options)
+{
+ /* GNU/Linux allows file system implementations to define their own
+ meaning for "dev=" mount options, so don't trust the meaning
+ here. */
+# ifndef __linux__
+
+ static char const dev_pattern[] = ",dev=";
+ char const *devopt = strstr (mount_options, dev_pattern);
+
+ if (devopt)
+ {
+ char const *optval = devopt + sizeof dev_pattern - 1;
+ char *optvalend;
+ unsigned long int dev;
+ errno = 0;
+ dev = strtoul (optval, &optvalend, 16);
+ if (optval != optvalend
+ && (*optvalend == '\0' || *optvalend == ',')
+ && ! (dev == ULONG_MAX && errno == ERANGE)
+ && dev == (dev_t) dev)
+ return dev;
+ }
+# endif
+ (void) mount_options;
+ return -1;
+}
+
+/* Return true if the file described by STATP is on autofs file system
+ and call set_fstype_devno () if the autofs file system is matched. */
+static bool
+filesystem_check_autofs (const struct stat *statp)
+{
+ FILE *fp;
+ struct mntent *mnt;
+ struct mount_entry entry;
+ bool match = false;
+
+ /* open /proc/mounts because autofs is not listed in /etc/mtab */
+ fp = setmntent ("/proc/mounts", "r");
+ if (fp == NULL)
+ return false;
+
+ while ((mnt = getmntent (fp)))
+ {
+ if (0 != strcmp ("autofs", mnt->mnt_type))
+ continue;
+
+ entry.me_mountdir = mnt->mnt_dir;
+ entry.me_dev = dev_from_mount_options (mnt->mnt_opts);
+ set_fstype_devno (&entry);
+ if (entry.me_dev == statp->st_dev)
+ {
+ match = true;
+ break;
+ }
+ }
+
+ endmntent (fp);
+ return match;
+}
/* Return a newly allocated string naming the type of file system that the
file PATH, described by STATP, is on.
@@ -244,6 +309,10 @@ file_system_type_uncached (const struct stat *statp, const char *path)
}
free_file_system_list (entries);
+ /* check for autofs */
+ if (type == NULL && filesystem_check_autofs (statp))
+ type = xstrdup ("autofs");
+
/* Don't cache unknown values. */
fstype_known = (type != NULL);

View File

@ -1,8 +1,22 @@
From 17e470dc1acca4824b70328d733d5f99c12d0d65 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Wed, 11 May 2011 16:46:45 +0200
Subject: [PATCH] findutils-4.4.2-xautofs.patch
---
doc/find.texi | 4 ++++
find/defs.h | 3 +++
find/find.1 | 3 +++
find/ftsfind.c | 6 ++++++
find/parser.c | 9 +++++++++
find/util.c | 3 ++-
6 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/doc/find.texi b/doc/find.texi
index b509f66..3ce5b1e 100644
index c584298..9731b71 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -1438,6 +1438,10 @@ them.
@@ -1606,6 +1606,10 @@ them.
There are two ways to avoid searching certain filesystems. One way is
to tell @code{find} to only search one filesystem:
@ -14,26 +28,26 @@ index b509f66..3ce5b1e 100644
@deffnx Option -mount
Don't descend directories on other filesystems. These options are
diff --git a/find/defs.h b/find/defs.h
index f344f97..4ade8f4 100644
index 11d1d00..f95ce72 100644
--- a/find/defs.h
+++ b/find/defs.h
@@ -562,6 +562,9 @@ struct options
/* If true, don't cross filesystem boundaries. */
boolean stay_on_filesystem;
bool stay_on_filesystem;
+ /* If true, don't descend directories on autofs filesystems. */
+ boolean bypass_autofs;
+ bool bypass_autofs;
+
/* If true, we ignore the problem where we find that a directory entry
* no longer exists by the time we get around to processing it.
*/
diff --git a/find/find.1 b/find/find.1
index 5da6ddf..82dc802 100644
index e851f82..a4799ff 100644
--- a/find/find.1
+++ b/find/find.1
@@ -460,6 +460,9 @@ if standard input is a tty, and to
.B \-nowarn
otherwise.
@@ -638,6 +638,9 @@ to stat them; this gives a significant increase in search speed.
.IP "\-version, \-\-version"
Print the \fBfind\fR version number and exit.
+.IP \-xautofs
+Don't descend directories on autofs filesystems.
@ -42,10 +56,10 @@ index 5da6ddf..82dc802 100644
Don't descend directories on other filesystems.
diff --git a/find/ftsfind.c b/find/ftsfind.c
index c3681f6..b3a08f9 100644
index 9fdb8ef..bd7cc37 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -524,6 +524,12 @@ consider_visiting (FTS *p, FTSENT *ent)
@@ -435,6 +435,12 @@ consider_visiting (FTS *p, FTSENT *ent)
}
}
@ -59,47 +73,53 @@ index c3681f6..b3a08f9 100644
{
/* this is the preorder visit, but user said -depth */
diff --git a/find/parser.c b/find/parser.c
index 2ea3126..8238671 100644
index 52a1ef6..995aec3 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -153,6 +153,7 @@ static boolean parse_user PARAMS((const struct parser_table*, char *arg
static boolean parse_version PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
static boolean parse_wholename PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
static boolean parse_xdev PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
+static boolean parse_xautofs PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
static boolean parse_ignore_race PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
static boolean parse_noignore_race PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
static boolean parse_warn PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
@@ -325,6 +326,7 @@ static struct parser_table const parse_table[] =
PARSE_TEST_NP ("wholename", wholename), /* GNU, replaced -path, but anyway -path will soon be in POSIX */
@@ -139,6 +139,7 @@ static bool parse_used (const struct parser_table*, char *argv[], int *
static bool parse_user (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_wholename (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_xdev (const struct parser_table*, char *argv[], int *arg_ptr);
+static bool parse_xautofs (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_ignore_race (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_noignore_race (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_warn (const struct parser_table*, char *argv[], int *arg_ptr);
@@ -304,6 +305,7 @@ static struct parser_table const parse_table[] =
PARSE_TEST_NP ("wholename", wholename), /* GNU, replaced -path, but now -path is standardized since POSIX 2008 */
{ARG_TEST, "writable", parse_accesscheck, pred_writable}, /* GNU, 4.3.0+ */
PARSE_OPTION ("xdev", xdev), /* POSIX */
+ PARSE_OPTION ("xautofs", xautofs),
PARSE_TEST ("xtype", xtype), /* GNU */
#ifdef UNIMPLEMENTED_UNIX
/* It's pretty ugly for find to know about archive formats.
@@ -2795,6 +2797,16 @@ parse_xdev (const struct parser_table* entry, char **argv, int *arg_ptr)
@@ -2607,6 +2609,13 @@ parse_xdev (const struct parser_table* entry, char **argv, int *arg_ptr)
return parse_noop (entry, argv, arg_ptr);
}
static boolean
+static bool
+parse_xautofs (const struct parser_table* entry, char **argv, int *arg_ptr)
+{
+ (void) argv;
+ (void) arg_ptr;
+ (void) entry;
+ options.bypass_autofs = true;
+ return true;
+ return parse_noop (entry, argv, arg_ptr);
+}
+
+static boolean
static bool
parse_ignore_race (const struct parser_table* entry, char **argv, int *arg_ptr)
{
options.ignore_readdir_race = true;
diff --git a/find/util.c b/find/util.c
index 11e8eed..3761a61 100644
index 8577396..4d45f84 100644
--- a/find/util.c
+++ b/find/util.c
@@ -999,6 +999,7 @@ set_option_defaults (struct options *p)
@@ -183,7 +183,7 @@ Positional options (always true):\n\
HTL (_("\n\
Normal options (always true, specified before other expressions):\n\
-depth -files0-from FILE -maxdepth LEVELS -mindepth LEVELS\n\
- -mount -noleaf -xdev -ignore_readdir_race -noignore_readdir_race\n"));
+ -mount -noleaf -xautofs -xdev -ignore_readdir_race -noignore_readdir_race\n"));
HTL (_("\n\
Tests (N can be +N or -N or N):\n\
-amin N -anewer FILE -atime N -cmin N -cnewer FILE -context CONTEXT\n\
@@ -1028,6 +1028,7 @@ set_option_defaults (struct options *p)
p->full_days = false;
p->stay_on_filesystem = false;
@ -107,3 +127,6 @@ index 11e8eed..3761a61 100644
p->ignore_readdir_race = false;
if (p->posixly_correct)
--
1.7.4.4

View File

@ -0,0 +1,26 @@
From 690d4bd9f29a805999a3ce4651dac9585ccc9917 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Wed, 11 May 2011 16:46:57 +0200
Subject: [PATCH] findutils-4.5.7-warnings.patch
---
xargs/xargs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 5e373f2..c0a8676 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1346,7 +1346,8 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
* utility if we run it, for POSIX compliance on the
* handling of exit values.
*/
- write (fd[1], &errno, sizeof (int));
+ int sink = write (fd[1], &errno, sizeof (int));
+ (void) sink;
}
close (fd[1]);
--
1.7.1

View File

@ -0,0 +1,173 @@
From 3e5e311d23ac0a5bd5930ddb4094f7555b886329 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Sat, 19 Dec 2015 22:56:40 +0100
Subject: [PATCH 1/2] Revert "Don't include dblocation.texi from original spot,
symlink it."
This reverts commit f59d88e456553dfe0b5185caf75e4041285fd595.
---
doc/Makefile.am | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f6f7443..6fbf57b 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -16,11 +16,9 @@ AM_CFLAGS = $(WARN_CFLAGS)
info_TEXINFOS = find.texi find-maint.texi
find_TEXINFOS = perm.texi parse-datetime.texi regexprops.texi fdl.texi
-BUILT_SOURCES = dblocation.texi
-nodist_find_TEXINFOS = dblocation.texi
find_maint_TEXINFOS = fdl.texi
MOSTLYCLEANFILES = find.cps
-CLEANFILES = find.txt find_mono.html findutils.texi_html_node.tar.gz dblocation.texi \
+CLEANFILES = find.txt find_mono.html findutils.texi_html_node.tar.gz \
find_mono.html findutils.texi_html_node.tar.gz \
find-info.tar.gz find.texi.tar.gz \
find.txt tmp-doc-install find_mono.html.gz
@@ -73,9 +71,6 @@ findutils.texi_html_node.tar.gz: find.html
tar zcf $@ find.html
-dblocation.texi: ../locate/dblocation.texi
- $(LN_S) ../locate/dblocation.texi $@
-
find-info.tar.gz:
$(MKDIR_P) tmp-doc-install/info
$(MAKE) $(AM_MAKEFLAGS) \
--
2.5.0
From d5473caa86f689ebcadacc593f5a71781c99e829 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Wed, 11 May 2011 16:46:13 +0200
Subject: [PATCH 2/2] findutils-4.4.0-no-locate.patch
---
Makefile.am | 2 +-
configure.ac | 2 --
doc/find.texi | 24 ++++++++----------------
tests/local.mk | 2 +-
4 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index af82d54..6ad453b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,7 +35,7 @@ DISTCLEANFILES = tool-versions.txt
# "gnulib-tests" is the gnulib unit test dir.
-SUBDIRS = gl build-aux lib find xargs locate doc po m4 gnulib-tests
+SUBDIRS = gl build-aux lib find xargs doc po m4 gnulib-tests
ALL_RECURSIVE_TARGETS =
diff --git a/configure.ac b/configure.ac
index ce0e768..521e665 100644
--- a/configure.ac
+++ b/configure.ac
@@ -309,8 +309,6 @@ find/testsuite/Makefile
gl/Makefile
gl/lib/Makefile
lib/Makefile
-locate/Makefile
-locate/testsuite/Makefile
m4/Makefile
po/Makefile.in
po/Makefile
diff --git a/doc/find.texi b/doc/find.texi
index c2714dd..01367a4 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -7,7 +7,6 @@
@c @setchapternewpage odd
@c %**end of header
-@include dblocation.texi
@iftex
@finalout
@@ -661,8 +660,7 @@ the databases are updated, and the directories for which they contain
entries.
Here is how to select which file name databases @code{locate}
-searches. The default is system-dependent. At the time this document
-was generated, the default was @file{@value{LOCATE_DB}}.
+searches. The default is system-dependent.
@table @code
@item --database=@var{path}
@@ -3112,13 +3110,9 @@ thrashing the network.
directories are indexed by each database file.
The default location for the locate database depends on how findutils
-is built, but the findutils installation accompanying this manual uses
-the default location @file{@value{LOCATE_DB}}.
-
-If no database exists at @file{@value{LOCATE_DB}} but the user did not
-specify where to look (by using @samp{-d} or setting
-@env{LOCATE_PATH}), then @code{locate} will also check for a
-``secure'' database in @file{/var/lib/slocate/slocate.db}.
+is built. If user did not specify where to look (by using @samp{-d}
+or setting @code{LOCATE_PATH}), then @code{locate} will also check for
+a ``secure'' database in @file{/var/lib/slocate/slocate.db}.
@node Database Formats
@section Database Formats
@@ -3627,8 +3621,7 @@ present.
@item --database=@var{path}
@itemx -d @var{path}
-Instead of searching the default @code{locate} database
-@file{@value{LOCATE_DB}}, @code{locate} searches the file
+@code{locate} searches the file
name databases in @var{path}, which is a colon-separated list of
database file names. You can also use the environment variable
@env{LOCATE_PATH} to set the list of database files to search. The
@@ -3803,8 +3796,7 @@ The environment variable @env{PRUNEFS} also sets this value. Default
is @file{nfs NFS proc}.
@item --output=@var{dbfile}
-The database file to build. The default is system-dependent, but
-when this document was formatted it was @file{@value{LOCATE_DB}}.
+The database file to build.
@item --localuser=@var{user}
The user to search the non-network directories as, using @code{su}.
@@ -5828,7 +5820,7 @@ See the manual of the system call @code{dup2(2)}.
@section Error Messages From @code{locate}
@table @samp
-@item warning: database @file{@value{LOCATE_DB}} is more than 8 days old
+@item warning: database @file{LOCATE_DB} is more than 8 days old
The @code{locate} program relies on a database which is periodically
built by the @code{updatedb} program. That hasn't happened in a long
time. To fix this problem, run @code{updatedb} manually. This can
@@ -5836,7 +5828,7 @@ often happen on systems that are generally not left on, so the
periodic ``cron'' task which normally does this doesn't get a chance
to run.
-@item locate database @file{@value{LOCATE_DB}} is corrupt or invalid
+@item locate database @file{LOCATE_DB} is corrupt or invalid
This should not happen. Re-run @code{updatedb}. If that works, but
@code{locate} still produces this error, run @code{locate --version}
and @code{updatedb --version}. These should produce the same output.
diff --git a/tests/local.mk b/tests/local.mk
index 7e52a04..ae08a56 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -15,7 +15,7 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
-built_programs = find xargs frcode locate updatedb
+built_programs = find xargs
# Indirections required so that we'll still be able to know the
# complete list of our tests even if the user overrides TESTS
--
2.5.0

View File

@ -1,586 +0,0 @@
ChangeLog | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
NEWS | 1 +
find/defs.h | 12 ++++++-
find/find.c | 8 +++--
find/ftsfind.c | 53 ++++++++++++++++------------------
find/parser.c | 10 +++---
find/pred.c | 8 ++--
find/sharefile.c | 2 +-
find/tree.c | 1 +
find/util.c | 83 ++++++++++++++++++++++++++++++++++++++++++-----------
10 files changed, 191 insertions(+), 61 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index abe1993..8bcae9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,77 @@
+ 2010-04-05 James Youngman <jay@gnu.org>
+
+ Don't issue an error message twice for the same target file.
+ * find/defs.h (struct state): New member,
+ already_issued_stat_error_msg, used to de-duplicate error
+ messages. If it is true, we already issued an error message for
+ the current target file.
+ Declare fatal_target_file_error, fatal_nontarget_file_error,
+ nonfatal_target_file_error, nonfatal_nontarget_file_error.
+ Between them, they replace fatal_file_error and
+ nonfatal_file_error. The *target_file_error versions are
+ de-duplicated and the nontarget_file_error_versions are not.
+ * find/util.c (nonfatal_nontarget_file_error): Implement.
+ (fatal_nontarget_file_error): Implement.
+ (nonfatal_target_file_error): Implement.
+ (fatal_target_file_error): Implement.
+ (fatal_file_error): Remove.
+ (nonfatal_file_error): Remove.
+ (error_severity): Define error_severity (moved from ftsfind.c)
+ (get_statinfo): Call nonfatal_target_file_error in order to avoid
+ a duplicate message. ALso call error_severity after a different
+ call to error to preserve the constraint that we exit with a
+ nonzero status if we issue a diagnostic.
+ (cleanup): Call nonfatal_nontarget_file_error instead of
+ nonfatal_file_error.
+ * find/tree.c (build_expression_tree): Initialise
+ state.already_issued_stat_error_msg.
+ * find/find.c (main): Initialise state.already_issued_stat_error_msg.
+ (wd_sanity_check): Call fatal_target_file_error instead of
+ fatal_file_error.
+ (chdir_back): Call fatal_nontarget_file_error instead of
+ fatal_file_error.
+ (process_path): Initialise state.already_issued_stat_error_msg.
+ * find/ftsfind.c (consider_visiting): Call
+ nonfatal_target_file_error instead of calling error directly.
+ (find): Call error_severity to ensure exit status is nonzero after
+ a call to error.
+ (main): Initialise state.already_issued_stat_error_msg.
+ (error_severity): Move to util.c.
+ * find/parser.c (collect_arg_stat_info): Call
+ fatal_target_file_error instead of fatal_file_error.
+ (parse_newerXY): Likewise.
+ (parse_samefile): Likewise.
+ (parse_samefile): Likewise.
+ (open_output_file): Call fatal_nontarget_file_error instead of
+ fatal_file_error.
+ * find/pred.c (checked_fprintf): Likewise.
+ (checked_print_quoted): Likewise.
+ (checked_fwrite): Likewise.
+ (checked_fflush): Likewise.
+ * find/sharefile.c (entry_free): Likewise.
+
+ Fix Savannah bug #29435: fd_is_cloexec does not work on Fedora
+ buildhosts.
+ Fix open_cloexec on hosts which ignore O_CLOEXEC (i.e. old kernels).
+ * lib/fdleak.c (o_cloexec_works): New function, detects whether
+ the open flag O_CLOEXEC has any effect.
+ (open_cloexec): Call o_cloexec_works, just once, to find out
+ whether O_CLOEXEC is effective. If not, set the close-on-exec
+ flag on fds by calling set_cloexec_flag.
+ * NEWS: Mention this bugfix.
+
+2010-04-04 Martin von Gagern <Martin.vGagern@gmx.net>
+
+ Fix Savannah bug #27213: avoid failed assertions for
+ non-executable directories.
+ (consider_visiting): Continue (after issuing an error message)
+ even if ent->fts_info == FTS_NS.
+ * find/util.c (get_statinfo): If we cannot stat the file, issue a
+ diagnostic, but continue anyway.
+ * find/ftsfind.c (consider_visiting): Don't assert-fail if
+ ent->fts_info == FTS_NSOK. Don't assert-fail if state.type is
+ nonzero.
+
2010-04-04 James Youngman <jay@gnu.org>
Fix Savannah bug #29435: fd_is_cloexec does not work on Fedora
diff --git a/NEWS b/NEWS
index e171b87..3f81b88 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
#29435: fd_is_cloexec does not work on Fedora buildhosts
+#27213: avoid failed assertions for non-executable directories.
* Major changes in release 4.5.7, 2010-04-03
diff --git a/find/defs.h b/find/defs.h
index 4ade8f4..b2e255a 100644
--- a/find/defs.h
+++ b/find/defs.h
@@ -504,11 +504,16 @@ extern boolean check_nofollow(void);
void complete_pending_execs(struct predicate *p);
void complete_pending_execdirs(int dir_fd); /* Passing dir_fd is an unpleasant CodeSmell. */
const char *safely_quote_err_filename (int n, char const *arg);
-void fatal_file_error(const char *name) ATTRIBUTE_NORETURN;
-void nonfatal_file_error(const char *name);
+
+void fatal_target_file_error (int errno_value, const char *name) ATTRIBUTE_NORETURN;
+void fatal_nontarget_file_error (int errno_value, const char *name) ATTRIBUTE_NORETURN;
+void nonfatal_target_file_error (int erron_value, const char *name);
+void nonfatal_nontarget_file_error (int erron_value, const char *name);
+
int process_leading_options PARAMS((int argc, char *argv[]));
void set_option_defaults PARAMS((struct options *p));
+void error_severity PARAMS((int level));
#if 0
#define apply_predicate(pathname, stat_buf_ptr, node) \
@@ -669,6 +674,9 @@ struct state
/* Shared files, opened via the interface in sharefile.h. */
sharefile_handle shared_files;
+
+ /* Avoid multiple error messages for the same file. */
+ boolean already_issued_stat_error_msg;
};
/* finddata.c */
diff --git a/find/find.c b/find/find.c
index 336e120..e058814 100644
--- a/find/find.c
+++ b/find/find.c
@@ -135,6 +135,7 @@ main (int argc, char **argv)
remember_non_cloexec_fds ();
}
+ state.already_issued_stat_error_msg = false;
state.shared_files = sharefile_init ("w");
if (NULL == state.shared_files)
{
@@ -472,7 +473,7 @@ wd_sanity_check (const char *thing_to_stat,
set_stat_placeholders (newinfo);
if ((*options.xstat) (current_dir, newinfo) != 0)
- fatal_file_error (thing_to_stat);
+ fatal_target_file_error (errno, thing_to_stat);
if (old_dev != newinfo->st_dev)
{
@@ -943,7 +944,7 @@ chdir_back (void)
#endif
if (chdir (starting_dir) != 0)
- fatal_file_error (starting_dir);
+ fatal_nontarget_file_error (errno, starting_dir);
wd_sanity_check (starting_dir,
program_name,
@@ -962,7 +963,7 @@ chdir_back (void)
if (fchdir (starting_desc) != 0)
{
- fatal_file_error (starting_dir);
+ fatal_nontarget_file_error (errno, starting_dir);
}
}
}
@@ -1183,6 +1184,7 @@ process_path (char *pathname, char *name, boolean leaf, char *parent,
state.type = 0;
state.have_stat = false;
state.have_type = false;
+ state.already_issued_stat_error_msg = false;
if (!digest_mode (&mode, pathname, name, &stat_buf, leaf))
return 0;
diff --git a/find/ftsfind.c b/find/ftsfind.c
index b3a08f9..692d9f5 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -173,18 +173,6 @@ inside_dir (int dir_fd)
static void init_mounted_dev_list (void);
#endif
-/* We have encountered an error which should affect the exit status.
- * This is normally used to change the exit status from 0 to 1.
- * However, if the exit status is already 2 for example, we don't want to
- * reduce it to 1.
- */
-static void
-error_severity (int level)
-{
- if (state.exit_status < level)
- state.exit_status = level;
-}
-
#define STRINGIFY(X) #X
#define HANDLECASE(N) case N: return #N;
@@ -371,9 +359,6 @@ show_outstanding_execdirs (FILE *fp)
/* No debug output is wanted. */
}
}
-
-
-
static void
consider_visiting (FTS *p, FTSENT *ent)
@@ -410,15 +395,13 @@ consider_visiting (FTS *p, FTSENT *ent)
if (ent->fts_info == FTS_ERR
|| ent->fts_info == FTS_DNR)
{
- error (0, ent->fts_errno, "%s",
- safely_quote_err_filename (0, ent->fts_path));
- error_severity (1);
+ nonfatal_target_file_error (ent->fts_errno, ent->fts_path);
return;
}
else if (ent->fts_info == FTS_DC)
{
issue_loop_warning (ent);
- error_severity (1);
+ error_severity (EXIT_FAILURE);
return;
}
else if (ent->fts_info == FTS_SLNONE)
@@ -432,8 +415,7 @@ consider_visiting (FTS *p, FTSENT *ent)
*/
if (symlink_loop (ent->fts_accpath))
{
- error (0, ELOOP, "%s", safely_quote_err_filename (0, ent->fts_path));
- error_severity (1);
+ nonfatal_target_file_error (ELOOP, ent->fts_path);
return;
}
}
@@ -442,9 +424,7 @@ consider_visiting (FTS *p, FTSENT *ent)
if (ent->fts_level == 0)
{
/* e.g., nonexistent starting point */
- error (0, ent->fts_errno, "%s",
- safely_quote_err_filename (0, ent->fts_path));
- error_severity (1); /* remember problem */
+ nonfatal_target_file_error (ent->fts_errno, ent->fts_path);
return;
}
else
@@ -454,11 +434,24 @@ consider_visiting (FTS *p, FTSENT *ent)
*/
if (symlink_loop (ent->fts_accpath))
{
- error (0, ELOOP, "%s",
- safely_quote_err_filename (0, ent->fts_path));
- error_severity (1);
+ nonfatal_target_file_error (ELOOP, ent->fts_path);
return;
}
+ else
+ {
+ nonfatal_target_file_error (ent->fts_errno, ent->fts_path);
+ /* Continue despite the error, as file name without stat info
+ * might be better than not even processing the file name. This
+ * can lead to repeated error messages later on, though, if a
+ * predicate requires stat information.
+ *
+ * Not printing an error message here would be even more wrong,
+ * though, as this could cause the contents of a directory to be
+ * silently ignored, as the directory wouldn't be identified as
+ * such.
+ */
+ }
+
}
}
@@ -467,7 +460,7 @@ consider_visiting (FTS *p, FTSENT *ent)
|| ent->fts_info == FTS_NS /* e.g. symlink loop */)
{
assert (!state.have_stat);
- assert (ent->fts_info == FTS_NSOK || state.type != 0);
+ assert (ent->fts_info == FTS_NSOK || state.type == 0);
mode = state.type;
}
else
@@ -621,11 +614,13 @@ find (char *arg)
{
error (0, errno, _("cannot search %s"),
safely_quote_err_filename (0, arg));
+ error_severity (EXIT_FAILURE);
}
else
{
while ( (ent=fts_read (p)) != NULL )
{
+ state.already_issued_stat_error_msg = false;
state.have_stat = false;
state.have_type = !!ent->fts_statp->st_mode;
state.type = state.have_type ? ent->fts_statp->st_mode : 0;
@@ -640,6 +635,7 @@ find (char *arg)
error (0, errno,
_("failed to restore working directory after searching %s"),
arg);
+ error_severity (EXIT_FAILURE);
return false;
}
p = NULL;
@@ -689,6 +685,7 @@ main (int argc, char **argv)
else
set_program_name ("find");
+ state.already_issued_stat_error_msg = false;
state.exit_status = 0;
state.execdirs_outstanding = false;
state.cwd_dir_fd = AT_FDCWD;
diff --git a/find/parser.c b/find/parser.c
index 8238671..8668ce4 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -744,7 +744,7 @@ collect_arg_stat_info (char **argv, int *arg_ptr, struct stat *p,
}
else
{
- fatal_file_error (filename);
+ fatal_target_file_error (errno, filename);
}
}
else
@@ -1685,7 +1685,7 @@ parse_newerXY (const struct parser_table* entry, char **argv, int *arg_ptr)
/* Stat the named file. */
set_stat_placeholders (&stat_newer);
if ((*options.xstat) (argv[*arg_ptr], &stat_newer))
- fatal_file_error (argv[*arg_ptr]);
+ fatal_target_file_error (errno, argv[*arg_ptr]);
if (!get_stat_Ytime (&stat_newer, y, &our_pred->args.reftime.ts))
{
@@ -2425,7 +2425,7 @@ parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr)
*/
if (0 != fstat (fd, &fst))
{
- fatal_file_error (argv[*arg_ptr]);
+ fatal_target_file_error (errno, argv[*arg_ptr]);
}
else
{
@@ -2435,7 +2435,7 @@ parse_samefile (const struct parser_table* entry, char **argv, int *arg_ptr)
* destination of the link, not the link itself.
*/
if ((*options.xstat) (argv[*arg_ptr], &st))
- fatal_file_error (argv[*arg_ptr]);
+ fatal_target_file_error (errno, argv[*arg_ptr]);
if ((options.symlink_handling == SYMLINK_NEVER_DEREF)
&& (!options.open_nofollow_available))
@@ -3799,7 +3799,7 @@ open_output_file (const char *path, struct format_val *p)
if (p->stream == NULL)
{
- fatal_file_error (path);
+ fatal_nontarget_file_error (errno, path);
}
}
diff --git a/find/pred.c b/find/pred.c
index cb61ed2..44db6a6 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -696,7 +696,7 @@ checked_fprintf (struct format_val *dest, const char *fmt, ...)
va_start (ap, fmt);
rv = vfprintf (dest->stream, fmt, ap);
if (rv < 0)
- nonfatal_file_error (dest->filename);
+ nonfatal_nontarget_file_error (errno, dest->filename);
}
@@ -707,7 +707,7 @@ checked_print_quoted (struct format_val *dest,
int rv = print_quoted (dest->stream, dest->quote_opts, dest->dest_is_tty,
format, s);
if (rv < 0)
- nonfatal_file_error (dest->filename);
+ nonfatal_nontarget_file_error (errno, dest->filename);
}
@@ -716,7 +716,7 @@ checked_fwrite (void *p, size_t siz, size_t nmemb, struct format_val *dest)
{
int items_written = fwrite (p, siz, nmemb, dest->stream);
if (items_written < nmemb)
- nonfatal_file_error (dest->filename);
+ nonfatal_nontarget_file_error (errno, dest->filename);
}
static void
@@ -724,7 +724,7 @@ checked_fflush (struct format_val *dest)
{
if (0 != fflush (dest->stream))
{
- nonfatal_file_error (dest->filename);
+ nonfatal_nontarget_file_error (errno, dest->filename);
}
}
diff --git a/find/sharefile.c b/find/sharefile.c
index 8e0f4cc..1442d7b 100644
--- a/find/sharefile.c
+++ b/find/sharefile.c
@@ -76,7 +76,7 @@ entry_free (void *pv)
if (p->fp)
{
if (0 != fclose (p->fp))
- fatal_file_error (p->name);
+ fatal_nontarget_file_error (errno, p->name);
}
free (p->name);
free (p);
diff --git a/find/tree.c b/find/tree.c
index 08f2f0a..d07b125 100644
--- a/find/tree.c
+++ b/find/tree.c
@@ -1283,6 +1283,7 @@ build_expression_tree (int argc, char *argv[], int end_of_leading_options)
/* Build the input order list. */
while (i < argc )
{
+ state.already_issued_stat_error_msg = false;
if (!looks_like_expression (argv[i], false))
{
error (0, 0, _("paths must precede expression: %s"), argv[i]);
diff --git a/find/util.c b/find/util.c
index 3761a61..a789131 100644
--- a/find/util.c
+++ b/find/util.c
@@ -210,15 +210,14 @@ get_statinfo (const char *pathname, const char *name, struct stat *p)
/* Savannah bug #16378. */
error (0, 0, _("WARNING: file %s appears to have mode 0000"),
quotearg_n_style (0, options.err_quoting_style, name));
+ error_severity (1);
}
}
else
{
if (!options.ignore_readdir_race || (errno != ENOENT) )
{
- error (0, errno, "%s",
- safely_quote_err_filename (0, pathname));
- state.exit_status = 1;
+ nonfatal_target_file_error (errno, pathname);
}
return -1;
}
@@ -272,6 +271,10 @@ get_info (const char *pathname,
int result = get_statinfo (pathname, state.rel_pathname, p);
if (result != 0)
{
+ return -1; /* failure. */
+ }
+ else
+ {
/* Verify some postconditions. We can't check st_mode for
non-zero-ness because of Savannah bug #16378 (which is
that broken NFS servers can return st_mode==0). */
@@ -283,10 +286,6 @@ get_info (const char *pathname,
{
assert (p->st_ino);
}
- return -1; /* failure. */
- }
- else
- {
return 0; /* success. */
}
}
@@ -486,7 +485,7 @@ cleanup (void)
}
if (fflush (stdout) == EOF)
- nonfatal_file_error ("standard output");
+ nonfatal_nontarget_file_error (errno, "standard output");
}
/* Savannah bug #16378 manifests as an assertion failure in pred_type()
@@ -1074,35 +1073,83 @@ safely_quote_err_filename (int n, char const *arg)
return quotearg_n_style (n, options.err_quoting_style, arg);
}
+/* We have encountered an error which should affect the exit status.
+ * This is normally used to change the exit status from 0 to 1.
+ * However, if the exit status is already 2 for example, we don't want to
+ * reduce it to 1.
+ */
+void
+error_severity (int level)
+{
+ if (state.exit_status < level)
+ state.exit_status = level;
+}
+
/* report_file_err
*/
static void
-report_file_err(int exitval, int errno_value, const char *name)
+report_file_err(int exitval, int errno_value,
+ boolean is_target_file, const char *name)
{
/* It is important that the errno value is passed in as a function
* argument before we call safely_quote_err_filename(), because otherwise
* we might find that safely_quote_err_filename() changes errno.
*/
- if (state.exit_status < 1)
- state.exit_status = 1;
-
- error (exitval, errno_value, "%s", safely_quote_err_filename (0, name));
+ if (!is_target_file || !state.already_issued_stat_error_msg)
+ {
+ error (exitval, errno_value, "%s", safely_quote_err_filename (0, name));
+ error_severity (1);
+ }
+ if (is_target_file)
+ {
+ state.already_issued_stat_error_msg = true;
+ }
}
-/* fatal_file_error
+/* nonfatal_target_file_error
*
*/
void
-fatal_file_error(const char *name)
+nonfatal_target_file_error (int errno_value, const char *name)
{
- report_file_err (1, errno, name);
+ report_file_err (0, errno_value, true, name);
+}
+
+/* fatal_target_file_error
+ *
+ * Report an error on a target file (i.e. a file we are searching).
+ * Such errors are only reported once per searched file.
+ *
+ */
+void
+fatal_target_file_error(int errno_value, const char *name)
+{
+ report_file_err (1, errno_value, true, name);
/*NOTREACHED*/
abort ();
}
+/* nonfatal_nontarget_file_error
+ *
+ */
void
-nonfatal_file_error (const char *name)
+nonfatal_nontarget_file_error (int errno_value, const char *name)
{
- report_file_err (0, errno, name);
+ report_file_err (0, errno_value, false, name);
}
+/* fatal_nontarget_file_error
+ *
+ */
+void
+fatal_nontarget_file_error(int errno_value, const char *name)
+{
+ /* We're going to exit fatally, so make sure we always isssue the error
+ * message, even if it will be duplicate. Motivation: otherwise it may
+ * not be clear what went wrong.
+ */
+ state.already_issued_stat_error_msg = false;
+ report_file_err (1, errno_value, false, name);
+ /*NOTREACHED*/
+ abort ();
+}

View File

@ -1,98 +0,0 @@
upstream commit a44cece
ChangeLog | 12 ++++++++++++
NEWS | 5 +++++
lib/fdleak.c | 32 +++++++++++++++++++++++++++++++-
3 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9a6d7d4..abe1993 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-04-04 James Youngman <jay@gnu.org>
+
+ Fix Savannah bug #29435: fd_is_cloexec does not work on Fedora
+ buildhosts.
+ Fix open_cloexec on hosts which ignore O_CLOEXEC (i.e. old kernels).
+ * lib/fdleak.c (o_cloexec_works): New function, detects whether
+ the open flag O_CLOEXEC has any effect.
+ (open_cloexec): Call o_cloexec_works, just once, to find out
+ whether O_CLOEXEC is effective. If not, set the close-on-exec
+ flag on fds by calling set_cloexec_flag.
+ * NEWS: Mention this bugfix.
+
2010-04-03 James Youngman <jay@gnu.org>
Prepare for release of findutils-4.5.7.
diff --git a/NEWS b/NEWS
index f2eef6f..e171b87 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
GNU findutils NEWS - User visible changes. -*- outline -*- (allout)
+** Bug Fixes
+
+#29435: fd_is_cloexec does not work on Fedora buildhosts
+
+
* Major changes in release 4.5.7, 2010-04-03
** Performance changes
diff --git a/lib/fdleak.c b/lib/fdleak.c
index 2c362cf..47f9579 100644
--- a/lib/fdleak.c
+++ b/lib/fdleak.c
@@ -303,11 +303,30 @@ find_first_leaked_fd (const int* prev_non_cloexec_fds, size_t n)
return context.leaked_fd;
}
+/* Determine if O_CLOEXEC actually works (Savannah bug #29435:
+ fd_is_cloexec () does not work on Fedora buildhosts).
+ */
+static bool
+o_cloexec_works (void)
+{
+ bool result = false;
+ int fd = open ("/", O_RDONLY|O_CLOEXEC);
+ if (fd >= 0)
+ {
+ result = fd_is_cloexec (fd);
+ close (fd);
+ }
+ return result;
+}
+
+
int
open_cloexec (const char *path, int flags, ...)
{
int fd;
mode_t mode = 0;
+ static bool cloexec_works = false;
+ static bool cloexec_status_known = false;
if (flags & O_CREAT)
{
@@ -322,8 +341,19 @@ open_cloexec (const char *path, int flags, ...)
va_end (ap);
}
+ /* Kernels usually ignore open flags they don't recognise, so it
+ * is possible this program was built against a library which
+ * defines O_CLOEXEC, but is running on a kernel that (silently)
+ * does not recognise it. We figure this out by just trying it,
+ * once.
+ */
+ if (!cloexec_status_known)
+ {
+ cloexec_works = o_cloexec_works ();
+ cloexec_status_known = true;
+ }
fd = open (path, flags|O_CLOEXEC, mode);
- if ((fd >= 0) && !O_CLOEXEC)
+ if ((fd >= 0) && !(O_CLOEXEC && cloexec_works))
{
set_cloexec_flag (fd, true);
}

View File

@ -1,40 +0,0 @@
find/pred.c | 2 +-
xargs/xargs.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/find/pred.c b/find/pred.c
index 7df37b1..cb61ed2 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -2045,7 +2045,7 @@ launch (struct buildcmd_control *ctl, void *usercontext, int argc, char **argv)
}
}
- if (bc_args_exceed_testing_limit (argv))
+ if (bc_args_exceed_testing_limit ((const char **) argv))
errno = E2BIG;
else
execvp (argv[0], argv);
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 4954256..bf48af5 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1117,7 +1117,7 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
prep_child_for_exec ();
- if (bc_args_exceed_testing_limit (argv))
+ if (bc_args_exceed_testing_limit ((const char **) argv))
errno = E2BIG;
else
execvp (argv[0], argv);
@@ -1135,7 +1135,8 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
* utility if we run it, for POSIX compliance on the
* handling of exit values.
*/
- write (fd[1], &errno, sizeof (int));
+ int sink = write (fd[1], &errno, sizeof (int));
+ (void) sink;
}
close (fd[1]);

Binary file not shown.

View File

@ -0,0 +1,122 @@
From 547e7145f335dc07144f35eaacc520475068852e Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Fri, 30 Aug 2019 10:22:22 +0200
Subject: [PATCH 1/3] Revert "fts: cleanup after FTS_NOATIME removal"
This reverts commit dce8759f0f0236a860a3e68b63c5e99cc6f168f9.
---
gl/lib/fts_.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gl/lib/fts_.h b/gl/lib/fts_.h
index fb5558f..0122262 100644
--- a/gl/lib/fts_.h
+++ b/gl/lib/fts_.h
@@ -149,14 +149,16 @@ typedef struct {
dirent.d_type data. */
# define FTS_DEFER_STAT 0x0400
+/* 0x0800 unused, was non-working FTS_NOATIME */
+
/* Use this flag to disable stripping of trailing slashes
from input path names during fts_open initialization. */
-# define FTS_VERBATIM 0x0800
+# define FTS_VERBATIM 0x1000
-# define FTS_OPTIONMASK 0x0fff /* valid user option mask */
+# define FTS_OPTIONMASK 0x1fff /* valid user option mask */
-# define FTS_NAMEONLY 0x1000 /* (private) child names only */
-# define FTS_STOP 0x2000 /* (private) unrecoverable error */
+# define FTS_NAMEONLY 0x2000 /* (private) child names only */
+# define FTS_STOP 0x4000 /* (private) unrecoverable error */
int fts_options; /* fts_open options, global flags */
/* Map a directory's device number to a boolean. The boolean is
--
2.20.1
From 1328926a705fdb4728c1f255dd368de928736d39 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Fri, 25 Sep 2015 16:09:39 +0200
Subject: [PATCH 2/3] fts: introduce the FTS_NOLEAF flag
The flag is needed to implement the -noleaf option of find.
* lib/fts.c (link_count_optimize_ok): Implement the FTS_NOLEAF flag.
* lib/fts_.h (FTS_NOLEAF): New macro, shifted conflicting constants.
---
gl/lib/fts.c | 4 ++++
gl/lib/fts_.h | 12 +++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/gl/lib/fts.c b/gl/lib/fts.c
index d2d404f..808466f 100644
--- a/gl/lib/fts.c
+++ b/gl/lib/fts.c
@@ -706,6 +706,10 @@ filesystem_type (FTSENT const *p, int fd)
struct dev_type *ent;
struct statfs fs_buf;
+ if (ISSET(FTS_NOLEAF))
+ /* leaf optimization explicitly disabled by the FTS_NOLEAF flag */
+ return 0;
+
/* If we're not in CWDFD mode, don't bother with this optimization,
since the caller is not serious about performance. */
if (!ISSET (FTS_CWDFD))
diff --git a/gl/lib/fts_.h b/gl/lib/fts_.h
index 63d4b74..f1d519b 100644
--- a/gl/lib/fts_.h
+++ b/gl/lib/fts_.h
@@ -155,10 +155,16 @@ typedef struct {
from input path names during fts_open initialization. */
# define FTS_VERBATIM 0x1000
-# define FTS_OPTIONMASK 0x1fff /* valid user option mask */
+ /* Disable leaf optimization (which eliminates stat() calls during traversal,
+ based on the count of nested directories stored in stat.st_nlink of each
+ directory). Note that the optimization is by default enabled only for
+ selected file systems, and only if the FTS_CWDFD flag is set. */
+# define FTS_NOLEAF 0x2000
-# define FTS_NAMEONLY 0x2000 /* (private) child names only */
-# define FTS_STOP 0x4000 /* (private) unrecoverable error */
+# define FTS_OPTIONMASK 0x3fff /* valid user option mask */
+
+# define FTS_NAMEONLY 0x4000 /* (private) child names only */
+# define FTS_STOP 0x8000 /* (private) unrecoverable error */
int fts_options; /* fts_open options, global flags */
/* Map a directory's device number to a boolean. The boolean is
--
2.5.0
From c186934e6e37ddadf7511abb9b1045192757618e Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Fri, 25 Sep 2015 19:13:15 +0200
Subject: [PATCH 3/3] ftsfind: propagate the -noleaf option to FTS
* find/ftsfind.c (find): Propagate the -noleaf option to FTS.
---
find/ftsfind.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/find/ftsfind.c b/find/ftsfind.c
index 5159470..e34b672 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -509,6 +509,9 @@ find (char *arg)
if (options.stay_on_filesystem)
ftsoptions |= FTS_XDEV;
+ if (options.no_leaf_check)
+ ftsoptions |= FTS_NOLEAF;
+
p = fts_open (arglist, ftsoptions, NULL);
if (NULL == p)
{
--
2.5.0

View File

@ -0,0 +1,29 @@
From 129f23ce758620fade812baab811379ce8454048 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 27 Jan 2017 11:44:41 +0100
Subject: [PATCH] test-lock: disable the rwlock test
It hangs indefinitely if the system rwlock implementation does not
prevent writer starvation (and glibc does not implement it).
Bug: http://www.mail-archive.com/bug-gnulib@gnu.org/msg33017.html
---
gnulib-tests/test-lock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gnulib-tests/test-lock.c b/gnulib-tests/test-lock.c
index a992f64..fd9c014 100644
--- a/gnulib-tests/test-lock.c
+++ b/gnulib-tests/test-lock.c
@@ -42,7 +42,7 @@
Uncomment some of these, to verify that all tests crash if no locking
is enabled. */
#define DO_TEST_LOCK 1
-#define DO_TEST_RWLOCK 1
+#define DO_TEST_RWLOCK 0
#define DO_TEST_RECURSIVE_LOCK 1
#define DO_TEST_ONCE 1
--
2.7.4

View File

@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEpRidtpwRZNMwApNmRlAu95aRcZUFAmH50AcACgkQRlAu95aR
cZU/DQgAjt38b5+7CREWR7rk9y/NRvc+xAg7wMfwjt90cAycjRZ7hMVviB7R+MhO
1rrV+4UkKCYzBzks5FIhN00IwmXoe0VPeH17ATtSB6c70rBNwHE7CWcGz2cnqHBQ
CzPBy3hXEq7YY1kq7bfZCkTTEnxve9eKrgoczj/NpxvxoRkLmXzzKd0ChvHLlYJl
m0GrPAl81eUF2vYIo5/9F28AR2mfCv1cwzsb1Ch3WEXqZB2tcIKsocrO4AVVpkmD
o1pmPZa1FTKPI4YdBOlOuWUYkf6rD7WEKTcFmXrafkPlzhY4HJyN35XslAllJg6w
81EbRarQvxrVDuxoS0jnx0oMvV7jxg==
=hp30
-----END PGP SIGNATURE-----

View File

@ -1,41 +1,38 @@
Summary: The GNU versions of find utilities (find and xargs)
Name: findutils
Version: 4.5.7
Release: 4%{?dist}
Version: 4.9.0
Release: 2%{?dist}
Epoch: 1
License: GPLv3+
Group: Applications/File
URL: http://www.gnu.org/software/findutils/
Source0: ftp://ftp.gnu.org/gnu/findutils/%{name}-%{version}.tar.gz
Source1: ftp://ftp.gnu.org/gnu/findutils/%{name}-%{version}.tar.gz.sig
URL: https://www.gnu.org/software/findutils/
Source0: https://ftp.gnu.org/pub/gnu/%{name}/%{name}-%{version}.tar.xz
# do not build locate
Patch1: findutils-4.4.0-no-locate.patch
Patch1: findutils-4.5.15-no-locate.patch
# learn find to recognize autofs file system by reading /proc/mounts
# as autofs mount points are not listed in /etc/mtab
Patch2: findutils-4.4.2-autofs.patch
# add a new option -xautofs to find to not descend into directories on autofs
# file systems
Patch3: findutils-4.4.2-xautofs.patch
# add -xautofs option to not descend into directories on autofs file systems
Patch2: findutils-4.4.2-xautofs.patch
# eliminate compile-time warnings
Patch4: findutils-4.5.7-warnings.patch
Patch3: findutils-4.5.13-warnings.patch
# upstream commit a44cece
Patch5: findutils-4.5.7-fdleak.patch
# test-lock: disable the rwlock test
Patch4: findutils-4.6.0-test-lock.patch
# rhbz #579476 (upstream bug #27213)
Patch6: findutils-4.5.7-bz579476.patch
# implement the -noleaf option of find (#1252549)
Patch5: findutils-4.6.0-leaf-opt.patch
Conflicts: filesystem < 3
Provides: /bin/find
Provides: bundled(gnulib)
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: automake
BuildRequires: dejagnu
BuildRequires: gettext-devel
BuildRequires: gcc
BuildRequires: git
BuildRequires: libselinux-devel
BuildRequires: make
BuildRequires: texinfo
%description
@ -50,70 +47,291 @@ You should install findutils because it includes tools that are very
useful for finding things on your system.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%autosetup -N -S git
# needed because of findutils-4.4.0-no-locate.patch
aclocal -I gnulib/m4 -I m4
automake
touch -c configure config.h
# drop the source code of locate
git rm -q -r locate
git commit -q -m "drop the source code of locate"
# remove ignored files from git and mark them as ignored
tee -a .gitignore << EOF
*~
Makefile.in
/aclocal.m4
/autom4te.cache
/build
/configure
/doc/find.info*
/doc/stamp-vti
/doc/version.texi
EOF
git rm -q -r --cached .
git add --all .
git commit -m "remove ignored files from git"
# apply all patches
%autopatch
# needed because of findutils-4.5.15-no-locate.patch
autoreconf -fiv
git add --all .
git commit -q -m "after invocation of autoreconf"
%build
# disable -flto on ppc64le to make test-float pass (#1789115)
%ifarch ppc64le
export CFLAGS="$RPM_OPT_FLAGS -fno-lto"
%endif
mkdir build
cd build
%global _configure ../configure
%configure
make %{?_smp_mflags}
%make_build
%check
make check
make %{?_smp_mflags} check -C build V=1
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%make_install -C build
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
rm -f %{buildroot}%{_infodir}/dir
%find_lang %{name}
# move find to /bin/find
mkdir -p $RPM_BUILD_ROOT/bin
mv $RPM_BUILD_ROOT{%_bindir,/bin}/find
# create /usr/bin/find -> /bin/find symlink
ln -sf ../../bin/find $RPM_BUILD_ROOT/usr/bin
%post
if [ -f %{_infodir}/find.info.gz ]; then
/sbin/install-info %{_infodir}/find.info.gz %{_infodir}/dir || :
fi
%preun
if [ $1 = 0 ]; then
if [ -f %{_infodir}/find.info.gz ]; then
/sbin/install-info --delete %{_infodir}/find.info.gz %{_infodir}/dir \
|| :
fi
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING NEWS README THANKS TODO
/bin/find
%license COPYING
%doc AUTHORS NEWS README THANKS TODO
%{_bindir}/find
%{_bindir}/oldfind
%{_bindir}/xargs
%{_mandir}/man1/find.1*
%{_mandir}/man1/xargs.1*
%{_infodir}/find.info*
%{_infodir}/find-maint.info.gz
%{_infodir}/find-maint.info.*
%changelog
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Feb 02 2022 Kamil Dudka <kdudka@redhat.com> - 1:4.9.0-1
- new upstream release
* Mon Jan 24 2022 Kamil Dudka <kdudka@redhat.com> - 1:4.8.0-6
- make findutils build on 32bit x86
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.8.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.8.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue May 25 2021 Florian Weimer <fweimer@redhat.com> - 1:4.8.0-3
- Rebuild with new binutils to fix ppc64le corruption (#1960730)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Jan 09 2021 Kamil Dudka <kdudka@redhat.com> - 1:4.8.0-1
- new upstream release
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.7.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 24 2020 Kamil Dudka <kdudka@redhat.com> - 1:4.7.0-6
- disable -flto on ppc64le to make test-float pass (#1789115)
- do not compile with -D__SUPPORT_SNAN__ (#1294016)
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 1:4.7.0-5
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Fri Apr 17 2020 Kamil Dudka <kdudka@redhat.com> - 1:4.7.0-4
- simplify leaf optimization for XFS (#1823247)
* Tue Feb 11 2020 Kamil Dudka <kdudka@redhat.com> - 1:4.7.0-3
- make upstream test-suite work with root privileges (#1799064)
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Aug 30 2019 Kamil Dudka <kdudka@redhat.com> - 1:4.7.0-1
- new upstream release
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Apr 24 2019 Björn Esser <besser82@fedoraproject.org> - 1:4.6.0-23
- Remove hardcoded gzip suffix from GNU info pages
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Nov 05 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-21
- fix programming mistakes detected by static analysis
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Apr 20 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-19
- fix crash caused by mistakenly enabled leaf optimization (#1558249)
* Tue Mar 06 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-18
- fix build failure with glibc-2.28
* Mon Feb 19 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-17
- add explicit BR for the gcc compiler
* Mon Feb 12 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-16
- import gnulib's FTS module from upstream commit 281b825e (#1544429)
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Mar 02 2017 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-12
- drop ppc64le workaround no longer needed (#1417753)
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Jan 30 2017 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-10
- avoid using broken memcmp() code that gcc generates on ppc64le (#1417753)
* Fri Jan 27 2017 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-9
- add explicit BR for git as we use it in %%prep
* Fri Sep 16 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-8
- disable leaf optimization for NFS (#1299169)
* Fri Jun 24 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-7
- bump release to preserve upgrade path f24 -> f25
* Fri Jun 17 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-6
- use %%autosetup to create a git repo in %%prep
- use out of source build
- avoid SIGSEGV in case the internal -noop option is used (#1346471)
* Tue May 31 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-5
- make sure that find -exec + passes all arguments (upstream bug #48030)
* Mon Apr 18 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-4
- clarify exit status handling of -exec cmd {} + in find(1) man page (#1325049)
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jan 06 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-2
- prevent test-isinf from failing with gcc-5.3.1 on ppc64le (#1294016)
- prevent mbrtowc tests from failing (#1294016)
* Tue Dec 29 2015 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-1
- new upstream release
- drop oldfind(1) no longer supported by upstream
* Fri Dec 25 2015 Kamil Dudka <kdudka@redhat.com> - 1:4.5.16-1
- new upstream release
* Mon Dec 21 2015 Kamil Dudka <kdudka@redhat.com> - 1:4.5.15-2
- enable leaf optimization for XFS and NFS (#1252549)
* Sat Dec 19 2015 Kamil Dudka <kdudka@redhat.com> - 1:4.5.15-1
- new upstream release
* Tue Jul 07 2015 Kamil Dudka <kdudka@redhat.com> - 1:4.5.14-7
- make the test-suite ready for Perl 5.22 (#1239501)
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.5.14-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Wed Mar 18 2015 Kamil Dudka <kdudka@redhat.com> - 1:4.5.14-5
- make the test-suite ready for Python 3
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 1:4.5.14-4
- Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
* Mon Feb 16 2015 Kamil Dudka <kdudka@redhat.com> - 1:4.5.14-3
- fix a crash triggered by recursive bind mount (#1188498)
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.5.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Mon Jul 21 2014 Kamil Dudka <kdudka@redhat.com> - 1:4.5.14-1
- new upstream release
* Wed Jul 16 2014 Kamil Dudka <kdudka@redhat.com> - 1:4.5.13-1
- new upstream release
* Sat Jul 12 2014 Tom Callaway <spot@fedoraproject.org> - 1:4.5.12-6
- fix license handling
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.5.12-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon Jun 02 2014 Kamil Dudka <kdudka@redhat.com> 1:4.5.12-4
- eliminate failure of gnulib tests on little-endian PowerPC (#1083145)
* Sat May 31 2014 Peter Robinson <pbrobinson@fedoraproject.org> 1:4.5.12-3
- drop ChangeLog, the NEWS file contains details back to 1993 to satisfy even
the most bored sysadmin
* Mon Sep 23 2013 Kamil Dudka <kdudka@redhat.com> - 1:4.5.12-2
- silence GCC warnings
* Mon Sep 23 2013 Kamil Dudka <kdudka@redhat.com> - 1:4.5.12-1
- new upstream release
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.5.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 10 2013 Kamil Dudka <kdudka@redhat.com> - 1:4.5.11-3
- remove findutils-4.4.2-autofs.patch no longer needed
* Tue Jul 09 2013 Kamil Dudka <kdudka@redhat.com> - 1:4.5.11-2
- remove support for obsolete -perm +MODE syntax (#982503)
* Sun Feb 03 2013 Kamil Dudka <kdudka@redhat.com> - 1:4.5.11-1
- new upstream release
* Tue Aug 28 2012 Kamil Dudka <kdudka@redhat.com> - 1:4.5.10-7
- fix specfile issues reported by the fedora-review script
- do not use the AM_C_PROTOTYPES macro (removed in Automake 1.12)
- do not require gets() to be declared
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.5.10-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Wed May 16 2012 Kamil Dudka <kdudka@redhat.com> - 1:4.5.10-5
- add virtual provides for bundled(gnulib) copylib (#821753)
* Wed Jan 25 2012 Harald Hoyer <harald@redhat.com> 1:4.5.10-4
- add filesystem guard
* Wed Jan 25 2012 Harald Hoyer <harald@redhat.com> 1:4.5.10-3
- install everything in /usr
https://fedoraproject.org/wiki/Features/UsrMove
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.5.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed May 11 2011 Kamil Dudka <kdudka@redhat.com> - 1:4.5.10-1
- new upstream release
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:4.5.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon May 24 2010 Kamil Dudka <kdudka@redhat.com> - 1:4.5.9-2
- fix some bugs in handling of -execdir (Savannah bug #29949)
* Wed May 05 2010 Kamil Dudka <kdudka@redhat.com> - 1:4.5.9-1
- new upstream release, dropped applied patches
* Tue Apr 06 2010 Kamil Dudka <kdudka@redhat.com> - 1:4.5.7-4
- avoid assertion failure due to access permissions (#579476)

View File

@ -1 +1 @@
abe3035556f2b95a83cd4a99d1614e37 findutils-4.5.7.tar.gz
SHA512 (findutils-4.9.0.tar.xz) = ba4844f4403de0148ad14b46a3dbefd5a721f6257c864bf41a6789b11705408524751c627420b15a52af95564d8e5b52f0978474f640a62ab86a41d20cf14be9

63
tests/smoke/Makefile Normal file
View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/findutils/Sanity/smoke
# Description: Smoke test for find and xargs.
# Author: Branislav Nater <bnater@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/findutils/Sanity/smoke
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Branislav Nater <bnater@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Smoke test for find and xargs." >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: findutils" >> $(METADATA)
@echo "Requires: findutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

3
tests/smoke/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of /CoreOS/findutils/Sanity/smoke
Description: Smoke test for find and xargs.
Author: Branislav Nater <bnater@redhat.com>

64
tests/smoke/runtest.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/findutils/Sanity/smoke
# Description: Smoke test for find and xargs.
# Author: Branislav Nater <bnater@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include rhts environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/lib/beakerlib/beakerlib.sh || exit 1
PACKAGE="findutils"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "touch \"file with spaces\"" 0
rlRun "mkdir dir" 0
rlRun "touch dir/file1" 0
rlPhaseEnd
rlGetTestState && {
rlPhaseStartTest
rlRun "find . -name \"file*\" -type f | tee output | wc -l > wcout" 0
cat output
rlAssertGrep 2 wcout
rlRun "find $TmpDir -mindepth 1 -type d | tee output | wc -l > wcout" 0
cat output
rlAssertGrep 1 wcout
rlRun "find $TmpDir -name \"file*\" -print0 | xargs -0 ls -l | tee output | wc -l > wcout" 0
cat output
rlAssertGrep 2 wcout
rlPhaseEnd
}
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalEnd
rlJournalPrintText

14
tests/tests.yml Normal file
View File

@ -0,0 +1,14 @@
---
# Tests which will run in all contexts
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
- atomic
tests:
- smoke
- xautofs
required_packages:
- autofs # autofs required for xautofs test

65
tests/xautofs/Makefile Normal file
View File

@ -0,0 +1,65 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/findutils/Sanity/options/xautofs
# Description: Check xautofs option
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/findutils/Sanity/options/xautofs
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Branislav Nater <bnater@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Check xautofs option" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: findutils" >> $(METADATA)
@echo "Requires: autofs findutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 485672 529391" >> $(METADATA)
@echo "Releases: -RHEL3 -RHEL4" >> $(METADATA)
rhts-lint $(METADATA)

8
tests/xautofs/PURPOSE Normal file
View File

@ -0,0 +1,8 @@
PURPOSE of /CoreOS/findutils/Sanity/options/xautofs
Description: Check xautofs option
Author: Petr Splichal <psplicha@redhat.com>
Bug summary: [RFE] Modify find to be able to skip direct mapped autofs mounts
Bugzilla link: None
Check that the new -xautofs option works as expected: make sure
find does not descend into directories on autofs filesystems.

90
tests/xautofs/runtest.sh Executable file
View File

@ -0,0 +1,90 @@
#!/bin/bash
# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/findutils/Sanity/options/xautofs
# Description: Check xautofs option
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include rhts environment
. /usr/bin/rhts-environment.sh
. /usr/share/rhts-library/rhtslib.sh
PACKAGE="findutils"
MasterConf="/etc/auto.master"
DirectConf="/etc/auto.direct"
MountDir="/mnt/findutils"
AutomountDir="$MountDir/etc"
RegularDir="$MountDir/regular/directory/master"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlAssertRpm "autofs"
rlRun "set -o pipefail"
# create dirs & back up
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "mkdir -p $RegularDir" 0 "Creating regular directory"
rlRun "rlFileBackup $MasterConf"
# set up autofs
rlRun "echo '/- /etc/auto.direct' > $MasterConf" \
0 "Setting up autofs master map"
rlRun "echo '$AutomountDir localhost:/etc' > $DirectConf" \
0 "Setting up autofs direct map"
# RHEL-7 is using xfs
rlIsRHEL 4 5 6 && fs="ext[34]" || fs="xfs"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest "Without -xautofs option"
rlRun "rlServiceStart autofs" 0 "Starting autofs"
rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts"
rlRun "find $MountDir -noleaf -name '*master*' | tee filelist"
rlAssertGrep "$RegularDir" "filelist"
rlAssertGrep "$MountDir$MasterConf" "filelist"
rlAssertGrep "$AutomountDir.*$fs" "/proc/mounts"
rlPhaseEnd
rlPhaseStartTest "With -xautofs option"
rlRun "rlServiceStart autofs" 0 "Starting autofs"
rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts"
rlRun "find $MountDir -xautofs -noleaf -name '*master*' | tee filelist"
rlAssertGrep "$RegularDir" "filelist"
rlAssertNotGrep "$MountDir$MasterConf" "filelist"
rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rlFileRestore"
rlRun "rlServiceRestore autofs"
rlRun "rm -r $TmpDir $DirectConf $MountDir" 0 "Removing tmp files"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd