better way to find Git.pm officially?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using Git.pm in a git subcommand.  There doesn't (yet :) seem to be
an official way to *find* the directory Git.pm was installed in to add
it to my @INC, so I can up with this ugly hack:


    #!/usr/bin/perl
    use strict;

    use lib $ENV{GITPERLLIB}
      ? split(/:/, $ENV{GITPERLLIB})
      : do {
        chomp(my $exec_path = qx{git --exec-path});
        open my $gitsvn, "<", "$exec_path/git-svn" or die "Cannot find
      git-svn";
        {
          last unless local $_ = readline $gitsvn;
          redo unless m{\Ause lib.*GITPERLLIB.*\|\| "(.*)"};
          "$1";
        }
      };

    use Git;

As in, find the git-svn binary (via git --exec-path), parse its second
line to see where the git installer put the GITPERLLIB, and then add
that myself.

Is there a simpler way?  Can we get "git --perl-path" added to the
binary or something?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxxxxxx> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]