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

Re: trouble with emacs-install script



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter S Galbraith wrote:
> Hi all,
> 
> I'd appreciate some shell-script help.
> 
> I'm trying to add a `grep' for byte-compilation warnings to
> emacs-install scripts.
> 
> The file /usr/lib/emacsen-common/packages/install/emacs-goodies-el
> would end with:
> 
> ---
> echo ${FLAVOR} ${FLAGS} ${FILES} >> ${LOG}
> "${FLAVOR}" ${FLAGS} ${FILES} >> ${LOG} 2>&1
> egrep -s -e "While compiling|\*\*" ${LOG}
> echo install/${PACKAGE}: Deleting ${LOG}
> rm -f path.el ${LOG}
> 
> exit 0
> ---

What is the purpose of the egrep line?

To me it seems that egrep fails to find a match for the pattern and
exits with non-zero status. If the script has "set -e", then a non-zero
exit status of a command causes the whole script to exit with the same
non-zero exit status, signalling to dpkg that something failed.

Maybe you should use something like

- ---
echo ${FLAVOR} ${FLAGS} ${FILES} >> ${LOG}
"${FLAVOR}" ${FLAGS} ${FILES} >> ${LOG} 2>&1
if egrep -s -e "While compiling|\*\*" ${LOG} ;
then
  echo "There was an error. See ${LOG} for details"
  exit 1
else
  echo "No errors doing whatever"
fi

echo install/${PACKAGE}: Deleting ${LOG}
rm -f path.el ${LOG}
- --

Please bare in mind that I know nothing about Emacs and its installation
procedures, so I may be weell off track. The echo's above in the 'if'
statement are just examples.

> Adding the line with egrep makes the installation fail on unstable yet
> it works on sarge.

Maybe on sarge ${LOG} file contains something that matches the pattern?


hth,
dam
- --
Damyan Ivanov                              Creditreform Bulgaria
divanov@creditreform.bg              http://www.creditreform.bg/
phone: +359(2)928-2611, 929-3993            fax: +359(2)920-0994
mob. +359(88)856-6067               dam@jabber.minus273.org/Gaim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDULEGHqjlqpcl9jsRAo6IAJ9EhK1JRyrkPzep61PJ1e5pPK+QlQCggG+p
F7b+1FJlotzwqk/OpH/mrGE=
=ZvPs
-----END PGP SIGNATURE-----



Reply to: