all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
Subject: Re: [PATCH] Unbreak `make install' in leim/ when leim's ${INSTALLDIR} doesn't exist
Date: Thu, 12 Oct 2006 03:31:10 +0300	[thread overview]
Message-ID: <20061012003110.GA86094@gothmog.pc> (raw)
In-Reply-To: <549c434ebfb50d1a4ca2.1160608974@gothmog.pc>

On 2006-10-12 02:22, Giorgos Keramidas <keramida@ceid.upatras.gr> wrote:
> The current `make install' target of the leim/ subdirectory has a subtle
> problem when ${prefix}/share/emacs/22.0.50/leim does not exist at all.

The previous patch changes the logic of the if-then blocks.  The install
commands shouldn't run at all if ${INSTALLDIR} is the current directory.

The following version keeps the same behavior, and touches a smaller
part of the Makefile too :)

--- patch begins here -----------------------------------------------------
Unbreak `make install' in leim/ when leim's ${INSTALLDIR} doesn't exist.

What was happening with the old shell script called by the `install'
target was kind of tricky.  The command:

    if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then
      if [ -d ${INSTALLDIR} ] ; then \

contains a backquoted `cd' command into a directory which may not exist.
This causes the /bin/sh shell on Solaris (possibly other systems too),
to abort the entire if-then compound statement, because the `cd' command
fails before the if-then statement has a chance to run at all (i.e. at
backquote-expansion time).

Switching the order of the two if-then checks ensures that `cd' will
only run if ${INSTALLDIR} *really* exists, and `make install' in leim/
works again.

diff -r 34e5fff7519a -r 3495805897b2 leim/Makefile.in
*** a/leim/Makefile.in	Wed Oct 11 18:10:15 2006 +0300
--- b/leim/Makefile.in	Thu Oct 12 02:18:45 2006 +0300
***************
*** 216,228 ****
  	sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
  
  install: all
  	if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \
! 	  if [ -d ${INSTALLDIR} ] ; then \
! 	    rm -rf ${INSTALLDIR}/leim-list.el; \
! 	    rm -rf ${INSTALLDIR}/quail ${INSTALLDIR}/ja-dic ; \
! 	  else \
! 	    ${srcdir}/${dot}${dot}/mkinstalldirs ${INSTALLDIR}; \
! 	  fi; \
  	  echo "Copying leim files to ${INSTALLDIR} ..." ; \
  	  if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
  	    tar -chf - leim-list.el quail ja-dic \
--- 216,227 ----
  	sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
  
  install: all
+ 	if [ ! -d ${INSTALLDIR} ]; then \
+ 	  ${srcdir}/${dot}${dot}/mkinstalldirs ${INSTALLDIR}; \
+ 	fi
  	if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \
! 	  rm -rf ${INSTALLDIR}/leim-list.el; \
! 	  rm -rf ${INSTALLDIR}/quail ${INSTALLDIR}/ja-dic ; \
  	  echo "Copying leim files to ${INSTALLDIR} ..." ; \
  	  if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
  	    tar -chf - leim-list.el quail ja-dic \
***************
*** 241,247 ****
  	  rm -f  ${INSTALLDIR}/.\#*       ${INSTALLDIR}/*/.\#* ; \
  	  rm -f  ${INSTALLDIR}/*~         ${INSTALLDIR}/*/*~ ; \
  	  rm -f  ${INSTALLDIR}/*.orig     ${INSTALLDIR}/*/*.orig ; \
! 	else true; fi
  	-unset CDPATH; \
  	if [ -n "${GZIP_PROG}" ]; \
  	then \
--- 240,246 ----
  	  rm -f  ${INSTALLDIR}/.\#*       ${INSTALLDIR}/*/.\#* ; \
  	  rm -f  ${INSTALLDIR}/*~         ${INSTALLDIR}/*/*~ ; \
  	  rm -f  ${INSTALLDIR}/*.orig     ${INSTALLDIR}/*/*.orig ; \
! 	fi
  	-unset CDPATH; \
  	if [ -n "${GZIP_PROG}" ]; \
  	then \
--- patch ends here -------------------------------------------------------

  reply	other threads:[~2006-10-12  0:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-11 23:22 [PATCH] Unbreak `make install' in leim/ when leim's ${INSTALLDIR} doesn't exist Giorgos Keramidas
2006-10-12  0:31 ` Giorgos Keramidas [this message]
2006-10-12  5:59 ` Kenichi Handa
2006-10-12 12:35   ` Giorgos Keramidas
2006-10-12 12:47     ` Andreas Schwab
2006-10-12 13:12       ` Giorgos Keramidas
2006-10-12 12:52     ` David Kastrup
2006-10-12 13:10     ` Kenichi Handa
2006-10-12 13:13       ` Giorgos Keramidas

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=20061012003110.GA86094@gothmog.pc \
    --to=keramida@ceid.upatras.gr \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.