From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: zsh-workers@math.gatech.edu (Zsh hacking and development)
Subject: PATCH: relative path generation in mkmakemod.sh
Date: Tue, 28 Apr 1998 03:15:26 -0500 (CDT) [thread overview]
Message-ID: <199804280815.DAA06689@hzoli.home> (raw)
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
next reply other threads:[~1998-04-28 8:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-04-28 8:15 Zoltan Hidvegi [this message]
1998-04-28 8:59 ` Andrew Main
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=199804280815.DAA06689@hzoli.home \
--to=hzoli@cs.elte.hu \
--cc=zsh-workers@math.gatech.edu \
/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 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).