zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: PATH: autoload with explicit path
Date: Mon, 30 Jan 2017 10:06:37 +0000	[thread overview]
Message-ID: <20170130100637.25f99d70@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CACeGjnXBtMn2AsW78_hZg9LVTbsTCp46fCszyJR+=i9dSRU8Lg@mail.gmail.com>

On Sun, 29 Jan 2017 16:53:01 -0500
Vin Shelton <acs@alumni.princeton.edu> wrote:
> (Peter I copied you directly because email from my gmail account has been
> bouncing.)
> 
> I am seeing two failures with the latest updates, see below.  Please let me
> know if you need more info.
> /opt/src/zsh-2017-01-29/Test/C04funcdef.ztst: starting.
> --- /tmp/zsh.ztst.11675/ztst.out 2017-01-29 16:48:50.438882533 -0500
> +++ /tmp/zsh.ztst.11675/ztst.tout 2017-01-29 16:48:50.442882549 -0500
> @@ -1 +1 @@
> -oops is a shell function from CURDIR/oops
> +oops is a shell function from /SSD-2TBCURDIR/oops
> /opt/src/zsh-2017-01-29/Test/V06parameter.ztst: starting.
> --- /tmp/zsh.ztst.14908/ztst.out 2017-01-29 16:48:55.798904574 -0500
> +++ /tmp/zsh.ztst.14908/ztst.tout 2017-01-29 16:48:55.802904591 -0500
> @@ -3,8 +3,8 @@
>  Inside function fn
>  2 + ./functrace.zsh:10 + ./functrace.zsh:5
>  Inside autofn
> -2 + ./functrace.zsh:20 + CURDIR/autofn:0
> +2 + ./functrace.zsh:20 + /SSD-2TB/opt/build/zsh-2017-01-29/Test/autofn:0
>  Inside autofn
> -2 + ./functrace.zsh:21 + CURDIR/autofn:0
> +2 + ./functrace.zsh:21 + /SSD-2TB/opt/build/zsh-2017-01-29/Test/autofn:0
>  In sourced file
>  2 + ./functrace.zsh:22 + ./sourcedfile:0

Let's try the following trick, which has been in use in B01cd.ztst for
some time so presumably works.

pws

diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst
index 176841d..0cf2b58 100644
--- a/Test/C04funcdef.ztst
+++ b/Test/C04funcdef.ztst
@@ -2,6 +2,10 @@
 
   mkdir funcdef.tmp
   cd funcdef.tmp
+  setopt chaselinks
+  cd .
+  unsetopt chaselinks
+  mydir=$PWD
 
 %test
 
@@ -325,10 +329,10 @@
     printf '%s\n' 'oops(){}' 'ninjas-earring(){}' 'oops "$@"' >oops
     autoload oops
     oops
-    whence -v oops | sed -e "s%$PWD%CURDIR%"
+    whence -v oops
   )
