Skip to contentSkip to conversation

info: fix invoking info failed

PATCH New Hongxu Jia 1 participant 3 messages Oct 11, 2014

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

v5 cover info: fix invoking info failed

Changed in V5:
- Remove bashism

Changed in V4:
- In info's postinst/prerm, check the existance of ${infodir}

- Remove x permission for scripts/postinst-intercepts/update_info_dir 'new file mode 100755'-->'new file mode 100644', rootfs.py use the x permission to decide whether the scripts in postinst-intercepts be invoked or not. Sounds weird, but it is the reason of Ross's build failure.

Changed in V3:
- Remove Debian-specific code
- split() the INHERIT variable

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 = " 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:~# info info
...

//Hongxu

The following changes since commit 0172cded27d73437784fe1578110937aede563eb:

build-appliance-image: Update to dizzy head revision (2014-10-10 22:40:57 +0100)

are available in the git repository at:

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

Hongxu Jia (2):
scripts/postinst-intercepts: add update_info_dir
texinfo: fix info not work

 meta/recipes-extended/texinfo/texinfo_5.2.bb | 61 ++++++++++++++++++++++
 scripts/postinst-intercepts/update_info_dir  | 77 ++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+)
 create mode 100644 scripts/postinst-intercepts/update_info_dir
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v5 1/2 scripts/postinst-intercepts: add update_info_dir

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 <[email protected]>, 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.

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

[YOCTO #6751]

---
 scripts/postinst-intercepts/update_info_dir | 77 +++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 scripts/postinst-intercepts/update_info_dir
scripts/postinst-intercepts/update_info_dir new file +77 -0
new file mode 100644
index 0000000..983d54f
@@ -0,0 +1,77 @@
+#!/bin/sh
+# 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. Force it to C. See bug #536476
+LANGUAGE="C"
+LANG="C"
+
+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."
+  exit 0
+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=`expr $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: #
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v5 2/2 texinfo: fix info not work

In reply to Hongxu Jia

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]

---
 meta/recipes-extended/texinfo/texinfo_5.2.bb | 61 ++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
meta/recipes-extended/texinfo/texinfo_5.2.bb +61 -0
index cf9dcfd..0361607 100644
@@ -74,4 +74,65 @@ 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
+    if [ ! -d "${infodir}" ]; then
+        exit 0
+    fi
+
+    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=`expr $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 () {
+if [ ! -d "$D${infodir}" ]; then
+    exit 0
+fi
+
+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=`expr $errors + 1`
+        }
+        ;;
+    esac
+done
+
+if [ $errors -gt 0 ] ; then
+    echo "Cleaning the index of info documentation produced $errors errors."
+fi
+}
+
 BBCLASSEXTEND = "native"
Signature · 1 line
1.9.1