ComputationalProteomicsUnit / maker

Makefile for R packages
GNU General Public License v3.0
31 stars 5 forks source link

Replacing PKG by PKGDIR? #15

Closed sgibb closed 9 years ago

sgibb commented 9 years ago

I am thinking about replacing the PKG variable by the PKGDIR variable. If the package directory and the package name are the same nothing would change, e.g.: make PKGDIR=cleaver check If they differ the PKG variable could extracted from the DESCRIPTION file (in the same way as we are doing it for VERSION; this behaviour would be the same as in devtools). Currently you need to use both variables or extend your .makerrc if the package directory has a different name (see #13 ), e.g.: make PKG=Rcmdr PKGDIR=Rcmdr/pkg/Rcmdr-current/ check

What do you think?

CC: @lgatto @lbraglia

lgatto commented 9 years ago

And if PKG and PKGDIR are the same, what would make PKG=cleaver check do? Anyway, fine by me.

lbraglia commented 9 years ago

Seems a nice change to me... after all maker could need to know only where are the sources (package name is already there). Furthermore, this change improves maker ability to check/compile/etc anywhere located packages.

Maybe, since there's no autocompletion with [tab] for make variables (at least on my system, but i didn't searched too much), we could consider to keep PKG (as it were PKGDIR, but it's a bit shorter to type) and PKGNAME for getting the name from DESCRIPTION. So eg

make check PKG=Rcmdr/pkg/Rcmdr-current/

parses that directory's DESCRIPTION and saves Rcmdr (i guess) in PKGNAME.

lgatto commented 9 years ago

@lbraglia I have autocompletion using zsh: mak[TAB] che[TAB] P[TAB]=clea[TAB] works

lbraglia commented 9 years ago

@lgatto thanks, i'm currently using bash (looking for a standard bash way asap) . Didn't know zsh, seems impressive!

lbraglia commented 9 years ago

seems not too straightforward

http://stackoverflow.com/questions/25766882

i'm probably moving to zsh, but maybe standard bash comfort (and backward compatibility) could be a plus.

JM2C; anyway, ok for me regardless variable naming.

Best, Luca

sgibb commented 9 years ago

At least for the tab completion @lgatto mentioned in this issue there is a bash way of doing it (bash has autocompletion, too) and no need to swicth to zsh. I don't know which OS you are using but on Debian GNU/Linux you just have to install the bash-completion package.

Best wishes,

Sebastian

sgibb commented 9 years ago

@lbraglia Sorry. I have misread your question. Even with the bash-completion there is no Makefile variable autocompletion.