diff options
author | Dexuan Cui <dexuan.cui@intel.com> | 2010-08-20 20:40:23 +0800 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-27 13:04:38 +0100 |
commit | 9f03fdd5c749cf7b9a971ffbf610bc4f001853af (patch) | |
tree | 19d0926608e4a8db808149713bc917509cf9c292 /meta-lsb | |
parent | 03df3137156027cf01ce2e9970749268f16f5975 (diff) | |
download | openembedded-core-9f03fdd5c749cf7b9a971ffbf610bc4f001853af.tar.gz openembedded-core-9f03fdd5c749cf7b9a971ffbf610bc4f001853af.tar.bz2 openembedded-core-9f03fdd5c749cf7b9a971ffbf610bc4f001853af.zip |
which: add GPLv2 version 2.18
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'meta-lsb')
-rw-r--r-- | meta-lsb/packages/which/which-2.18/fix_name_conflict_group_member.patch | 51 | ||||
-rw-r--r-- | meta-lsb/packages/which/which_2.18.bb | 40 |
2 files changed, 91 insertions, 0 deletions
diff --git a/meta-lsb/packages/which/which-2.18/fix_name_conflict_group_member.patch b/meta-lsb/packages/which/which-2.18/fix_name_conflict_group_member.patch new file mode 100644 index 0000000000..568d4233fd --- /dev/null +++ b/meta-lsb/packages/which/which-2.18/fix_name_conflict_group_member.patch @@ -0,0 +1,51 @@ +# glibc also implements the function group_member. To avoid name conflict, +# here let us append a "_" to which's version. +# +# Signed-off-by Dexuan Cui <dexuan.cui@intel.com>, 2010-08-20 +# (this patch is licensed under GPLv2) + +--- which-2.18/bash.c ++++ which-2.18/bash.c +@@ -45,7 +45,12 @@ + * - changed all occurences of 'gid_t' into 'GID_T'. + * - exported functions needed in which.c + */ +-static int group_member (GID_T gid); ++ ++/* ++ * glibc also implements the function group_member. To avoid name conflict, ++ * here let us append a "_" to which's version. ++ */ ++static int _group_member (GID_T gid); + static char* extract_colon_unit (char const* string, int *p_index); + + /*=========================================================================== +@@ -200,8 +205,8 @@ + + /* From bash-2.05b / general.c / line 805 */ + /* Return non-zero if GID is one that we have in our groups list. */ +-int +-group_member (GID_T gid) ++static int ++_group_member (GID_T gid) + { + #if defined (HAVE_GETGROUPS) + register int i; +@@ -290,7 +295,7 @@ + return (X_BIT (u_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS; + + /* Otherwise, if we are in the owning group, the group permissions apply. */ +- if (group_member (finfo.st_gid)) ++ if (_group_member (finfo.st_gid)) + return (X_BIT (g_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS; + + /* Otherwise, if we are in the other group, the other permissions apply. */ +@@ -331,7 +336,7 @@ + /* Given a string containing units of information separated by colons, + return the next one pointed to by (P_INDEX), or NULL if there are no more. + Advance (P_INDEX) to the character after the colon. */ +-char* ++static char* + extract_colon_unit (char const* string, int* p_index) + { + int i, start, len; diff --git a/meta-lsb/packages/which/which_2.18.bb b/meta-lsb/packages/which/which_2.18.bb new file mode 100644 index 0000000000..b177949788 --- /dev/null +++ b/meta-lsb/packages/which/which_2.18.bb @@ -0,0 +1,40 @@ +DESCRIPTION = "Which is a utility that prints out the full path of the \ +executables that bash(1) would execute when the passed \ +program names would have been entered on the shell prompt. \ +It does this by using the exact same algorithm as bash." +HOMEPAGE = "http://www.xs4all.nl/~carlo17/which/" +BUGTRACKER = "n/a" + +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" + +PR = "r0" + +SRC_URI = "http://www.xs4all.nl/~carlo17/which/which-${PV}.tar.gz \ + file://fix_name_conflict_group_member.patch" + +DEPENDS = "cwautomacros-native" + +inherit autotools + +do_configure_prepend() { + OLD="@ACLOCAL_CWFLAGS@" + NEW="-I ${STAGING_DIR_NATIVE}/${datadir}/cwautomacros/m4" + sed -i "s#${OLD}#${NEW}#g" `grep -rl ${OLD} ${S}` +} +do_install_append() { + mv ${D}/${bindir}/which ${D}/${bindir}/which.${PN} +} + +pkg_postinst_${PN}() { + if [ "${PN}" = "${BPN}" ] ; then + update-alternatives --install ${bindir}/which which which.${PN} 100 + fi +} + +pkg_prerm_${PN}() { + if [ "${PN}" = "${BPN}" ] ; then + update-alternatives --remove which which.${PN} + fi +} + |