Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: /usr/local/bin/perl



On Aug 15,  3:54pm, Adam Spiers wrote:
}
} > }    Test/ztst.zsh            :   #!/usr/local/bin/zsh -f
} > 
} > That should be ".../zsh -f +Z".
} 
} Indeed, and I believe that I've had tests misleadingly fail through
} running `make test' before `make install' as a result of that.

You shouldn't have.  `make test' explicitly calls zsh by full path and
passes it ztst.zsh by name.

You might have had failures trying to run tests by hand with
	./ztst.zsh B01cd.ztst
or some such, but the "right" way to do that is
	make test TESTNUM=B01

} Shall I change it then?

I'm not sure it'll help, as many OSs won't accept more than one argument
after the command path when interpreting a #! line.  (That's likely why
you are having trouble with `env perl -w'.)

} > If you put env in the #! line -- or put the #! line anywhere but as the
} > first line in the script -- it foils emacs' algorithm for figuring out
} > which mode to start in.  Same issue if you put some kind of @...@ thing
} > for configure there.  Not that this should be the primary reason for any
} > decision that we make, but at least consider it.
} 
} We can persuade emacs to use the right mode using the other method:
} 
}   # Local Variables:
}   # mode:cperl
}   # End:
} 
} should do it.

Please don't.  I find it aesthetically displeasing to have that cruft
at the end of every file, and I hate having emacs stop during file load
to ask whether it should pay attention to it, and it's not secure to
simply always accept it.  I'd rather just type M-x cperl-mode if emacs
has got it wrong.

} If we use configure, presumably that would mean having (say)
} Utils/helpfiles auto-generated from Utils/helpfiles.in?  My vote is
} for that option.

Yes, that would be it, but my vote is still to avoid mucking with this
in configure.  Maybe something like the following, run through the
just-compiled zsh?

--- 8< --- snip --- 8< ---
# Src/zsh -f path_to_this_file path_to_file_to_fix ${bindir}
setopt nobanghist
command=( $(sed -n -e '1s/^#!//p' $1) )
if [[ -n "$command" ]]; then
    if [[ ${command[1]:t} == zsh ]]; then
	command[1]=$2/zsh
    else
	command[1]=$(whence -p ${command[1]:t})
    fi
    if [[ -n "$command[1]" ]]; then
	echo "#!$command" > $1.fix &&
	sed -e 1d $1 >> $1.fix &&
	mv $1 $1.orig &&
	mv $1.fix $1
    fi
fi
--- 8< --- snip --- 8< ---

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author