Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Hongxu Jia <hongxu.jia@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/4] scripts/postinst-intercepts: add update_info_dir
Date: Sat, 11 Oct 2014 10:45:21 +0800	[thread overview]
Message-ID: <543899C1.7020900@windriver.com> (raw)
In-Reply-To: <543898B3.8030306@windriver.com>

On 10/11/2014 10:40 AM, Hongxu Jia wrote:
> On 09/25/2014 02:31 PM, Hongxu Jia wrote:
>> 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 | 77 
>> +++++++++++++++++++++++++++++
>>   1 file changed, 77 insertions(+)
>>   create mode 100644 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 100644
>> index 0000000..5ddbc39
>> --- /dev/null
>> +++ b/scripts/postinst-intercepts/update_info_dir
>> @@ -0,0 +1,77 @@
>> +#!/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. 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=$[errors+1]
>
> It is bashism, I will improve it in V4
>

s/V4/V5/

//Hongxu

> //Hongxu
>
>
>> +      }
>> +      ;;
>> +  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: #
>



  reply	other threads:[~2014-10-11  2:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 1/4] scripts/postinst-intercepts: add update_info_dir Hongxu Jia
2014-10-11  2:40   ` Hongxu Jia
2014-10-11  2:45     ` Hongxu Jia [this message]
2014-09-25  6:31 ` [PATCH 2/4] texinfo: fix QA Error while doc compress enabled Hongxu Jia
2014-09-25  6:31 ` [PATCH 3/4] texinfo: fix info not work Hongxu Jia
2014-09-25  6:31 ` [PATCH 4/4] man/texinfo: conditionally add gzip/bzip2/xz to RDEPENDS 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 1/4] scripts/postinst-intercepts: add update_info_dir Hongxu Jia
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=543899C1.7020900@windriver.com \
    --to=hongxu.jia@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox