zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: relative path generation in mkmakemod.sh
@ 1998-04-28  8:15 Zoltan Hidvegi
  1998-04-28  8:59 ` Andrew Main
  0 siblings, 1 reply; 2+ messages in thread
From: Zoltan Hidvegi @ 1998-04-28  8:15 UTC (permalink / raw)
  To: Zsh hacking and development

Hi everyone,

I started looking at zsh again after a long pause.  I'm really sorry for
my long silence, I was too busy doing other things.  I do welcome Zefram
as a new maintainer.  I'll turn ftp.cs.elte.hu into a mirror site when
the new master ftp site is ready.  Alternatively I can probably arrange
that Zefram can directly upload to ftp.cs.elte.hu.  I'll try to get back
on track and continue contributing to zsh as best as I can.  First here
is a patch for the zefram4 version to fix the relative path generation in
mkmakemod.sh, which can fail if the pwd command gives a pathname with
symlinks.  The modified version tries to find the shortest relative path,
and avoids using the pwd shell builtin if an external version of pwd can
be found.  An external pwd usually returns symlink-free path.

Zoli

*** Src/mkmakemod.sh.orig	Sun Apr 26 17:09:03 1998
--- Src/mkmakemod.sh	Tue Apr 28 02:47:23 1998
***************
*** 67,72 ****
--- 67,87 ----
      s,\(.\)/$,\1,
  '
  
+ sed_getrel='
+     s,\([^/]\)$,\1/,
+     N
+     s,\([^/]\)$,\1/,
+     s,^\(.*/\)\(.*\n\)\1\(.*\),\2\3,
+     h
+     s,^.*\n,,
+     s,[^/][^/]*,..,g
+     s,\.\.$,../,
+     G
+     s,\n\(.*\)\n.*$,\1,
+     s,\(.\)/$,\1,
+     s,^$,.,
+ '
+ 
  # decide which stages to process
  first_stage=true
  second_stage=true
***************
*** 303,312 ****
  
      trap "rm -f $the_subdir/${the_makefile}" 1 2 15
  
      # config.status requires the pathname for the .in file to be relative
      # to the top of the source tree.  As we have it in the build tree, it
      # is necessary to construct an appropriate pathname.
!     top_builddir=`(cd $top_srcdir; pwd) | sed 's,[^/][^/]*,..,g;s,^/,,'``pwd`
  
      CONFIG_FILES=$the_subdir/${the_makefile}:$top_builddir/$the_subdir/${the_makefile}.in CONFIG_HEADERS= ./config.status
  
--- 318,338 ----
  
      trap "rm -f $the_subdir/${the_makefile}" 1 2 15
  
+     pwdcmd=pwd
+     IFS="${IFS=	 }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+     for ac_dir in $PATH; do
+ 	test -z "$ac_dir" && ac_dir=.
+ 	if test -f $ac_dir/$pwdcmd; then
+ 	    pwdcmd="$ac_dir/$pwdcmd"
+ 	    break
+ 	fi
+     done
+     IFS="$ac_save_ifs"
+ 
      # config.status requires the pathname for the .in file to be relative
      # to the top of the source tree.  As we have it in the build tree, it
      # is necessary to construct an appropriate pathname.
!     top_builddir=`($pwdcmd; cd $top_srcdir; $pwdcmd) | sed "$sed_getrel"`
  
      CONFIG_FILES=$the_subdir/${the_makefile}:$top_builddir/$the_subdir/${the_makefile}.in CONFIG_HEADERS= ./config.status
  


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: relative path generation in mkmakemod.sh
  1998-04-28  8:15 PATCH: relative path generation in mkmakemod.sh Zoltan Hidvegi
@ 1998-04-28  8:59 ` Andrew Main
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Main @ 1998-04-28  8:59 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: zsh-workers

Zoltan Hidvegi wrote:
>                      I'll turn ftp.cs.elte.hu into a mirror site when
>the new master ftp site is ready.

I'll let you know; we should be in business in a couple of days.

>                                                             First here
>is a patch for the zefram4 version to fix the relative path generation in
>mkmakemod.sh, which can fail if the pwd command gives a pathname with
>symlinks.

Sorry, I've already fixed this another way, though I haven't posted the
patch because it's tied into a more radical Makefile simplification that
I'm still working on.  I made the configure script edit config.status
(ed rocks) to handle absolute pathnames, as well as a couple of other
cool things.  Hopefully 3.1.3 will be out next week.

-zefram


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-04-28  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-28  8:15 PATCH: relative path generation in mkmakemod.sh Zoltan Hidvegi
1998-04-28  8:59 ` Andrew Main

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).