[Edinburgh-pm] Embarrassingly n00bish question
perl at aaroncrane.co.uk
Mon Jul 11 04:43:14 PDT 2011
Miles Gould <miles at assyrian.org.uk> wrote:
> On Sun, Jul 10, 2011 at 7:16 PM, Aaron Crane <perl at aaroncrane.co.uk> wrote:
>> 1. My ~/usr is under revision control.
> Aha! I'd thought you kept ~ under revision control, which I'm
> reluctant to do.
Me too. That's always sounded... awkward to me.
> Having a private ~/usr makes a lot more sense to me.
> How do you handle machine-specific configuration? Do you source
> `hostname`.bashrc from your main .bashrc or something?
Yep, pretty much.
$ tail -5 ~/.bash_profile
## Machine-specific configuration
[ -f $f ] && . $f
: # Ensure $? is 0
Except that, in practice, it's years since I actually needed to put
anything in one of those. Where possible, it seems better to
autodetect the right behaviour rather than picking it based on mere
hostname. For example, I use Emacs on my main computer, so I want
$EDITOR to be emacsclient (to open files in my running Emacs
instance). But I don't like Emacs over a plain tty, so on servers I
want $EDITOR to be vim. That decision could be made on a per-host
basis, but I prefer to set $EDITOR to be ~/usr/bin/e, a script which
execs emacsclient (if it exists and there's a running Emacs) or vim
(if it exists), or vi (as a fallback).
>> I'm not quite sure what you're asking there. I take it you don't mean
>> things like Dist::Zilla?
> I'm not sure - my map of the toolscape is largely blank. Am I right in
> thinking that Dist::Zilla solves the problem "I have a git repo, and I
> want to turn it into a tarball with embedded Makefile.PL that can be
> uploaded to CPAN and/or installed"? I did look into it for the Oyster
> hackathon, but the volume of documentation overflowed my input
I haven't used it, but my understanding is that its target problem
space is roughly "I have a Perl dist that I'd like to upload to CPAN",
except its target audience probably has a large number of such dists,
and it might be "my local darkpan" rather than "CPAN". I gather it
does things like automating the update of $VERSION across all the
library files in a dist, and regenerating the README from the POD, and
all the other little things that you might need to do before pushing a
tarball to CPAN. And, yes, if you're using Git, it can automatically
commit version-number changes, and tag the repo, and so on.
While that's all good stuff, it doesn't seem to be directly related to
the problem of "I have some private code that I'd like to easily run
out of its Git repo".
> [FWIW: I don't have root access to the machine concerned - at least, I
> don't have root access to all the machines concerned.]
I think that means that, if you want to install things from CPAN (or
things that look like CPAN dists even if they aren't on CPAN), you'll
want a personal Perl (possibly using perlbrew) and/or local::lib on
the machines where you don't have root. (Not that I've used either of
Aaron Crane ** http://aaroncrane.co.uk/
More information about the Edinburgh-pm