This commit is contained in:
Than Ngo 2008-01-25 10:56:15 +00:00
parent b24b69cdd7
commit edbfee2288
5 changed files with 48 additions and 77 deletions

View File

@ -1,40 +0,0 @@
--- which-2.16/bash.c.afs 2003-09-15 03:58:55.000000000 +0200
+++ which-2.16/bash.c 2003-09-24 23:40:25.000000000 +0200
@@ -33,7 +33,6 @@
*/
#define HAVE_GETGROUPS
#undef SHELL
-#undef AFS
#undef NOGROUP
/*
@@ -253,7 +252,7 @@
if (S_ISDIR (finfo.st_mode))
return (FS_EXISTS|FS_DIRECTORY);
-#if defined (AFS)
+ if (getenv("AFS")) {
/* We have to use access(2) to determine access because AFS does not
support Unix file system semantics. This may produce wrong
answers for non-AFS files when ruid != euid. I hate AFS. */
@@ -261,8 +260,9 @@
return (FS_EXISTS | FS_EXECABLE);
else
return (FS_EXISTS);
-#else /* !AFS */
-
+ }
+ else /* !AFS */
+ {
/* Find out if the file is actually executable. By definition, the
only other criteria is that the file has an execute bit set that
we can use. */
@@ -298,7 +298,7 @@
return (FS_EXISTS | FS_EXECABLE);
return (FS_EXISTS);
-#endif /* !AFS */
+ } /* !AFS */
}
/* From bash-2.05b / general.c / line 501 ; Changes: Using 'strchr' instead of 'xstrchr'. */

View File

@ -1,14 +0,0 @@
--- which-2.14/tilde/tilde.c.orig Mon Dec 9 18:52:19 2002
+++ which-2.14/tilde/tilde.c Mon Dec 9 18:58:09 2002
@@ -182,7 +182,10 @@
int result_size, result_index;
result_index = result_size = 0;
- if (result = strchr (string, '~'))
+
+ result = strchr (string, '~');
+
+ if (!result)
result = xmalloc (result_size = (strlen (string) + 16));
else
result = xmalloc (result_size = (strlen (string) + 1));

View File

@ -1,15 +0,0 @@
diff -up which-2.18/which.texinfo.direntry which-2.18/which.texinfo
--- which-2.18/which.texinfo.direntry 2007-11-26 15:37:28.000000000 +0100
+++ which-2.18/which.texinfo 2007-11-26 15:39:09.000000000 +0100
@@ -43,6 +43,11 @@ original English.
@c !END COPYING
@end ifinfo
+@dircategory Individual utilities
+@direntry
+* which: (which)which invocation. Shows the full path of commands
+@end direntry
+
@titlepage
@title Which
@subtitle Show the full path of commands

41
which-2.19-afs.patch Normal file
View File

@ -0,0 +1,41 @@
diff -up which-2.19/bash.c.afs which-2.19/bash.c
--- which-2.19/bash.c.afs 2008-01-18 19:03:40.000000000 +0100
+++ which-2.19/bash.c 2008-01-25 11:41:14.000000000 +0100
@@ -34,7 +34,6 @@
*/
#define HAVE_GETGROUPS
#undef SHELL
-#undef AFS
#undef NOGROUP
/*
@@ -251,7 +250,7 @@ file_status (char const* name)
r = FS_EXISTS;
-#if defined (AFS)
+ if (getenv("AFS")) {
/* We have to use access(2) to determine access because AFS does not
support Unix file system semantics. This may produce wrong
answers for non-AFS files when ruid != euid. I hate AFS. */
@@ -261,8 +260,9 @@ file_status (char const* name)
r |= FS_READABLE;
return r;
-#else /* !AFS */
-
+ }
+ else /* !AFS */
+ {
/* Find out if the file is actually executable. By definition, the
only other criteria is that the file has an execute bit set that
we can use. The same with whether or not a file is readable. */
@@ -305,7 +305,7 @@ file_status (char const* name)
}
return r;
-#endif /* !AFS */
+ } /* !AFS */
}
/* From bash-3.2 / general.c / line 534 ; Changes: Using 'strchr' instead of 'xstrchr'. */

View File

@ -1,16 +1,14 @@
Summary: Displays where a particular program in your path is located Summary: Displays where a particular program in your path is located
Name: which Name: which
Version: 2.18 Version: 2.19
Release: 5%{?dist} Release: 1%{?dist}
License: GPLv2 License: GPLv3
Group: Applications/System Group: Applications/System
Source0: http://www.xs4all.nl/~carlo17/which/%{name}-%{version}.tar.gz Source0: http://www.xs4all.nl/~carlo17/which/%{name}-%{version}.tar.gz
Source1: which2.sh Source1: which2.sh
Source2: which2.csh Source2: which2.csh
Url: http://www.xs4all.nl/~carlo17/which/ Url: http://www.xs4all.nl/~carlo17/which/
Patch: which-2.13-afs.patch Patch: which-2.19-afs.patch
Patch1: which-2.14-broken.patch
Patch2: which-2.18-direntry.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(preun): /sbin/install-info Requires(preun): /sbin/install-info
Requires(post): /sbin/install-info Requires(post): /sbin/install-info
@ -23,8 +21,6 @@ the specified program is in your PATH.
%setup -q %setup -q
%patch -p1 -b .afs %patch -p1 -b .afs
%patch1 -p1 -b .broken
%patch2 -p1 -b .direntry
%build %build
%configure %configure
@ -60,6 +56,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/*/* %{_mandir}/*/*
%changelog %changelog
* Fri Jan 25 2008 Than Ngo <than@redhat.com> 2.19-1
- 2.19, fix #399551, #430159
* Tue Nov 27 2007 Than Ngo <than@redhat.com> - 2.18-5 * Tue Nov 27 2007 Than Ngo <than@redhat.com> - 2.18-5
- fix permission which-2 scripts - fix permission which-2 scripts