-0:whence -v of zsh-style autoload
->oops is a shell function from CURDIR/oops
+0q:whence -v of zsh-style autoload
+>oops is a shell function from $mydir/oops
 
   (
     fpath=(.)
diff --git a/Test/V06parameter.ztst b/Test/V06parameter.ztst
index c2a2a4d..10e0a27 100644
--- a/Test/V06parameter.ztst
+++ b/Test/V06parameter.ztst
@@ -1,15 +1,22 @@
+%prep
+
+  setopt chaselinks
+  cd .
+  unsetopt chaselinks
+  mydir=$PWD
+
 %test
 
   print 'print In sourced file
-  print $LINENO + $functrace + ${funcsourcetrace/#$PWD/CURDIR}
+  print $LINENO + $functrace + ${funcsourcetrace}
   ' >sourcedfile
   print -r -- 'print Started functrace.zsh
   module_path=(./Modules)
-  print $LINENO + $functrace + ${funcsourcetrace/#$PWD/CURDIR}
+  print $LINENO + $functrace + ${funcsourcetrace}
   :
   fn() {
     print Inside function $0
-    print $LINENO + $functrace + ${funcsourcetrace/#$PWD/CURDIR}
+    print $LINENO + $functrace + ${funcsourcetrace}
   }
   :
   fn
@@ -17,7 +24,7 @@
   fpath=(. $fpath)
   :
   echo '\''print Inside $0
-    print $LINENO + $functrace + ${funcsourcetrace/#$PWD/CURDIR}
+    print $LINENO + $functrace + ${funcsourcetrace}
   '\'' >autofn
   :
   autoload autofn
@@ -26,15 +33,15 @@
   autofn
   . ./sourcedfile' >functrace.zsh
   $ZTST_testdir/../Src/zsh +Z -f ./functrace.zsh
-0:Function tracing
+0q:Function tracing
 >Started functrace.zsh
 >3 + +
 >Inside function fn
 >2 + ./functrace.zsh:10 + ./functrace.zsh:5
 >Inside autofn
->2 + ./functrace.zsh:20 + CURDIR/autofn:0
+>2 + ./functrace.zsh:20 + $mydir/autofn:0
 >Inside autofn
->2 + ./functrace.zsh:21 + CURDIR/autofn:0
+>2 + ./functrace.zsh:21 + $mydir/autofn:0
 >In sourced file
 >2 + ./functrace.zsh:22 + ./sourcedfile:0
 
@@ -70,14 +77,14 @@
     fpath=($PWD)
     print "print I have been autoloaded" >myfunc
     autoload $PWD/myfunc
-    print ${functions_source[myfunc]/#$PWD/CURDIR}
+    print ${functions_source[myfunc]}
     myfunc
-    print ${functions_source[myfunc]/#$PWD/CURDIR}
+    print ${functions_source[myfunc]}
   )
-0: $functions_source
->CURDIR/myfunc
+0q: $functions_source
+>$mydir/myfunc
 >I have been autoloaded
->CURDIR/myfunc
+>$mydir/myfunc
 
 %clean
 


  reply	other threads:[~2017-01-30 10:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170127151334epcas2p4c32b57f69fcae22b40b309793eb8ceb6@epcas2p4.samsung.com>
2017-01-27 15:12 ` Sebastian Gniazdowski
2017-01-27 16:24   ` Peter Stephenson
2017-01-27 18:40     ` Sebastian Gniazdowski
2017-01-27 18:44       ` Peter Stephenson
2017-01-27 19:00         ` Sebastian Gniazdowski
2017-01-28 18:05         ` Bart Schaefer
2017-01-28 19:12           ` Peter Stephenson
2017-01-28 19:45             ` Bart Schaefer
2017-01-28 19:56               ` Peter Stephenson
2017-01-28 20:37                 ` Sebastian Gniazdowski
2017-01-29 12:27             ` Sebastian Gniazdowski
2017-01-29 16:11               ` Bart Schaefer
2017-01-29 17:32                 ` Sebastian Gniazdowski
2017-01-29 18:37                   ` Bart Schaefer
2017-01-29 21:53                     ` Vin Shelton
2017-01-30 10:06                       ` Peter Stephenson [this message]
2017-01-29 17:58                 ` Peter Stephenson
2017-01-30 11:37                   ` Sebastian Gniazdowski
2017-01-30 11:55                     ` Peter Stephenson
2016-12-11 22:18 Peter Stephenson
2016-12-12 16:05 ` Bart Schaefer
2016-12-12 16:31   ` Peter Stephenson
2016-12-12 18:09     ` Bart Schaefer
2017-01-10 19:31     ` Peter Stephenson
2017-01-11 11:42       ` Peter Stephenson
2017-01-11 20:51         ` Peter Stephenson
2017-01-12 20:42           ` Peter Stephenson
2017-01-13 18:04           ` Peter Stephenson
2017-01-16 10:37             ` Peter Stephenson
2017-01-16 15:04               ` Daniel Shahaf
2017-01-16 15:48                 ` Peter Stephenson
2017-01-16 15:22               ` Bart Schaefer
2017-01-16 15:59                 ` Peter Stephenson
     [not found]                   ` <CAHYJk3SB1NDj6y5TRHHsAVsyjHfZQhTzMRzTR2c-SVEc9oAwzA@mail.gmail.com>
2017-01-24 11:10                     ` Peter Stephenson
2017-01-11 21:13         ` Peter Stephenson

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=20170130100637.25f99d70@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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).