[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Transition from dpkg to GNU install-info



Hi all,

thanks for the remarks

On Di, 14 Apr 2009, Nicolas François wrote:
> I don't think all info files are named *.info.gz or *.info.

Right, good observation

> Also, it could be more robust to space issues to run something like:
> 	find "$INFODIR" -type f | while read file; do

Ok

> 	errors=0
> 
> 	...
> 
> 	ginstall-info "$i" "$INFODIR/dir" || {
> 		errors=1
> 	}

Done something similar (counting errors)

On Di, 14 Apr 2009, Raphael Hertzog wrote:
> > 	exit $errors
> 
> In that case, the trigger processing in the postinst should be protected
> against errors (update-info-dir || true), we don't want failures to
> configure just because a bad info file was found.

Similar, warning on &2 on how many errors, but exit 0

On Di, 14 Apr 2009, Sven Joachim wrote:
>   *-[1-9][0-9])
>   *-[1-9][0-9].gz)

Yup.

New version attached, thanks for reviewing

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at>        Vienna University of Technology
Debian Developer <preining@debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BOOK	What to do if you find yourself stuck in a crack in the ground
	underneath a giant boulder you can't move, with no hope of
	rescue. Consider how lucky you are that life has been good to
	you so far. Alternatively, if life hasn't been good to you so
	far, which given your current circumstances seems more likely,
	consider how lucky you are that it won't be troubling you much
	longer.
                 --- Comforting advice for Ford and Arthur in this current
                 --- situation, Fit the Eighth.
                 --- Douglas Adams, The Hitchhikers Guide to the Galaxy
#!/bin/bash
# update-info-dir
# create a dir file from all installed info files
# Copyright 2009 Norbert Preining
# GPLv2

INFODIR=/usr/share/info

set -e

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|*-[1-9][0-9]|*-[1-9][0-9].gz)
      # these files are ignored
      continue
      ;;
    *)
      ginstall-info "$file" "$INFODIR/dir" || {
        errors=$[errors+1]
      }
      ;;
  esac
done

if [ $errors -gt 0 ] ; then
  exec >&2
  echo
  echo "Updating the index of info documentation produced $errors errors."
fi

exit 0

# vim:set expandtab tabstop=2: #

Reply to: