From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1595 invoked from network); 28 Apr 1998 08:35:00 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 28 Apr 1998 08:35:00 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id EAA15102; Tue, 28 Apr 1998 04:15:19 -0400 (EDT) Resent-Date: Tue, 28 Apr 1998 04:15:19 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199804280815.DAA06689@hzoli.home> Subject: PATCH: relative path generation in mkmakemod.sh To: zsh-workers@math.gatech.edu (Zsh hacking and development) Date: Tue, 28 Apr 1998 03:15:26 -0500 (CDT) X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"B5eKl.0.vh3.N0PHr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3880 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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