From: Junio C Hamano <gitster@pobox•com>
To: Lea Wiemann <lewiemann@gmail•com>
Cc: git@vger•kernel.org, Lea Wiemann <LeWiemann@gmail•com>
Subject: Re: [PATCH v2] test-lib.sh: set PERL5LIB instead of GITPERLLIB
Date: Mon, 02 Jun 2008 13:01:40 -0700 [thread overview]
Message-ID: <7v4p8b7gij.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1212415996-32130-1-git-send-email-LeWiemann@gmail.com> (Lea Wiemann's message of "Mon, 2 Jun 2008 16:13:16 +0200")
Lea Wiemann <lewiemann@gmail•com> writes:
> From: Lea Wiemann <lewiemann@gmail•com>
>
> By setting PERL5LIB for the tests, we enable Perl test scripts to just
> say "use Git;" without adding the GITPERLLIB paths to @INC beforehand.
>
> Also, unset GITPERLLIB so that user-set paths in GETPERLLIB don't
> cause the wrong module to be loaded.
>
> Signed-off-by: Lea Wiemann <LeWiemann@gmail•com>
> ---
> Added since v1: Unset GITPERLLIB.
This goes even further in the opposite direction from the original. It
looks cleaner, and I'd prefer the approach _if_ it worked.
But I do not think it does.
I think the reason we did not do this long time ago in 6fcca93 (Use
$GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging,
2006-07-03) was because of the precedence between "use lib @these_paths"
and $PERL5LIB does not work the way you seem to think it does.
If you say in your script:
use lib '/usr/local/git/perl'
use Git;
(and we do want to say so in our script to make sure that people can
install Git.pm outside of system install paths), running the script with
PERL5LIB set to elsewhere that has Git.pm would not help.
I just tried:
$ pwd
/net/knick/home/junio/junk/
$ cat j.perl
#!/usr/bin/perl -w
use lib '/net/knick/home/junio/junk/1dir';
use G;
print $G::it;
$ cat 1dir/G.pm
package G;
our $it = 1;
1;
$ cat 2dir/G.pm
package G;
our $it = 2;
1;
$ perl -w j.perl
1
$ PERL5LIB=/net/knick/home/junio/junk/2dir perl -w j.perl
1
Because "t/t9700/<many>.perl" will _not_ be installed anyway, I do not
think they need to be "built" like the scripted Porcelain commands. If
they unconditionally do "use lib $ENV{GITPERLLIB};" upfront, wouldn't that
be enough to guarantee that you would use the freshly built one during the
test, not the instsalled one?
next prev parent reply other threads:[~2008-06-02 20:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-30 23:00 [PATCH] gitweb: use Git.pm, and use its parse_rev method for git_get_head_hash Lea Wiemann
2008-05-30 23:03 ` Lea Wiemann
2008-05-31 9:40 ` Jakub Narebski
2008-05-31 12:39 ` Lea Wiemann
2008-06-01 22:19 ` Jakub Narebski
2008-06-02 5:35 ` Junio C Hamano
2008-06-02 9:29 ` Petr Baudis
2008-06-02 21:32 ` Jakub Narebski
2008-06-02 22:31 ` Lea Wiemann
2008-05-31 13:04 ` Petr Baudis
2008-05-31 14:19 ` [PATCH v2] " Lea Wiemann
2008-05-31 14:34 ` Lea Wiemann
2008-06-01 8:23 ` Junio C Hamano
2008-06-01 15:44 ` Lea Wiemann
2008-06-01 21:33 ` Junio C Hamano
2008-06-01 22:16 ` [PATCH] test-lib.sh: set PERL5LIB instead of GITPERLLIB Lea Wiemann
2008-06-02 5:17 ` Junio C Hamano
2008-06-02 14:08 ` Lea Wiemann
2008-06-02 14:13 ` [PATCH v2] " Lea Wiemann
2008-06-02 20:01 ` Junio C Hamano [this message]
2008-06-02 22:19 ` Lea Wiemann
2008-06-03 0:20 ` [PATCH] " Lea Wiemann
2008-06-01 23:18 ` [PATCH v2] gitweb: use Git.pm, and use its parse_rev method for git_get_head_hash Lea Wiemann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v4p8b7gij.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=lewiemann@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox