Re: [PATCH] NO_PERL support

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

 



On Fri, Apr 03, 2009 at 05:02:16PM +0200, Johannes Schindelin wrote:

> > Yes, there are really two cases here:
> > 
> >   1. options to programs that will be disabled
> > 
> >   2. whole programs that will not be installed
> > 
> > Are you proposing to print "sorry, perl support not compiled in" (or
> > whatever) for case 1, but ignore case 2? (And I am not sure if that is a
> > bad idea, but I am trying to be clear on what you mean).
> 
> 1) as it is all too easy, but not 2) as that would require too much work, 
> which would be overkill.

I don't think 2 is that hard. See the patch below (on top of Robin's).
The question is whether it is more confusing for these programs to show
up in completion and then turn out to be totally broken, or for them to
simply be missing altogether. That is, as a git user who is accustomed
to the regular build, will I be more confused by:

  $ git svn
  Sorry, git was built without support for git-svn (NO_PERL).

or

  $ git svn
  git: 'svn' is not a git-command. See 'git --help'.

---
diff --git a/Makefile b/Makefile
index c4eb1ad..41abadb 100644
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,6 @@ SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
 
 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
-ifndef NO_PERL
 SCRIPT_PERL += git-add--interactive.perl
 SCRIPT_PERL += git-archimport.perl
 SCRIPT_PERL += git-cvsexportcommit.perl
@@ -309,9 +308,6 @@ SCRIPT_PERL += git-send-email.perl
 SCRIPT_PERL += git-svn.perl
 SCRIPTS += $(patsubst %.perl,%,$(SCRIPT_PERL)) \
 			git-instaweb
-else
-SCRIPT_PERL =
-endif
 
 # Empty...
 EXTRA_PROGRAMS =
@@ -1304,6 +1300,13 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
 	    $@.sh > $@+ && \
 	chmod +x $@+ && \
 	mv $@+ $@
+else # NO_PERL
+$(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : missing-perl.sh
+	$(QUIET_GEN)$(RM) $@ $@+ && \
+	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
+	    missing-perl.sh >$@+ && \
+	chmod +x $@+ && \
+	mv $@+ $@
 endif # NO_PERL
 
 configure: configure.ac
diff --git a/missing-perl.sh b/missing-perl.sh
new file mode 100644
index 0000000..d277be9
--- /dev/null
+++ b/missing-perl.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+echo "Sorry, git was built without support for `basename $0` (NO_PERL)."
+exit 128
--
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]

  Powered by Linux