Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH V2 0/4] man/info: fix not support xz/bz2 compression
@ 2014-09-24 11:38 Hongxu Jia
  2014-09-24 11:38 ` [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir Hongxu Jia
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Hongxu Jia @ 2014-09-24 11:38 UTC (permalink / raw)
  To: openembedded-core, mark.hatle, richard.purdie, ross.burton

Changed in V2:
- Conditionally add 'gzip/bzip2/xz' to man/info's RDEPENDS
  rather than modify busybox's defconfig.

- Refer Ubuntu to add a script to postinst_intercept to
  run it after all packages have been installed at build time.

Test Case:

vim local.conf
..
IMAGE_INSTALL_append = " man man-doc texinfo texinfo-doc info info-doc"
INHERIT += "compress_doc"
DOC_COMPRESS = "xz" or DOC_COMPRESS = "bz2"
..

bitbake core-image-minimal

runqemu qemux86

On target,
...
root@qemux86:~# man man

root@qemux86:~# info info
...

//Hongxu

The following changes since commit 8ac8eca2e3bd8c78e2b31ea974930ed0243258a3:

  build-appliance-image: Update to dizzy head revision (2014-09-23 22:10:26 +0100)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib hongxu/fix-doc
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-doc

Hongxu Jia (4):
  scripts/postinst-intercepts: add update_info_dir
  texinfo: fix QA Error while doc compress enabled
  texinfo: fix info not work
  man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS

 meta/recipes-extended/man/man_1.6g.bb        | 13 +++++
 meta/recipes-extended/texinfo/texinfo_5.2.bb | 68 +++++++++++++++++++++-
 scripts/postinst-intercepts/update_info_dir  | 84 ++++++++++++++++++++++++++++
 3 files changed, 164 insertions(+), 1 deletion(-)
 create mode 100755 scripts/postinst-intercepts/update_info_dir

-- 
1.9.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir
  2014-09-24 11:38 [PATCH V2 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
@ 2014-09-24 11:38 ` Hongxu Jia
  2014-09-24 14:52   ` Burton, Ross
  2014-09-24 11:38 ` [PATCH 2/4] texinfo: fix QA Error while doc compress enabled Hongxu Jia
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Hongxu Jia @ 2014-09-24 11:38 UTC (permalink / raw)
  To: openembedded-core, mark.hatle, richard.purdie, ross.burton

We need to run it after all packages have been installed. Here is details:

NAME
  update_info_dir - update or create index file from all installed
  info files in directory

SYNOPSIS
  update_info_dir [options] [directory]

DESCRIPTION
  Update, or create, the index file dir of available documentation
  in $D/${infodir} (the default) or in given DIRECTORY. The index
  file info is the directory is usually presented by info browsers
  on startup.

OPTIONS
  -h,--help
    Display help and exit.

SEE ALSO
  emacs(1) info(1) install-info(1)

AUTHOR
  This manual page was written by Norbert Preining <preining@logic.at>,
  for the Debian GNU/Linux system (but may be used by others). This
  manual page was written for the Debian GNU/Linux distribution because
  the original script was designed  for  Debian  packaging system.

Signed-off-by: Norbert Preining <preining@logic.at>

Backport update-info-dir from ubuntu 1404, and add xz/bz2 compression support

