diff options
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/file')
4 files changed, 137 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch new file mode 100644 index 000000000..8a16b2cf7 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch @@ -0,0 +1,39 @@ +From 08abf944b2bff27b6dd325dd15b4861cebef113a Mon Sep 17 00:00:00 2001 +From: Junling Zheng <zhengjunling@huawei.com> +Date: Wed, 8 Apr 2015 03:26:57 +0000 +Subject: [PATCH] Add -P prompt into Usage info + +Currently, Usage info doesn't include -P prompt, add it: + +root@arma9el:~# file +Usage: file [-bcEhikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type] + [-e testname] [-F separator] [-f namefile] [-m magicfiles] + [-P parameter=limits] file ... + file -C [-m magicfiles] + file [--help] + +Upstream-Status: Submitted + +Signed-off-by: Junling Zheng <zhengjunling@huawei.com> +--- + src/file.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/file.c b/src/file.c +index 2b15e21..e5a957b 100644 +--- a/src/file.c ++++ b/src/file.c +@@ -76,8 +76,8 @@ int getopt_long(int argc, char * const *argv, const char *optstring, const struc + # define USAGE \ + "Usage: %s [" FILE_FLAGS \ + "] [--apple] [--extension] [--mime-encoding] [--mime-type]\n" \ +- " [-e testname] [-F separator] [-f namefile] [-m magicfiles] " \ +- "file ...\n" \ ++ " [-e testname] [-F separator] [-f namefile] [-m magicfiles]\n " \ ++ " [-P parameter=limits] file ...\n" \ + " %s -C [-m magicfiles]\n" \ + " %s [--help]\n" + +-- +1.8.3.4 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch new file mode 100644 index 000000000..1ef485e93 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file/debian-742262.patch @@ -0,0 +1,19 @@ +The awk pattern was checked *before* the Perl pattern, so the perl +script with BEGIN{...} would be reported as awk, this patch fixes it. + +Upstream-Status: Backport [debian] + +Signed-off-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de> +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- +diff --git a/magic/Magdir/commands b/magic/Magdir/commands +--- a/magic/Magdir/commands ++++ b/magic/Magdir/commands +@@ -57,6 +57,7 @@ + 0 string/wt #!\ /usr/bin/awk awk script text executable + !:mime text/x-awk + 0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk or perl script text ++!:strength - 12 + + # AT&T Bell Labs' Plan 9 shell + 0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch b/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch new file mode 100644 index 000000000..a7efbdcbc --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file/host-file.patch @@ -0,0 +1,32 @@ +Upstream-Status: Submitted (http://bugs.gw.com/view.php?id=485) +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From 3cde199d03b39632361c275cd30fa0612a03138b Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Mon, 19 Oct 2015 10:30:57 +0100 +Subject: [PATCH 2/2] When using the host file, respect FILE_COMPILE + +If we're cross-compiling and not using the file binary that was just built, +execute the binary that we've been told to use (via FILE_COMPILE) when checking +the version instead of assuming that "file" is correct as the actual compile +uses FILE_COMPILE so different binaries may be used. +--- + magic/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/magic/Makefile.am b/magic/Makefile.am +index 89ac844..67067fe 100644 +--- a/magic/Makefile.am ++++ b/magic/Makefile.am +@@ -293,7 +293,7 @@ ${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP) + @(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \ + echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \ + else \ +- v=$$(file --version | sed -e s/file-// -e q); \ ++ v=$$(${FILE_COMPILE} --version | sed -e s/file-// -e q); \ + if [ "$$v" != "${PACKAGE_VERSION}" ]; then \ + echo "Cannot use the installed version of file ($$v) to"; \ + echo "cross-compile file ${PACKAGE_VERSION}"; \ +-- +2.1.4 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb new file mode 100644 index 000000000..68bad69b4 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/file/file_5.25.bb @@ -0,0 +1,47 @@ +SUMMARY = "File classification tool" +DESCRIPTION = "File attempts to classify files depending \ +on their contents and prints a description if a match is found." +HOMEPAGE = "http://www.darwinsys.com/file/" +SECTION = "console/utils" + +# two clause BSD +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=6a7382872edb68d33e1a9398b6e03188" + +DEPENDS = "zlib file-replacement-native" +DEPENDS_class-native = "zlib-native" + +# Blacklist a bogus tag in upstream check +UPSTREAM_CHECK_GITTAGREGEX = "FILE(?P<pver>(?!6_23).+)" + +SRC_URI = "git://github.com/file/file.git \ + file://debian-742262.patch \ + file://0001-Add-P-prompt-into-Usage-info.patch \ + file://host-file.patch \ + " + +SRCREV = "f45db89ddc91692b662fffbabbdafc7bc4c00f5e" +S = "${WORKDIR}/git" + +inherit autotools + +EXTRA_OEMAKE_append_class-target = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file" +EXTRA_OEMAKE_append_class-nativesdk = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file" + +FILES_${PN} += "${datadir}/misc/*.mgc" + +do_install_append_class-native() { + create_cmdline_wrapper ${D}/${bindir}/file \ + --magic-file ${datadir}/misc/magic.mgc +} + +do_install_append_class-nativesdk() { + create_cmdline_wrapper ${D}/${bindir}/file \ + --magic-file ${datadir}/misc/magic.mgc +} + +BBCLASSEXTEND = "native nativesdk" +PROVIDES_append_class-native = " file-replacement-native" +# Don't use NATIVE_PACKAGE_PATH_SUFFIX as that hides libmagic from anyone who +# depends on file-replacement-native. +bindir_append_class-native = "/file-native" |