summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/which
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/which')
-rw-r--r--meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch53
-rw-r--r--meta/recipes-extended/which/which-2.20/remove-declaration.patch18
-rw-r--r--meta/recipes-extended/which/which_2.18.bb32
-rw-r--r--meta/recipes-extended/which/which_2.20.bb31
4 files changed, 134 insertions, 0 deletions
diff --git a/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch b/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
new file mode 100644
index 0000000000..fb9b1a4083
--- /dev/null
+++ b/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
@@ -0,0 +1,53 @@
1Upstream-Status: Inappropriate [this is 2.18(GPLv2) specific]
2
3# glibc also implements the function group_member. To avoid name conflict,
4# here let us append a "_" to which's version.
5#
6# Signed-off-by Dexuan Cui <dexuan.cui@intel.com>, 2010-08-20
7# (this patch is licensed under GPLv2)
8
9--- which-2.18/bash.c
10+++ which-2.18/bash.c
11@@ -45,7 +45,12 @@
12 * - changed all occurences of 'gid_t' into 'GID_T'.
13 * - exported functions needed in which.c
14 */
15-static int group_member (GID_T gid);
16+
17+/*
18+ * glibc also implements the function group_member. To avoid name conflict,
19+ * here let us append a "_" to which's version.
20+ */
21+static int _group_member (GID_T gid);
22 static char* extract_colon_unit (char const* string, int *p_index);
23
24 /*===========================================================================
25@@ -200,8 +205,8 @@
26
27 /* From bash-2.05b / general.c / line 805 */
28 /* Return non-zero if GID is one that we have in our groups list. */
29-int
30-group_member (GID_T gid)
31+static int
32+_group_member (GID_T gid)
33 {
34 #if defined (HAVE_GETGROUPS)
35 register int i;
36@@ -290,7 +295,7 @@
37 return (X_BIT (u_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
38
39 /* Otherwise, if we are in the owning group, the group permissions apply. */
40- if (group_member (finfo.st_gid))
41+ if (_group_member (finfo.st_gid))
42 return (X_BIT (g_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
43
44 /* Otherwise, if we are in the other group, the other permissions apply. */
45@@ -331,7 +336,7 @@
46 /* Given a string containing units of information separated by colons,
47 return the next one pointed to by (P_INDEX), or NULL if there are no more.
48 Advance (P_INDEX) to the character after the colon. */
49-char*
50+static char*
51 extract_colon_unit (char const* string, int* p_index)
52 {
53 int i, start, len;
diff --git a/meta/recipes-extended/which/which-2.20/remove-declaration.patch b/meta/recipes-extended/which/which-2.20/remove-declaration.patch
new file mode 100644
index 0000000000..d3340a3530
--- /dev/null
+++ b/meta/recipes-extended/which/which-2.20/remove-declaration.patch
@@ -0,0 +1,18 @@
1Remove the declaration of group_member since it has already been
2declared in unistd.h
3
4Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
5
6Upstream-Status: Inappropriate [embedded specific]
7
8diff -ruN which-2.20-orig/bash.c which-2.20/bash.c
9--- which-2.20-orig/bash.c 2010-08-03 12:59:08.897088878 +0800
10+++ which-2.20/bash.c 2010-08-03 13:17:23.406097212 +0800
11@@ -46,7 +46,6 @@
12 * - changed all occurences of 'gid_t' into 'GID_T'.
13 * - exported functions needed in which.c
14 */
15-static int group_member (GID_T gid);
16 static char* extract_colon_unit (char const* string, int* p_index);
17
18 /*===========================================================================
diff --git a/meta/recipes-extended/which/which_2.18.bb b/meta/recipes-extended/which/which_2.18.bb
new file mode 100644
index 0000000000..4f780100b3
--- /dev/null
+++ b/meta/recipes-extended/which/which_2.18.bb
@@ -0,0 +1,32 @@
1SUMMARY = "Displays the full path of shell commands"
2DESCRIPTION = "Which is a utility that prints out the full path of the \
3executables that bash(1) would execute when the passed \
4program names would have been entered on the shell prompt. \
5It does this by using the exact same algorithm as bash."
6SECTION = "libs"
7HOMEPAGE = "http://carlo17.home.xs4all.nl/which/"
8
9LICENSE = "GPLv2+"
10LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
11
12PR = "r2"
13
14SRC_URI = "http://www.xs4all.nl/~carlo17/which/which-${PV}.tar.gz \
15 file://fix_name_conflict_group_member.patch"
16
17SRC_URI[md5sum] = "42d51938e48b91f6e19fabf216f5c3e9"
18SRC_URI[sha256sum] = "9445cd7e02ec0c26a44fd56098464ded064ba5d93dd2e15ec12410ba56b2e544"
19
20DEPENDS = "cwautomacros-native"
21
22inherit autotools update-alternatives
23
24do_configure_prepend() {
25 OLD="@ACLOCAL_CWFLAGS@"
26 NEW="-I ${STAGING_DIR_NATIVE}/${datadir}/cwautomacros/m4"
27 sed -i "s#${OLD}#${NEW}#g" `grep -rl ${OLD} ${S}`
28}
29
30ALTERNATIVE_${PN} = "which"
31ALTERNATIVE_PRIORITY = "100"
32
diff --git a/meta/recipes-extended/which/which_2.20.bb b/meta/recipes-extended/which/which_2.20.bb
new file mode 100644
index 0000000000..f4e87de76b
--- /dev/null
+++ b/meta/recipes-extended/which/which_2.20.bb
@@ -0,0 +1,31 @@
1SUMMARY = "Displays the full path of shell commands"
2DESCRIPTION = "Which is a utility that prints out the full path of the \
3executables that bash(1) would execute when the passed \
4program names would have been entered on the shell prompt. \
5It does this by using the exact same algorithm as bash."
6SECTION = "libs"
7HOMEPAGE = "http://carlo17.home.xs4all.nl/which/"
8
9LICENSE = "GPLv3+"
10LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
11 file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2"
12DEPENDS = "cwautomacros-native"
13
14inherit autotools update-alternatives
15
16PR = "r3"
17
18EXTRA_OECONF = "--disable-iberty"
19
20SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \
21 file://remove-declaration.patch"
22
23SRC_URI[md5sum] = "95be0501a466e515422cde4af46b2744"
24SRC_URI[sha256sum] = "d417b65c650d88ad26a208293c1c6e3eb60d4b6d847f01ff8f66aca63e2857f8"
25
26do_configure_prepend() {
27 sed -i -e 's%@ACLOCAL_CWFLAGS@%-I ${STAGING_DIR_NATIVE}/usr/share/cwautomacros/m4%g' ${S}/Makefile.am ${S}/tilde/Makefile.am
28}
29
30ALTERNATIVE_${PN} = "which"
31ALTERNATIVE_PRIORITY = "100"