Open lucc opened 8 years ago
Hi @lucc,
I just thought about the shell selection: If we install vimpager into /usr/local via the makefile we could also select a shell in the makefile and hard code it into the script. Then the shell selection hack would only be neccessary for the portable version. And also the system selection could be moved to the makefile and the portable version (have a look at pass
they insert OS specific code into the script when installing).
That's a good idea, I will do this now. With one caveat, the version in the repo has to run it for pathogen users.
You can have a look at the code in the script and in the makefile of pass
. Like this you can run the script from the git repository without bundleing anything. And platform specific code can be sourced into the main script (you might have noticed that I advocate to put extra code into the script during installation instead of removing unneeded code during installation, I think it is easier and less error prone).
That's sort of what I was planning on doing.
@lucc Ok, I've implemented this, looks ok to you?
Question 7: What make versions are supported? Is there a reason that you write all shell commands in the makefile seperated by semicolon+backslash+newline instead of putting them on differnt lines (apart from the cases where it is neccessary for shell control structures (if, while, ...) and shell variables)?
About af50ec9: I started testing. The first thing I noticed is that the order of the shell you check changed and now includes dash, ash and zsh. I have dash and zsh installed and have some trouble with dash:
PAGER=./vimpager man man
tries to use dash but hangs. ./vimpager file
works (also uses dash). If I uninstall dash vimpager uses bash and also works with man.
I installed version 2.06.r141.gaf50ec9 from the AUR and it uses bash. That is strange and I have to investigate some more.
But I had an idea for a --version
option. See my PR. This might help when discussing issues as we can be sure what we talk about.
The make I target is standard UNIX make, or POSIX make, the stuff that pretty much all makes understand. This is make
on e.g. Solaris and *BSD.
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
This is also the make that the GNU autoconf/automake systems target, and their manuals are often helpful.
Honestly I just got used to the ;\
syntax for shell scripts in make, I can probably split some of these lines out more.
I cannot reproduce the PAGER=./vimpager man man
hang here, not on OS X or XUbuntu. On OS X by the way I have to use PAGER=
pwd/vimpager man man
it has a different man. Let me know when you find out what the problem is.
@lucc I should also mention that the shell code in the Makefile must be for original bourne shell not POSIX sh, if you need one to test you can use heirloom-sh from here:
Out of curiosity: Which system still uses this? I did only seriously run Linux and OS X and they always had bash (I did never use some tiny/embedded Linux distro).
This could be nr 8: Which operating systems are supported?
Solaris uses original bourne for /bin/sh and its make uses it to run shell commands. I think it's overridable with SHELL, but there is no way to do this conditionally in UNIX make, that I know of. See the GNU autoconf portable shell guidelines, that's probably the best info on this.
Do you mean these? I just had a look at them and now I have this question:
awk
and sed
in functions? Is there a chance that they are not available on a system or are we looking for a particular "good" version? What features do we need in these programs that are not available in all versions? Should we assume that they are POSIX compatible like the shell we are looking for?-n
option for head
and tail
. Why do we need to wrap them?@lucc
-<N>
and always will.About head and tail: I think that wasn't me but @eworm-de, see #74. Am I wrong?
@lucc yes I totally confused you with this eworm-de guy for some reason, sorry about that, my memory is fuzzy.
In which case, can we please stop putting braces around shell variables? I agreed to it because he asked me to, but it seems overkill, most people just write "$foo" and not "${foo}" in shell code.
Yes we can. (Or should I say "Yes I can" since that is something I could push to master rather quickly right now :)
This is a random collection of questions that I came up with when I read through the code in my attempt to create a PR as discussed in #58. They are mainly questions about the intention and reason of certain parts of the code.
--cmd
and-c
options into autoload files in order to clean up the shell script?vimpager
usesvim -c ':args 'file1 file2 ..'
to pass the files to vim (line 834). Is there a special reason why they are not listed as ordinary arguments?Maybe more later ...