forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-2.8.4-optional-cvs.patch
455 lines (396 loc) · 14.1 KB
/
git-2.8.4-optional-cvs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
From 4db842b8215a904e434f0f6265204129d64387b1 Mon Sep 17 00:00:00 2001
From: Robin Johnson <[email protected]>
Date: Tue, 7 Jun 2016 13:52:22 +0200
Subject: [PATCH] Makefile: Add NO_CVS define to disable all CVS interface
utilities
Forward-ported from 1.7.12 to current git.git v1.8.4
Forward-ported from v1.8.4 to v1.8.5.1
Forward-ported from v1.8.5.3 to v1.9.0_rc3
Forward-ported from 1.9.0_rc3 to current git.git v2.0.0_rc0
Forward-ported from v2.0.0_rc0 to v2.0.0
Forward-ported from v2.0.0 to v2.2.2
Forward-ported from v2.2.2 to v2.8.4
Signed-off-by: Lars Wendler <[email protected]>
---
Makefile | 51 ++++++++++++++++++++++++++++----------
t/t9200-git-cvsexportcommit.sh | 5 ++++
t/t9400-git-cvsserver-server.sh | 8 +++++-
t/t9401-git-cvsserver-crlf.sh | 15 +++++++----
t/t9600-cvsimport.sh | 41 +++++++++++++++++++-----------
t/t9601-cvsimport-vendor-branch.sh | 11 ++++++++
t/t9602-cvsimport-branches-tags.sh | 11 ++++++++
t/t9603-cvsimport-patchsets.sh | 11 ++++++++
t/test-lib.sh | 1 +
9 files changed, 120 insertions(+), 34 deletions(-)
diff --git a/Makefile b/Makefile
index de5a030..16ab4cd 100644
--- a/Makefile
+++ b/Makefile
@@ -267,6 +267,8 @@ all::
# Define SANE_TEXT_GREP to "-a" if you use recent versions of GNU grep
# and egrep that are pickier when their input contains non-ASCII data.
#
+# Define NO_CVS if you do not want any CVS interface utilities.
+#
# The TCL_PATH variable governs the location of the Tcl interpreter
# used to optimize git-gui for your system. Only used if NO_TCLTK
# is not set. Defaults to the bare 'tclsh'.
@@ -473,6 +475,7 @@ LIB_OBJS =
PROGRAM_OBJS =
PROGRAMS =
SCRIPT_PERL =
+SCRIPT_PERL_CVS =
SCRIPT_PYTHON =
SCRIPT_SH =
SCRIPT_LIB =
@@ -510,13 +513,14 @@ SCRIPT_LIB += git-sh-i18n
SCRIPT_PERL += git-add--interactive.perl
SCRIPT_PERL += git-difftool.perl
SCRIPT_PERL += git-archimport.perl
-SCRIPT_PERL += git-cvsexportcommit.perl
-SCRIPT_PERL += git-cvsimport.perl
-SCRIPT_PERL += git-cvsserver.perl
SCRIPT_PERL += git-relink.perl
SCRIPT_PERL += git-send-email.perl
SCRIPT_PERL += git-svn.perl
+SCRIPT_PERL_CVS += git-cvsexportcommit.perl
+SCRIPT_PERL_CVS += git-cvsimport.perl
+SCRIPT_PERL_CVS += git-cvsserver.perl
+
SCRIPT_PYTHON += git-p4.py
NO_INSTALL += git-remote-testgit
@@ -524,24 +528,26 @@ NO_INSTALL += git-remote-testgit
# Generated files for scripts
SCRIPT_SH_GEN = $(patsubst %.sh,%,$(SCRIPT_SH))
SCRIPT_PERL_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL))
+SCRIPT_PERL_CVS_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL_CVS))
SCRIPT_PYTHON_GEN = $(patsubst %.py,%,$(SCRIPT_PYTHON))
SCRIPT_SH_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_SH_GEN))
SCRIPT_PERL_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PERL_GEN))
+SCRIPT_PERL_CVS_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PERL_CVS_GEN))
SCRIPT_PYTHON_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PYTHON_GEN))
# Individual rules to allow e.g.
# "make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script"
# from subdirectories like contrib/*/
.PHONY: build-perl-script build-sh-script build-python-script
-build-perl-script: $(SCRIPT_PERL_GEN)
+build-perl-script: $(SCRIPT_PERL_GEN) $(SCRIPT_PERL_CVS_GEN)
build-sh-script: $(SCRIPT_SH_GEN)
build-python-script: $(SCRIPT_PYTHON_GEN)
.PHONY: install-perl-script install-sh-script install-python-script
install-sh-script: $(SCRIPT_SH_INS)
$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
-install-perl-script: $(SCRIPT_PERL_INS)
+install-perl-script: $(SCRIPT_PERL_INS) $(SCRIPT_PERL_CVS_INS)
$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
install-python-script: $(SCRIPT_PYTHON_INS)
$(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
@@ -550,12 +556,13 @@ install-python-script: $(SCRIPT_PYTHON_INS)
clean-sh-script:
$(RM) $(SCRIPT_SH_GEN)
clean-perl-script:
- $(RM) $(SCRIPT_PERL_GEN)
+ $(RM) $(SCRIPT_PERL_GEN) $(SCRIPT_PERL_CVS_GEN)
clean-python-script:
$(RM) $(SCRIPT_PYTHON_GEN)
SCRIPTS = $(SCRIPT_SH_INS) \
$(SCRIPT_PERL_INS) \
+ $(SCRIPT_PERL_CVS_INS) \
$(SCRIPT_PYTHON_INS) \
git-instaweb
@@ -1776,10 +1783,24 @@ git.res: git.rc GIT-VERSION-FILE
-DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
# This makes sure we depend on the NO_PERL setting itself.
-$(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS
+$(SCRIPT_PERL_GEN) $(SCRIPT_PERL_CVS_GEN): GIT-BUILD-OPTIONS
+
+_SCRIPT_PERL_GEN =
+_SCRIPT_PERL_NOGEN =
ifndef NO_PERL
-$(SCRIPT_PERL_GEN): perl/perl.mak
+
+_SCRIPT_PERL_GEN = $(SCRIPT_PERL_GEN)
+
+ifndef NO_CVS
+_SCRIPT_PERL_GEN += $(SCRIPT_PERL_CVS_GEN)
+else
+_SCRIPT_PERL_NOGEN += $(SCRIPT_PERL_CVS_GEN)
+_REASON = NO_CVS
+_REASON_CONTENT = $(NO_CVS)
+endif # NO_CVS
+
+$(_SCRIPT_PERL_GEN): perl/perl.mak
perl/perl.mak: perl/PM.stamp
@@ -1792,7 +1813,7 @@ perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ)
-$(SCRIPT_PERL_GEN): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
+$(_SCRIPT_PERL_GEN): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
$(QUIET_GEN)$(RM) $@ $@+ && \
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
@@ -1826,14 +1847,18 @@ git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES
chmod +x $@+ && \
mv $@+ $@
else # NO_PERL
-$(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh
+_SCRIPT_PERL_NOGEN += $(SCRIPT_PERL_GEN) $(SCRIPT_PERL_CVS_GEN) git-instaweb
+_REASON = NO_PERL
+_REASON_CONTENT = $(NO_PERL)
+endif # NO_PERL
+
+$(_SCRIPT_PERL_NOGEN): % : unimplemented.sh
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
- -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \
+ -e 's|@@REASON@@|$(_REASON)=$(_REASON_CONTENT)|g' \
unimplemented.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
-endif # NO_PERL
# This makes sure we depend on the NO_PYTHON setting itself.
$(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS
@@ -2064,7 +2089,7 @@ XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
LOCALIZED_SH = $(SCRIPT_SH) git-parse-remote.sh
-LOCALIZED_PERL = $(SCRIPT_PERL)
+LOCALIZED_PERL = $(SCRIPT_PERL) $(SCRIPT_PERL_CVS)
ifdef XGETTEXT_INCLUDE_TESTS
LOCALIZED_C += t/t0200/test.c
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index bb879a5..17be197 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -11,6 +11,11 @@ if ! test_have_prereq PERL; then
test_done
fi
+if ! test_have_prereq CVS; then
+ skip_all='skipping git cvsexportcommit tests, cvs not available'
+ test_done
+fi
+
cvs >/dev/null 2>&1
if test $? -ne 1
then
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 432c61d..6907b3f 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -11,9 +11,15 @@ cvs CLI client via git-cvsserver server'
. ./test-lib.sh
if ! test_have_prereq PERL; then
- skip_all='skipping git cvsserver tests, perl not available'
+ skip_all='skipping git-cvsserver tests, perl not available'
test_done
fi
+
+if ! test_have_prereq CVS; then
+ skip_all='skipping git-cvsserver tests, cvs not available'
+ test_done
+fi
+
cvs >/dev/null 2>&1
if test $? -ne 1
then
diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh
index f324b9f..e1eed50 100755
--- a/t/t9401-git-cvsserver-crlf.sh
+++ b/t/t9401-git-cvsserver-crlf.sh
@@ -57,15 +57,20 @@ check_status_options() {
return $stat
}
-cvs >/dev/null 2>&1
-if test $? -ne 1
+if ! test_have_prereq PERL
then
- skip_all='skipping git-cvsserver tests, cvs not found'
+ skip_all='skipping git-cvsserver tests, perl not available'
test_done
fi
-if ! test_have_prereq PERL
+if ! test_have_prereq CVS
then
- skip_all='skipping git-cvsserver tests, perl not available'
+ skip_all='skipping git-cvsserver tests, cvs not available'
+ test_done
+fi
+cvs >/dev/null 2>&1
+if test $? -ne 1
+then
+ skip_all='skipping git-cvsserver tests, cvs not found'
test_done
fi
perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 4c384ff..d601f32 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -3,14 +3,25 @@
test_description='git cvsimport basic tests'
. ./lib-cvs.sh
-test_expect_success PERL 'setup cvsroot environment' '
+if ! test_have_prereq PERL
+then
+ skip_all='skipping git cvsimport tests, perl not available'
+ test_done
+fi
+if ! test_have_prereq CVS
+then
+ skip_all='skipping git cvsimport tests, cvs not available'
+ test_done
+fi
+
+test_expect_success 'setup cvsroot environment' '
CVSROOT=$(pwd)/cvsroot &&
export CVSROOT
'
-test_expect_success PERL 'setup cvsroot' '$CVS init'
+test_expect_success 'setup cvsroot' '$CVS init'
-test_expect_success PERL 'setup a cvs module' '
+test_expect_success 'setup a cvs module' '
mkdir "$CVSROOT/module" &&
$CVS co -d module-cvs module &&
@@ -42,23 +53,23 @@ EOF
)
'
-test_expect_success PERL 'import a trivial module' '
+test_expect_success 'import a trivial module' '
git cvsimport -a -R -z 0 -C module-git module &&
test_cmp module-cvs/o_fortuna module-git/o_fortuna
'
-test_expect_success PERL 'pack refs' '(cd module-git && git gc)'
+test_expect_success 'pack refs' '(cd module-git && git gc)'
-test_expect_success PERL 'initial import has correct .git/cvs-revisions' '
+test_expect_success 'initial import has correct .git/cvs-revisions' '
(cd module-git &&
git log --format="o_fortuna 1.1 %H" -1) > expected &&
test_cmp expected module-git/.git/cvs-revisions
'
-test_expect_success PERL 'update cvs module' '
+test_expect_success 'update cvs module' '
(cd module-cvs &&
cat <<EOF >o_fortuna &&
O Fortune,
@@ -86,7 +97,7 @@ EOF
)
'
-test_expect_success PERL 'update git module' '
+test_expect_success 'update git module' '
(cd module-git &&
git config cvsimport.trackRevisions true &&
@@ -97,7 +108,7 @@ test_expect_success PERL 'update git module' '
'
-test_expect_success PERL 'update has correct .git/cvs-revisions' '
+test_expect_success 'update has correct .git/cvs-revisions' '
(cd module-git &&
git log --format="o_fortuna 1.1 %H" -1 HEAD^ &&
@@ -105,7 +116,7 @@ test_expect_success PERL 'update has correct .git/cvs-revisions' '
test_cmp expected module-git/.git/cvs-revisions
'
-test_expect_success PERL 'update cvs module' '
+test_expect_success 'update cvs module' '
(cd module-cvs &&
echo 1 >tick &&
@@ -114,7 +125,7 @@ test_expect_success PERL 'update cvs module' '
)
'
-test_expect_success PERL 'cvsimport.module config works' '
+test_expect_success 'cvsimport.module config works' '
(cd module-git &&
git config cvsimport.module module &&
@@ -126,7 +137,7 @@ test_expect_success PERL 'cvsimport.module config works' '
'
-test_expect_success PERL 'second update has correct .git/cvs-revisions' '
+test_expect_success 'second update has correct .git/cvs-revisions' '
(cd module-git &&
git log --format="o_fortuna 1.1 %H" -1 HEAD^^ &&
@@ -135,7 +146,7 @@ test_expect_success PERL 'second update has correct .git/cvs-revisions' '
test_cmp expected module-git/.git/cvs-revisions
'
-test_expect_success PERL 'import from a CVS working tree' '
+test_expect_success 'import from a CVS working tree' '
$CVS co -d import-from-wt module &&
(cd import-from-wt &&
@@ -148,12 +159,12 @@ test_expect_success PERL 'import from a CVS working tree' '
'
-test_expect_success PERL 'no .git/cvs-revisions created by default' '
+test_expect_success 'no .git/cvs-revisions created by default' '
! test -e import-from-wt/.git/cvs-revisions
'
-test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree master'
+test_expect_success 'test entire HEAD' 'test_cmp_branch_tree master'
test_done
diff --git a/t/t9601-cvsimport-vendor-branch.sh b/t/t9601-cvsimport-vendor-branch.sh
index 827d39f..d730a41 100755
--- a/t/t9601-cvsimport-vendor-branch.sh
+++ b/t/t9601-cvsimport-vendor-branch.sh
@@ -34,6 +34,17 @@
test_description='git cvsimport handling of vendor branches'
. ./lib-cvs.sh
+if ! test_have_prereq PERL
+then
+ skip_all='skipping git cvsimport tests, perl not available'
+ test_done
+fi
+if ! test_have_prereq CVS
+then
+ skip_all='skipping git cvsimport tests, cvs not available'
+ test_done
+fi
+
setup_cvs_test_repository t9601
test_expect_success PERL 'import a module with a vendor branch' '
diff --git a/t/t9602-cvsimport-branches-tags.sh b/t/t9602-cvsimport-branches-tags.sh
index e1db323..68f0974 100755
--- a/t/t9602-cvsimport-branches-tags.sh
+++ b/t/t9602-cvsimport-branches-tags.sh
@@ -6,6 +6,17 @@
test_description='git cvsimport handling of branches and tags'
. ./lib-cvs.sh
+if ! test_have_prereq PERL
+then
+ skip_all='skipping git cvsimport tests, perl not available'
+ test_done
+fi
+if ! test_have_prereq CVS
+then
+ skip_all='skipping git cvsimport tests, cvs not available'
+ test_done
+fi
+
setup_cvs_test_repository t9602
test_expect_success PERL 'import module' '
diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh
index c4c3c49..9b2957d 100755
--- a/t/t9603-cvsimport-patchsets.sh
+++ b/t/t9603-cvsimport-patchsets.sh
@@ -14,6 +14,17 @@
test_description='git cvsimport testing for correct patchset estimation'
. ./lib-cvs.sh
+if ! test_have_prereq PERL
+then
+ skip_all='skipping git cvsimport tests, perl not available'
+ test_done
+fi
+if ! test_have_prereq CVS
+then
+ skip_all='skipping git cvsimport tests, cvs not available'
+ test_done
+fi
+
setup_cvs_test_repository t9603
test_expect_failure PERL 'import with criss cross times on revisions' '
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0055ebb..5b9bd2e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -969,6 +969,7 @@ case $(uname -s) in
esac
( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
+test -z "$NO_CVS" && test_set_prereq CVS
test -z "$NO_PERL" && test_set_prereq PERL
test -z "$NO_PYTHON" && test_set_prereq PYTHON
test -n "$USE_LIBPCRE" && test_set_prereq LIBPCRE
--
2.8.3