git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] config.mak.uname: set PERL_PATH for FreeBSD 5.0+
@ 2016-07-20  2:56 Eric Wong
  2016-07-20 11:25 ` Johannes Schindelin
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2016-07-20  2:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Perl has not been part of the base system since FreeBSD 5.0:

	https://www.freebsd.org/releases/5.0R/relnotes-i386.html

Signed-off-by: Eric Wong <e@80x24.org>
---
  Does anybody still run git on FreeBSD 4.x or earlier?
  4.11 was released a few months before git in 2005:

	https://www.freebsd.org/releases/

 config.mak.uname | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/config.mak.uname b/config.mak.uname
index a88f139..6c29545 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -202,6 +202,11 @@ ifeq ($(uname_S),FreeBSD)
 		NO_UINTMAX_T = YesPlease
 		NO_STRTOUMAX = YesPlease
 	endif
+	R_MAJOR := $(shell expr "$(uname_R)" : '\([0-9]*\)\.')
+
+	ifeq ($(shell test "$(R_MAJOR)" -ge 5 && echo 1),1)
+		PERL_PATH = /usr/local/bin/perl
+	endif
 	PYTHON_PATH = /usr/local/bin/python
 	HAVE_PATHS_H = YesPlease
 	GMTIME_UNRELIABLE_ERRORS = UnfortunatelyYes
-- 
EW

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

* Re: [PATCH] config.mak.uname: set PERL_PATH for FreeBSD 5.0+
  2016-07-20  2:56 [PATCH] config.mak.uname: set PERL_PATH for FreeBSD 5.0+ Eric Wong
@ 2016-07-20 11:25 ` Johannes Schindelin
  2016-07-20 18:07   ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Schindelin @ 2016-07-20 11:25 UTC (permalink / raw)
  To: Eric Wong; +Cc: Junio C Hamano, git

Hi Eric,

On Wed, 20 Jul 2016, Eric Wong wrote:

> diff --git a/config.mak.uname b/config.mak.uname
> index a88f139..6c29545 100644
> --- a/config.mak.uname
> +++ b/config.mak.uname
> @@ -202,6 +202,11 @@ ifeq ($(uname_S),FreeBSD)
>  		NO_UINTMAX_T = YesPlease
>  		NO_STRTOUMAX = YesPlease
>  	endif
> +	R_MAJOR := $(shell expr "$(uname_R)" : '\([0-9]*\)\.')
> +
> +	ifeq ($(shell test "$(R_MAJOR)" -ge 5 && echo 1),1)
> +		PERL_PATH = /usr/local/bin/perl
> +	endif

In keeping with other uname_R usage, should this not read

	# Since FreeBSD 5.0, Perl is part of the core
	ifneq ($(shell expr "$(uname_R)" : '[1-4]\.'),2)
		PERL_PATH = /usr/local/bin/perl
	endif

instead?

Ciao,
Dscho

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

* Re: [PATCH] config.mak.uname: set PERL_PATH for FreeBSD 5.0+
  2016-07-20 11:25 ` Johannes Schindelin
@ 2016-07-20 18:07   ` Eric Wong
  2016-07-20 18:10     ` Junio C Hamano
  2016-07-21 15:17     ` Johannes Schindelin
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Wong @ 2016-07-20 18:07 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi Eric,
> 
> On Wed, 20 Jul 2016, Eric Wong wrote:
> 
> > diff --git a/config.mak.uname b/config.mak.uname
> > index a88f139..6c29545 100644
> > --- a/config.mak.uname
> > +++ b/config.mak.uname
> > @@ -202,6 +202,11 @@ ifeq ($(uname_S),FreeBSD)
> >  		NO_UINTMAX_T = YesPlease
> >  		NO_STRTOUMAX = YesPlease
> >  	endif
> > +	R_MAJOR := $(shell expr "$(uname_R)" : '\([0-9]*\)\.')
> > +
> > +	ifeq ($(shell test "$(R_MAJOR)" -ge 5 && echo 1),1)
> > +		PERL_PATH = /usr/local/bin/perl
> > +	endif
> 
> In keeping with other uname_R usage, should this not read
> 
> 	# Since FreeBSD 5.0, Perl is part of the core
> 	ifneq ($(shell expr "$(uname_R)" : '[1-4]\.'),2)
> 		PERL_PATH = /usr/local/bin/perl
> 	endif
> 
> instead?

That's fine; however I don't use `expr` often, so it required
a little more time to realize the '2' means 2 characters were
matched.

Also, my use of a numeric comparison may be more future-proof
in case FreeBSD decides to have /usr/bin/perl again.