[YOCTO #6751]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 scripts/postinst-intercepts/update_info_dir | 84 +++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100755 scripts/postinst-intercepts/update_info_dir

diff --git a/scripts/postinst-intercepts/update_info_dir b/scripts/postinst-intercepts/update_info_dir
new file mode 100755
index 0000000..8ef55ec
--- /dev/null
+++ b/scripts/postinst-intercepts/update_info_dir
@@ -0,0 +1,84 @@
+#!/bin/bash
+# update-info-dir
+# create a dir file from all installed info files
+# Copyright 2009 Norbert Preining
+# GPLv2
+
+INFODIR=$D${infodir}
+
+set -e
+
+#
+# since user's environment is taken over into root account when sudo-ing
+# we don't want that one's user LANGUAGE setting changes the messages in
+# the dir file. Unset LANGUAGE and reload /etc/environment to get
+# the system wide settings. See bug #536476
+unset LANGUAGE
+unset LANG
+if [ -r /etc/environment ] ; then
+  . /etc/environment
+fi
+if [ -r /etc/default/locale ] ; then
+  . /etc/default/locale
+fi
+
+Help ()
+{
+    echo "\
+SYNOPSIS: update-info-dir [-h,--help] [info-directory]
+
+(re-)creates the index of available documentation in info format
+(the file /usr/share/info/dir) which is usually presented by info browsers
+on startup."
+
+    exit 0
+}
+
+
+if [ "$1" = "-h" ] || [ "$1" == "--help" ]; then
+    Help
+fi
+
+if [ -n "$1" ] ; then
+  INFODIR="$1"
+fi
+
+if [ ! -d "$INFODIR" ] ; then
+  echo "Not a directory: $INFODIR." >&2
+  exit 1
+fi
+
+if [ -r "$INFODIR/dir" ] ; then
+  rm -f "$INFODIR/dir.old"
+  cp $INFODIR/dir $INFODIR/dir.old
+fi
+
+# we have to remove the dir file not make ginstall-info being surprised
+rm -f "$INFODIR/dir"
+
+errors=0
+find "$INFODIR" -type f | while read file ; do
+  case $file in
+    */dir|*/dir.old| \
+    *-[0-9]|*-[0-9].gz|*-[0-9].xz|*-[0-9].bz2| \
+    *-[1-9][0-9]|*-[1-9][0-9].gz|*-[1-9][0-9].xz|*-[1-9][0-9].bz2| \
+    *.png)
+      # these files are ignored
+      continue
+      ;;
+    *)
+      ${STAGING_BINDIR_NATIVE}/install-info "$file" "$INFODIR/dir" || {
+        errors=$[errors+1]
+      }
+      ;;
+  esac
+done
+
+if [ $errors -gt 0 ] ; then
+  echo "Updating the index of info documentation produced $errors errors."
+  exit 1
+fi
+
+exit 0
+
+# vim:set expandtab tabstop=2: #
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/4] texinfo: fix QA Error while doc compress enabled
  2014-09-24 11:38 [PATCH V2 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
  2014-09-24 11:38 ` [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir Hongxu Jia
@ 2014-09-24 11:38 ` Hongxu Jia
  2014-09-24 11:38 ` [PATCH 3/4] texinfo: fix info not work Hongxu Jia
  2014-09-24 11:38 ` [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS Hongxu Jia
  3 siblings, 0 replies; 11+ messages in thread
From: Hongxu Jia @ 2014-09-24 11:38 UTC (permalink / raw)
  To: openembedded-core, mark.hatle, richard.purdie, ross.burton

While doc compress enabled, ther is a QA issue:
...
ERROR: QA Issue: texinfo: Files/directories were installed but not shipped
  /usr/share/info/info.info.bz2
  /usr/share/info/info-stnd.info.bz2 [installed-vs-shipped]
...

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-extended/texinfo/texinfo_5.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/texinfo/texinfo_5.2.bb b/meta/recipes-extended/texinfo/texinfo_5.2.bb
index be90aba..7b5a11a 100644
--- a/meta/recipes-extended/texinfo/texinfo_5.2.bb
+++ b/meta/recipes-extended/texinfo/texinfo_5.2.bb
@@ -51,7 +51,7 @@ do_install_append_class-native() {
 PACKAGES += "info info-doc"
 
 FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
-FILES_info-doc = "${infodir}/info.info ${infodir}/dir ${infodir}/info-*.info \
+FILES_info-doc = "${infodir}/info.info* ${infodir}/dir ${infodir}/info-*.info* \
                   ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
                   ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/4] texinfo: fix info not work
  2014-09-24 11:38 [PATCH V2 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
  2014-09-24 11:38 ` [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir Hongxu Jia
  2014-09-24 11:38 ` [PATCH 2/4] texinfo: fix QA Error while doc compress enabled Hongxu Jia
@ 2014-09-24 11:38 ` Hongxu Jia
  2014-09-24 11:38 ` [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS Hongxu Jia
  3 siblings, 0 replies; 11+ messages in thread
From: Hongxu Jia @ 2014-09-24 11:38 UTC (permalink / raw)
  To: openembedded-core, mark.hatle, richard.purdie, ross.burton

In texinfo, we didn't have info/dir entries, which caused
info not work.
...
root@qemux86:~# info info
info: dir: No such file or directory
...

Refer ubuntu/debian to invoke install-info to create info/dir
entries in pkg_postinst_info.

[YOCTO #6751]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-extended/texinfo/texinfo_5.2.bb | 53 ++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/meta/recipes-extended/texinfo/texinfo_5.2.bb b/meta/recipes-extended/texinfo/texinfo_5.2.bb
index 7b5a11a..cdcb37b 100644
--- a/meta/recipes-extended/texinfo/texinfo_5.2.bb
+++ b/meta/recipes-extended/texinfo/texinfo_5.2.bb
@@ -61,4 +61,57 @@ FILES_${PN}-doc = "${infodir}/texinfo* \
                    ${datadir}/${tex_texinfo} \
                    ${mandir}/man1 ${mandir}/man5"
 
+pkg_postinst_info () {
+if [ "x$D" != "x" ]; then
+    $INTERCEPT_DIR/postinst_intercept update_info_dir ${PKG} \
+        mlprefix=${MLPREFIX} infodir=${infodir} STAGING_BINDIR_NATIVE=${STAGING_BINDIR_NATIVE}
+else
+    errors=0
+    find "${infodir}" -type f | while read file ; do
+        case $file in
+        */dir| */dir.old| \
+        *-[0-9]|*-[0-9].gz|*-[0-9].xz|*-[0-9].bz2| \
+        *-[1-9][0-9]|*-[1-9][0-9].gz|*-[1-9][0-9].xz|*-[1-9][0-9].bz2| \
+        *.png)
+            # these files are ignored
+            continue
+            ;;
+        *)
+            install-info "$file" "${infodir}/dir" || {
+                errors=$[errors+1]
+            }
+            ;;
+        esac
+    done
+    if [ $errors -gt 0 ] ; then
+        echo "Updating the index of info documentation produced $errors errors."
+        exit 1
+    fi
+fi
+}
+
+pkg_prerm_info () {
+errors=0
+find "$D${infodir}" -type f | while read file ; do
+    case $file in
+    */dir|*/dir.old| \
+    *-[0-9]|*-[0-9].gz|*-[0-9].xz|*-[0-9].bz2| \
+    *-[1-9][0-9]|*-[1-9][0-9].gz|*-[1-9][0-9].xz|*-[1-9][0-9].bz2| \
+    *.png)
+        # these files are ignored
+        continue
+        ;;
+    *)
+        install-info --delete "$file" "$D${infodir}/dir" || {
+            errors=$[errors+1]
+        }
+        ;;
+    esac
+done
+
+if [ $errors -gt 0 ] ; then
+    echo "Cleaning the index of info documentation produced $errors errors."
+fi
+}
+
 BBCLASSEXTEND = "native"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS
  2014-09-24 11:38 [PATCH V2 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
                   ` (2 preceding siblings ...)
  2014-09-24 11:38 ` [PATCH 3/4] texinfo: fix info not work Hongxu Jia
@ 2014-09-24 11:38 ` Hongxu Jia
  2014-09-24 14:45   ` Burton, Ross
  3 siblings, 1 reply; 11+ messages in thread
From: Hongxu Jia @ 2014-09-24 11:38 UTC (permalink / raw)
  To: openembedded-core, mark.hatle, richard.purdie, ross.burton

Conditionally add 'xz/bz2/gzip' to info/man's RDEPENDS
according to DOC_COMPRESS.

[YOCTO #6750]
[YOCTO #6751]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-extended/man/man_1.6g.bb        | 13 +++++++++++++
 meta/recipes-extended/texinfo/texinfo_5.2.bb | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/meta/recipes-extended/man/man_1.6g.bb b/meta/recipes-extended/man/man_1.6g.bb
index a66e01c..2a0868f 100644
--- a/meta/recipes-extended/man/man_1.6g.bb
+++ b/meta/recipes-extended/man/man_1.6g.bb
@@ -9,6 +9,19 @@ PR = "r1"
 
 DEPENDS = "groff less"
 
+def compress_pkg(d):
+    if "compress_doc" in d.getVar("INHERIT", True):
+         compress = d.getVar("DOC_COMPRESS", True)
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_${PN} += "${@compress_pkg(d)}"
+
 SRC_URI = "http://primates.ximian.com/~flucifredi/${BPN}/${BPN}-${PV}.tar.gz \
            file://man-1.5k-confpath.patch;striplevel=0 \
            file://man-1.5h1-make.patch \
diff --git a/meta/recipes-extended/texinfo/texinfo_5.2.bb b/meta/recipes-extended/texinfo/texinfo_5.2.bb
index cdcb37b..0ea5d54 100644
--- a/meta/recipes-extended/texinfo/texinfo_5.2.bb
+++ b/meta/recipes-extended/texinfo/texinfo_5.2.bb
@@ -9,6 +9,19 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 PROVIDES_append_class-native = " texinfo-replacement-native"
 
+def compress_pkg(d):
+    if "compress_doc" in d.getVar("INHERIT", True):
+         compress = d.getVar("DOC_COMPRESS", True)
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_info += "${@compress_pkg(d)}"
+
 DEPENDS = "zlib ncurses texinfo-replacement-native"
 DEPENDS_class-native = "zlib-native ncurses-native"
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS
  2014-09-24 11:38 ` [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS Hongxu Jia
@ 2014-09-24 14:45   ` Burton, Ross
  2014-09-24 15:02     ` Hongxu Jia
  0 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2014-09-24 14:45 UTC (permalink / raw)
  To: Hongxu Jia; +Cc: OE-core

On 24 September 2014 12:38, Hongxu Jia <hongxu.jia@windriver.com> wrote:
> +    if "compress_doc" in d.getVar("INHERIT", True):

You'll want to split() the INHERIT variable so you're searching for a
member and not a substring:

if "compress_doc" in d.getVar("INHERIT", True).split()

Without splitting, an inherited class called decompress_docker will
trigger your code.

Ross


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir
  2014-09-24 11:38 ` [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir Hongxu Jia
@ 2014-09-24 14:52   ` Burton, Ross
  2014-09-24 15:08     ` Hongxu Jia
  0 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2014-09-24 14:52 UTC (permalink / raw)
  To: Hongxu Jia; +Cc: OE-core

On 24 September 2014 12:38, Hongxu Jia <hongxu.jia@windriver.com> wrote:
> +# since user's environment is taken over into root account when sudo-ing
> +# we don't want that one's user LANGUAGE setting changes the messages in
> +# the dir file. Unset LANGUAGE and reload /etc/environment to get
> +# the system wide settings. See bug #536476
> +unset LANGUAGE
> +unset LANG
> +if [ -r /etc/environment ] ; then
> +  . /etc/environment
> +fi
> +if [ -r /etc/default/locale ] ; then
> +  . /etc/default/locale
> +fi

Isn't this Debian-specific, and also pushing the build host's
environment settings onto the target?  We should use whatever default
locale is configured for the image, or easier just force it to C.

Ross


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS
  2014-09-24 14:45   ` Burton, Ross
@ 2014-09-24 15:02     ` Hongxu Jia
  0 siblings, 0 replies; 11+ messages in thread
From: Hongxu Jia @ 2014-09-24 15:02 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 09/24/2014 10:45 PM, Burton, Ross wrote:
> On 24 September 2014 12:38, Hongxu Jia <hongxu.jia@windriver.com> wrote:
>> +    if "compress_doc" in d.getVar("INHERIT", True):
> You'll want to split() the INHERIT variable so you're searching for a
> member and not a substring:
>
> if "compress_doc" in d.getVar("INHERIT", True).split()
>
> Without splitting, an inherited class called decompress_docker will
> trigger your code.

Yes, I will fix that, thanks for figuring that out

//Hongxu

>
> Ross



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir
  2014-09-24 14:52   ` Burton, Ross
@ 2014-09-24 15:08     ` Hongxu Jia
  0 siblings, 0 replies; 11+ messages in thread
From: Hongxu Jia @ 2014-09-24 15:08 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On 09/24/2014 10:52 PM, Burton, Ross wrote:
> On 24 September 2014 12:38, Hongxu Jia <hongxu.jia@windriver.com> wrote:
>> +# since user's environment is taken over into root account when sudo-ing
>> +# we don't want that one's user LANGUAGE setting changes the messages in
>> +# the dir file. Unset LANGUAGE and reload /etc/environment to get
>> +# the system wide settings. See bug #536476
>> +unset LANGUAGE
>> +unset LANG
>> +if [ -r /etc/environment ] ; then
>> +  . /etc/environment
>> +fi
>> +if [ -r /etc/default/locale ] ; then
>> +  . /etc/default/locale
>> +fi
> Isn't this Debian-specific, and also pushing the build host's
> environment settings onto the target?  We should use whatever default
> locale is configured for the image, or easier just force it to C.

Okay, I will just force it to C.

//Hongxu

> Ross



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS
  2014-09-24 15:27 [PATCH V3 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
@ 2014-09-24 15:27 ` Hongxu Jia
  0 siblings, 0 replies; 11+ messages in thread
From: Hongxu Jia @ 2014-09-24 15:27 UTC (permalink / raw)
  To: openembedded-core, mark.hatle, richard.purdie, ross.burton

Conditionally add 'xz/bz2/gzip' to info/man's RDEPENDS
according to DOC_COMPRESS.

[YOCTO #6750]
[YOCTO #6751]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-extended/man/man_1.6g.bb        | 13 +++++++++++++
 meta/recipes-extended/texinfo/texinfo_5.2.bb | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/meta/recipes-extended/man/man_1.6g.bb b/meta/recipes-extended/man/man_1.6g.bb
index a66e01c..03fffd6 100644
--- a/meta/recipes-extended/man/man_1.6g.bb
+++ b/meta/recipes-extended/man/man_1.6g.bb
@@ -9,6 +9,19 @@ PR = "r1"
 
 DEPENDS = "groff less"
 
+def compress_pkg(d):
+    if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
+         compress = d.getVar("DOC_COMPRESS", True)
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_${PN} += "${@compress_pkg(d)}"
+
 SRC_URI = "http://primates.ximian.com/~flucifredi/${BPN}/${BPN}-${PV}.tar.gz \
            file://man-1.5k-confpath.patch;striplevel=0 \
            file://man-1.5h1-make.patch \
diff --git a/meta/recipes-extended/texinfo/texinfo_5.2.bb b/meta/recipes-extended/texinfo/texinfo_5.2.bb
index cdcb37b..59480e3 100644
--- a/meta/recipes-extended/texinfo/texinfo_5.2.bb
+++ b/meta/recipes-extended/texinfo/texinfo_5.2.bb
@@ -9,6 +9,19 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 PROVIDES_append_class-native = " texinfo-replacement-native"
 
+def compress_pkg(d):
+    if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
+         compress = d.getVar("DOC_COMPRESS", True)
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_info += "${@compress_pkg(d)}"
+
 DEPENDS = "zlib ncurses texinfo-replacement-native"
 DEPENDS_class-native = "zlib-native ncurses-native"
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS
  2014-09-25  6:31 [PATCH V4 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
@ 2014-09-25  6:31 ` Hongxu Jia
  0 siblings, 0 replies; 11+ messages in thread
From: Hongxu Jia @ 2014-09-25  6:31 UTC (permalink / raw)
  To: openembedded-core, mark.hatle, richard.purdie, ross.burton

Conditionally add 'xz/bz2/gzip' to info/man's RDEPENDS
according to DOC_COMPRESS.

[YOCTO #6750]
[YOCTO #6751]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-extended/man/man_1.6g.bb        | 13 +++++++++++++
 meta/recipes-extended/texinfo/texinfo_5.2.bb | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/meta/recipes-extended/man/man_1.6g.bb b/meta/recipes-extended/man/man_1.6g.bb
index a66e01c..03fffd6 100644
--- a/meta/recipes-extended/man/man_1.6g.bb
+++ b/meta/recipes-extended/man/man_1.6g.bb
@@ -9,6 +9,19 @@ PR = "r1"
 
 DEPENDS = "groff less"
 
+def compress_pkg(d):
+    if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
+         compress = d.getVar("DOC_COMPRESS", True)
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_${PN} += "${@compress_pkg(d)}"
+
 SRC_URI = "http://primates.ximian.com/~flucifredi/${BPN}/${BPN}-${PV}.tar.gz \
            file://man-1.5k-confpath.patch;striplevel=0 \
            file://man-1.5h1-make.patch \
diff --git a/meta/recipes-extended/texinfo/texinfo_5.2.bb b/meta/recipes-extended/texinfo/texinfo_5.2.bb
index 11c11aa..b9a7f8b 100644
--- a/meta/recipes-extended/texinfo/texinfo_5.2.bb
+++ b/meta/recipes-extended/texinfo/texinfo_5.2.bb
@@ -9,6 +9,19 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
 PROVIDES_append_class-native = " texinfo-replacement-native"
 
+def compress_pkg(d):
+    if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
+         compress = d.getVar("DOC_COMPRESS", True)
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_info += "${@compress_pkg(d)}"
+
 DEPENDS = "zlib ncurses texinfo-replacement-native"
 DEPENDS_class-native = "zlib-native ncurses-native"
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-09-25  6:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 11:38 [PATCH V2 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
2014-09-24 11:38 ` [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir Hongxu Jia
2014-09-24 14:52   ` Burton, Ross
2014-09-24 15:08     ` Hongxu Jia
2014-09-24 11:38 ` [PATCH 2/4] texinfo: fix QA Error while doc compress enabled Hongxu Jia
2014-09-24 11:38 ` [PATCH 3/4] texinfo: fix info not work Hongxu Jia
2014-09-24 11:38 ` [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS Hongxu Jia
2014-09-24 14:45   ` Burton, Ross
2014-09-24 15:02     ` Hongxu Jia
  -- strict thread matches above, loose matches on Subject: below --
2014-09-24 15:27 [PATCH V3 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
2014-09-24 15:27 ` [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS Hongxu Jia
2014-09-25  6:31 [PATCH V4 0/4] man/info: fix not support xz/bz2 compression Hongxu Jia
2014-09-25  6:31 ` [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS Hongxu Jia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox