From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH v2 2/6] cvsimport: allow setting a custom cvsps (2.x) program name
Date: Sun, 13 Jan 2013 23:25:47 -0800 [thread overview]
Message-ID: <1358148351-31552-3-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1358148351-31552-1-git-send-email-gitster@pobox.com>
Distros may ship old cvsps under a different name, or the user may
install it outside the normal $PATH. Allow setting CVSPS2_PATH from
the build environment.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Makefile | 9 +++++++--
git-cvsimport.perl | 4 +++-
t/lib-cvs.sh | 4 +++-
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 1695075..dd2a024 100644
--- a/Makefile
+++ b/Makefile
@@ -576,9 +576,11 @@ endif
ifndef PYTHON_PATH
PYTHON_PATH = /usr/bin/python
endif
+ifndef CVSPS2_PATH
+ CVSPS2_PATH = cvsps
+endif
-export PERL_PATH
-export PYTHON_PATH
+export PERL_PATH PYTHON_PATH CVSPS2_PATH
LIB_FILE = libgit.a
XDIFF_LIB = xdiff/lib.a
@@ -1516,6 +1518,7 @@ SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
+CVSPS2_PATH_SQ = $(subst ','\'',$(CVSPS2_PATH))
DIFF_SQ = $(subst ','\'',$(DIFF))
LIBS = $(GITLIBS) $(EXTLIBS)
@@ -1729,6 +1732,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE
-e ' H' \
-e ' x' \
-e '}' \
+ -e 's|@@CVSPS2_PATH@@|$(CVSPS2_PATH_SQ)|g' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
$@.perl >$@+ && \
chmod +x $@+ && \
@@ -2107,6 +2111,7 @@ GIT-LDFLAGS: FORCE
GIT-BUILD-OPTIONS: FORCE
@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
@echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
+ @echo CVSPS2_PATH=\''$(subst ','\'',$(CVSPS2_PATH_SQ))'\' >>$@
@echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@
@echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@
@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 0a31ebd..ad460a5 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -33,6 +33,8 @@
our ($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,@opt_M,$opt_A,$opt_S,$opt_L, $opt_a, $opt_r, $opt_R);
my (%conv_author_name, %conv_author_email, %conv_author_tz);
+my $cvsps2 = "@@CVSPS2_PATH@@";
+
sub usage(;$) {
my $msg = shift;
print(STDERR "Error: $msg\n") if $msg;
@@ -751,7 +753,7 @@ sub munge_user_filename {
unless (defined($opt_p) && $opt_p =~ m/--no-cvs-direct/) {
push @opt, '--cvs-direct';
}
- exec("cvsps","--norc",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
+ exec($cvsps2,"--norc",@opt,"-u","-A",'--root',$opt_d,$cvs_tree);
die "Could not start cvsps: $!\n";
}
($cvspsfh, $cvspsfile) = tempfile('gitXXXXXX', SUFFIX => '.cvsps',
diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 44263ad..bdab63c 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -13,7 +13,9 @@ fi
CVS="cvs -f"
export CVS
-cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
+CVSPS="$CVSPS2_PATH"
+
+cvsps_version=`$CVSPS -h 2>&1 | sed -ne 's/cvsps version //p'`
case "$cvsps_version" in
2.1 | 2.2*)
;;
--
1.8.1.421.g6236851
next prev parent reply other threads:[~2013-01-14 7:26 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 3:32 [PATCH] cvsimport: rewrite to use cvsps 3.x to fix major bugs Junio C Hamano
2013-01-11 16:31 ` Junio C Hamano
2013-01-11 18:58 ` Eric S. Raymond
2013-01-11 19:17 ` Junio C Hamano
2013-01-11 19:27 ` Junio C Hamano
2013-01-12 5:04 ` Eric S. Raymond
2013-01-12 5:20 ` Junio C Hamano
2013-01-12 5:38 ` [PATCH] t/t960[123]: remove leftover scripts Junio C Hamano
2013-01-12 6:06 ` Chris Rorvick
2013-01-12 8:40 ` [PATCH] t/lib-cvs: cvsimport no longer works without Python >= 2.7 Junio C Hamano
2013-01-12 15:27 ` Michael Haggerty
2013-01-13 17:17 ` John Keeping
2013-01-12 15:47 ` [PATCH] cvsimport: rewrite to use cvsps 3.x to fix major bugs Eric S. Raymond
2013-01-12 15:13 ` Michael Haggerty
2013-01-12 16:11 ` Eric S. Raymond
2013-01-12 18:16 ` Jonathan Nieder
2013-01-12 18:26 ` Jonathan Nieder
2013-01-13 22:20 ` Junio C Hamano
2013-01-13 23:27 ` Junio C Hamano
2013-01-14 1:40 ` [PATCH 0/3] A smoother transition plan for cvsimport Junio C Hamano
2013-01-14 1:40 ` [PATCH 1/3] cvsimport: allow setting a custom cvsps (2.x) program name Junio C Hamano
2013-01-14 1:40 ` [PATCH 2/3] cvsimport: introduce a version-switch wrapper Junio C Hamano
2013-01-14 1:47 ` Junio C Hamano
2013-01-14 1:40 ` [PATCH 3/3] cvsimport: start adding cvsps 3.x support Junio C Hamano
2013-01-15 6:19 ` Chris Rorvick
2013-01-15 6:44 ` Junio C Hamano
2013-01-14 5:12 ` [PATCH] cvsimport: rewrite to use cvsps 3.x to fix major bugs Michael Haggerty
2013-01-14 7:25 ` [PATCH v2 0/6] A smoother transition plan for cvsimport Junio C Hamano
2013-01-14 7:25 ` [PATCH v2 1/6] Makefile: add description on PERL/PYTHON_PATH Junio C Hamano
2013-01-14 7:25 ` Junio C Hamano [this message]
2013-01-14 7:25 ` [PATCH v2 3/6] cvsimport: introduce a version-switch wrapper Junio C Hamano
2013-01-14 7:25 ` [PATCH v2 4/6] cvsimport: start adding cvsps 3.x support Junio C Hamano
2013-01-14 7:25 ` [PATCH v2 5/6] cvsimport: make tests reusable for cvsimport-3 Junio C Hamano
2013-01-14 7:25 ` [PATCH v2 6/6] cvsimport-3: add a sample test Junio C Hamano
2013-01-14 7:47 ` [PATCH v2 0/6] A smoother transition plan for cvsimport Jonathan Nieder
2013-01-14 7:48 ` [PATCH v2 7/6] t9600: further prepare for sharing Junio C Hamano
2013-01-14 7:52 ` [PATCH v2 8/6] t9600: adjust for new cvsimport Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358148351-31552-3-git-send-email-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).