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

Re: trouble with emacs-install script

Hash: SHA1

Peter S Galbraith wrote:
> Damyan Ivanov <divanov@creditreform.bg> wrote:
>>Peter S Galbraith wrote:
>>>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?
> Displaying only byte-compilation warnings rather than all the
> "all-is-fine" junk.  To be honest, this is in request to a bug report
> because I don't feel it's very "useful" for the end-user either.
>>To me it seems that egrep fails to find a match for the pattern and
>>exits with non-zero status. 
> Makes sense.  I looked for an option to egrep to avoid that (the reason
> for trying "-s").
>>                            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.
> So I use use `unset -e' prior to the egrep and `set -e' right afterwards?

No, this is ugly :-)

> The warnings aren't fatal.  I just prefer to display them.

Now I see.

In this case use `egrep -e "pattern" ${LOG} || /bin/true'. This way the
result of the compound command is always true.

- --
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
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


Reply to: