Accepting request 36633 from Base:System
Copy from Base:System/findutils based on submit request 36633 from user psmt OBS-URL: https://build.opensuse.org/request/show/36633 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/findutils?expand=0&rev=19
This commit is contained in:
parent
f4156229cc
commit
e794516f62
@ -1,88 +0,0 @@
|
||||
Index: findutils-4.4.2/find/fstype.c
|
||||
===================================================================
|
||||
--- findutils-4.4.2.orig/find/fstype.c
|
||||
+++ findutils-4.4.2/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
|
||||
}
|
||||
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);
|
||||
|
13
findutils-prune_unknown.patch
Normal file
13
findutils-prune_unknown.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: locate/updatedb.sh
|
||||
===================================================================
|
||||
--- locate/updatedb.sh.orig 2010-04-01 12:46:24.000000000 +0200
|
||||
+++ locate/updatedb.sh 2010-04-01 12:47:09.919511262 +0200
|
||||
@@ -228,7 +228,7 @@ done
|
||||
|
||||
PATH=/bin:/usr/bin:${BINDIR}; export PATH
|
||||
|
||||
-: ${PRUNEFS="nfs NFS proc afs smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs sysfs shfs cifs 9P"}
|
||||
+: ${PRUNEFS="nfs NFS proc afs smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs sysfs shfs cifs 9P unknown"}
|
||||
|
||||
if test -n "$PRUNEFS"; then
|
||||
prunefs_exp=`echo $PRUNEFS |sed -e 's/\([^ ][^ ]*\)/-fstype \1 -o/g'`
|
17
findutils-use_proc_mounts.patch
Normal file
17
findutils-use_proc_mounts.patch
Normal file
@ -0,0 +1,17 @@
|
||||
Index: gnulib/lib/mountlist.c
|
||||
===================================================================
|
||||
--- gnulib/lib/mountlist.c.orig 2007-12-02 12:57:51.000000000 +0100
|
||||
+++ gnulib/lib/mountlist.c 2010-04-01 12:20:56.784502964 +0200
|
||||
@@ -60,7 +60,11 @@
|
||||
# include <mntent.h>
|
||||
# if !defined MOUNTED
|
||||
# if defined _PATH_MOUNTED /* GNU libc */
|
||||
-# define MOUNTED _PATH_MOUNTED
|
||||
+# if defined __linux__
|
||||
+# define MOUNTED "/proc/mounts"
|
||||
+# else
|
||||
+# define MOUNTED _PATH_MOUNTED
|
||||
+# endif
|
||||
# endif
|
||||
# if defined MNT_MNTTAB /* HP-UX. */
|
||||
# define MOUNTED MNT_MNTTAB
|
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 1 12:22:10 CEST 2010 - pth@suse.de
|
||||
|
||||
- Use /proc/mounts instead of /etc/mtab as in newer kernels autofs
|
||||
entries appear only in the former (bnc#591460)
|
||||
- updatedb will by default ignore filesystems where it can't determine the
|
||||
type.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 8 18:53:10 CET 2010 - prusnak@suse.cz
|
||||
|
||||
|
@ -22,15 +22,15 @@ Url: http://www.gnu.org/software/findutils/
|
||||
License: GPLv3+
|
||||
Group: Productivity/File utilities
|
||||
Version: 4.4.2
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: The GNU versions of find utilities (find and xargs)
|
||||
# retreived from http://ftp.gnu.org/pub/gnu/findutils/findutils-4.4.2.tar.gz
|
||||
Source: findutils-%{version}.tar.bz2
|
||||
Source1: sysconfig.locate
|
||||
Source2: cron.daily.updatedb
|
||||
# learn find to recognize autofs file system by reading /proc/mounts
|
||||
# as autofs mount points are not listed in /etc/mtab
|
||||
Patch0: findutils-4.4.2-autofs.patch
|
||||
# Use /proc/mounts instead of /etc/mtab as autofs entries are only
|
||||
# listed in the kernels >= 2.6.32
|
||||
Patch0: findutils-use_proc_mounts.patch
|
||||
# adds a new option -xautofs to find to not descend into directories on autofs file systems
|
||||
Patch1: findutils-4.4.2-xautofs.patch
|
||||
# patch accepted by gnulib upstream - rhbz#538536
|
||||
@ -42,6 +42,7 @@ Patch3: findutils-4.4.2-selinux.patch
|
||||
# the following patch will be no longer needed
|
||||
Patch4: findutils-4.4.2-selinux-gnulib.patch
|
||||
Patch5: findutils-4.4.2-updatedb.patch
|
||||
Patch6: findutils-prune_unknown.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%if 0%{?suse_version} > 1100
|
||||
BuildRequires: libselinux-devel
|
||||
@ -83,12 +84,13 @@ switching on the computer.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch0
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5
|
||||
%patch6
|
||||
|
||||
%build
|
||||
autoreconf
|
||||
|
Loading…
Reference in New Issue
Block a user