I also wonder why we don't use `which` to search for somewhat
standard path components, instead.  Something like:

  PERL_PATH = $(shell PATH=/bin:/usr/bin:/usr/local/bin which perl)

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

* Re: [PATCH] config.mak.uname: set PERL_PATH for FreeBSD 5.0+
  2016-07-20 18:07   ` Eric Wong
@ 2016-07-20 18:10     ` Junio C Hamano
  2016-07-21  1:02       ` brian m. carlson
  2016-07-21 15:17     ` Johannes Schindelin
  1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2016-07-20 18:10 UTC (permalink / raw)
  To: Eric Wong; +Cc: Johannes Schindelin, Git Mailing List

On Wed, Jul 20, 2016 at 11:07 AM, Eric Wong <e@80x24.org> wrote:
> Also, my use of a numeric comparison may be more future-proof
> in case FreeBSD decides to have /usr/bin/perl again.
>
> I also wonder why we don't use `which` to search for somewhat
> standard path components, instead.  Something like:

Because historically output from "which" was not meant to be
machine parseable (some implementation said 'perl is /usr/bin/perl')

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

* Re: [PATCH] config.mak.uname: set PERL_PATH for FreeBSD 5.0+
  2016-07-20 18:10     ` Junio C Hamano
@ 2016-07-21  1:02       ` brian m. carlson
  0 siblings, 0 replies; 6+ messages in thread
From: brian m. carlson @ 2016-07-21  1:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eric Wong, Johannes Schindelin, Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

On Wed, Jul 20, 2016 at 11:10:40AM -0700, Junio C Hamano wrote:
> On Wed, Jul 20, 2016 at 11:07 AM, Eric Wong <e@80x24.org> wrote:
> > Also, my use of a numeric comparison may be more future-proof
> > in case FreeBSD decides to have /usr/bin/perl again.
> >
> > I also wonder why we don't use `which` to search for somewhat
> > standard path components, instead.  Something like:
> 
> Because historically output from "which" was not meant to be
> machine parseable (some implementation said 'perl is /usr/bin/perl')

The POSIXy way to write which is "command -v", which may or may not be
more portable.  It does have the desired output, though.
-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] config.mak.uname: set PERL_PATH for FreeBSD 5.0+
  2016-07-20 18:07   ` Eric Wong
  2016-07-20 18:10     ` Junio C Hamano
@ 2016-07-21 15:17     ` Johannes Schindelin
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2016-07-21 15:17 UTC (permalink / raw)
  To: Eric Wong; +Cc: Junio C Hamano, git

Hi Eric,

On Wed, 20 Jul 2016, Eric Wong wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > 
> > On Wed, 20 Jul 2016, Eric Wong wrote:
> > 
> > > diff --git a/config.mak.uname b/config.mak.uname
> > > index a88f139..6c29545 100644
> > > --- a/config.mak.uname
> > > +++ b/config.mak.uname
> > > @@ -202,6 +202,11 @@ ifeq ($(uname_S),FreeBSD)
> > >  		NO_UINTMAX_T = YesPlease
> > >  		NO_STRTOUMAX = YesPlease
> > >  	endif
> > > +	R_MAJOR := $(shell expr "$(uname_R)" : '\([0-9]*\)\.')
> > > +
> > > +	ifeq ($(shell test "$(R_MAJOR)" -ge 5 && echo 1),1)
> > > +		PERL_PATH = /usr/local/bin/perl
> > > +	endif
> > 
> > In keeping with other uname_R usage, should this not read
> > 
> > 	# Since FreeBSD 5.0, Perl is part of the core
> > 	ifneq ($(shell expr "$(uname_R)" : '[1-4]\.'),2)
> > 		PERL_PATH = /usr/local/bin/perl
> > 	endif
> > 
> > instead?
> 
> That's fine; however I don't use `expr` often, so it required
> a little more time to realize the '2' means 2 characters were
> matched.

I never use `expr`, so I had to go and see the surrounding code to
determine what the code style is.

> Also, my use of a numeric comparison may be more future-proof
> in case FreeBSD decides to have /usr/bin/perl again.

That is a very theoretical concern ;-)

Ciao,
Dscho

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

end of thread, other threads:[~2016-07-21 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-20  2:56 [PATCH] config.mak.uname: set PERL_PATH for FreeBSD 5.0+ Eric Wong
2016-07-20 11:25 ` Johannes Schindelin
2016-07-20 18:07   ` Eric Wong
2016-07-20 18:10     ` Junio C Hamano
2016-07-21  1:02       ` brian m. carlson
2016-07-21 15:17     ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).