git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Making perl scripts include the correct Git.pm
@ 2006-07-02 21:40 Petr Baudis
  2006-07-03  0:02 ` Junio C Hamano
  0 siblings, 1 reply; 27+ messages in thread
From: Petr Baudis @ 2006-07-02 21:40 UTC (permalink / raw)
  To: git

  Hi,

  the discussion of the topic became so scatterred that it's rather
difficult to follow now and I get a feeling that we are kind of running
in circles now, so this is my attempt to summarize it:

  Desired behaviour when running Git's perl scripts (ordered by
degree of necessity):

  (D1) When running installed script, it should include Git.pm from the
same installation.

  (D2) When running the testsuite, it should include Git.pm from the
source tree.

  (D3) When running script directly from source tree, it should include
Git.pm from the source tree.


  (i) The original solution passed -I on the #!/usr/bin/perl line, but
that was ugly, was prone to hit various OS limits on the shebang line
and violated both (D2) and (D3).


  (ii) My proposed second solution was to add an autogenerated line to
the Git's perl scripts saying something like:

	use lib ('instlibdir', 'srclibdir');

This fulfills all (D1), (D2) and (D3), but is perceived by Junio as
"disgusting".


  (iii) The currently used solution is to effectively

	use lib ('instlibdir');

to the Git's perl scripts. This violated (D3) and (D2) too, since
use lib is the last from all the @INC modifiers to be seen and thus
overrides and $PERL5LIB set in the testsuite.


  (iv) Variation of (iii), probably Junio's original intention when
implementing it:

	push @INC, 'instlibdir';

This fulfills (D2). It does not fulfill (D3) per se since the user
has to set $PERL5LIB manually when running Git without installing it,
but it is at least fulfillable. However, most importantly this does
not even fulfill (D1) since if you e.g. consider user-local installation
of Git over system-wide installation of Git, local perl scripts will
use the globally installed Git.pm.


  (v) If you throw away user-friendly (D3) requirement and insist
on (iii) being disgusting, this is a newly proposed possible variation
"(iv) meets (i)":

	#!/usr/bin/perl -Imarker
	@INC = map { $_ eq 'marker' ? 'instlibdir' : $_ } @INC;

(I think this is more disgusting than (iii), but tastes differ. ;)


  So, what's the way out?


  PS: Is this the only remaining problem with Git.pm or do we have
anything else to cope with, esp. before it gets considered to be a
next material?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2006-07-08  7:36 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-02 21:40 Making perl scripts include the correct Git.pm Petr Baudis
2006-07-03  0:02 ` Junio C Hamano
2006-06-28  0:23   ` Quick merge status updates Junio C Hamano
2006-06-28  5:04     ` Pavel Roskin
2006-06-28  8:49       ` Junio C Hamano
2006-06-28 10:05         ` Pavel Roskin
2006-06-28 10:14           ` Junio C Hamano
2006-07-02 20:49           ` Petr Baudis
2006-07-02 21:33             ` Junio C Hamano
2006-07-02 21:49               ` Petr Baudis
2006-07-02 22:50                 ` Junio C Hamano
2006-07-02 23:49                   ` Junio C Hamano
2006-07-03  0:00                     ` Linus Torvalds
2006-07-03  0:06                       ` Junio C Hamano
2006-07-03 20:29                     ` Petr Baudis
2006-07-03 21:16                       ` [PATCH] Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging Petr Baudis
2006-07-08  7:36             ` Quick merge status updates Pavel Roskin
2006-06-28  7:32     ` Johannes Schindelin
2006-06-28  7:39       ` Johannes Schindelin
2006-06-28  8:51         ` Junio C Hamano
2006-06-28  9:13           ` Johannes Schindelin
2006-07-01 23:48         ` [PATCH] Git.pm: Avoid ppport.h Petr Baudis
2006-07-02  9:52           ` Johannes Schindelin
2006-07-02 19:05             ` Junio C Hamano
2006-07-02 20:57               ` [PATCH] Git.pm: Don't #define around die Petr Baudis
2006-07-03  1:38   ` Making perl scripts include the correct Git.pm Junio C Hamano
2006-07-04 19:01     ` Marco Costalba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).