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
|
Implement 95% of the NO_PERL functionality, to build Git without any Perl
support, because some Gentoo users want a Git without any Perl whatesoever
(Gentoo bug #214168).
Remaining bits are doing configure.ac as well as git-remote usage in:
t5502-quickfetch.sh
t5512-ls-remote.sh
t5520-pull.sh
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Bugzilla-URL: http://bugs.gentoo.org/show_bug.cgi?id=214168
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/Makefile git-1.5.4.4/Makefile
--- git-1.5.4.4.orig/Makefile 2008-03-22 15:25:24.986081000 -0700
+++ git-1.5.4.4/Makefile 2008-03-22 16:46:04.612806869 -0700
@@ -123,6 +123,8 @@
#
# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
# MakeMaker (e.g. using ActiveState under Cygwin).
+
+# Define NO_PERL if you do not want Perl scripts at all.
#
# Define NO_TCLTK if you do not want Tcl/Tk GUI.
#
@@ -233,15 +235,18 @@
git-stash.sh \
git-help--browse.sh
+SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH))
+ifndef NO_PERL
SCRIPT_PERL = \
git-add--interactive.perl \
git-archimport.perl git-cvsimport.perl git-relink.perl \
git-cvsserver.perl git-remote.perl git-cvsexportcommit.perl \
git-send-email.perl git-svn.perl
-
-SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
- $(patsubst %.perl,%,$(SCRIPT_PERL)) \
- git-instaweb
+SCRIPTS += $(patsubst %.perl,%,$(SCRIPT_PERL)) \
+ git-instaweb
+else
+SCRIPT_PERL =
+endif
# ... and all the rest that could be moved out of bindir to gitexecdir
PROGRAMS = \
@@ -276,7 +281,10 @@
ALL_PROGRAMS += git-merge-subtree$X
# what 'all' will build but not install in gitexecdir
-OTHER_PROGRAMS = git$X gitweb/gitweb.cgi
+OTHER_PROGRAMS = git$X
+ifndef NO_PERL
+OTHER_PROGRAMS += gitweb/gitweb.cgi
+endif
# Set paths to tools early so that they can be used for version tests.
ifndef SHELL_PATH
@@ -570,6 +578,10 @@
endif
endif
+ifdef NO_PERL
+ BASIC_CFLAGS += -DNO_PERL
+endif
+
ifdef ZLIB_PATH
BASIC_CFLAGS += -I$(ZLIB_PATH)/include
EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
@@ -731,6 +743,11 @@
ifeq ($(TCLTK_PATH),)
NO_TCLTK=NoThanks
endif
+ifeq ($(PERL_PATH),)
+NO_PERL=NoThanks
+export NO_PERL
+export NO_PERL_MAKEMAKER
+endif
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
QUIET_SUBDIR1 =
@@ -803,7 +820,9 @@
$(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) all
$(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all
endif
+ifndef NO_PERL
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
+endif
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
strip: $(PROGRAMS) git$X
@@ -844,6 +863,7 @@
chmod +x $@+ && \
mv $@+ $@
+ifndef NO_PERL
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL
@@ -902,6 +922,7 @@
$@.sh > $@+ && \
chmod +x $@+ && \
mv $@+ $@
+endif # NO_PERL
configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
@@ -1052,7 +1073,9 @@
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(INSTALL) git$X '$(DESTDIR_SQ)$(bindir_SQ)'
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
+ifndef NO_PERL
$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
+endif
ifndef NO_TCLTK
$(MAKE) -C gitk-git install
$(MAKE) -C git-gui install
@@ -1141,9 +1164,11 @@
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
- $(RM) gitweb/gitweb.cgi
$(MAKE) -C Documentation/ clean
+ifndef NO_PERL
+ $(RM) gitweb/gitweb.cgi
$(MAKE) -C perl clean
+endif
$(MAKE) -C templates/ clean
$(MAKE) -C t/ clean
ifndef NO_TCLTK
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/builtin-add.c git-1.5.4.4/builtin-add.c
--- git-1.5.4.4.orig/builtin-add.c 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/builtin-add.c 2008-03-22 15:57:31.759925335 -0700
@@ -135,6 +135,7 @@
free(seen);
}
+#ifndef NO_PERL
static const char **validate_pathspec(int argc, const char **argv, const char *prefix)
{
const char **pathspec = get_pathspec(prefix, argv);
@@ -170,6 +171,7 @@
free(args);
return status;
}
+#endif
static struct lock_file lock_file;
@@ -182,8 +184,10 @@
OPT__DRY_RUN(&show_only),
OPT__VERBOSE(&verbose),
OPT_GROUP(""),
+#ifndef NO_PERL
OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"),
OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"),
+#endif
OPT_BOOLEAN('f', NULL, &ignored_too, "allow adding otherwise ignored files"),
OPT_BOOLEAN('u', NULL, &take_worktree_changes, "update tracked files"),
OPT_BOOLEAN( 0 , "refresh", &refresh_only, "don't add, only refresh the index"),
@@ -198,10 +202,12 @@
argc = parse_options(argc, argv, builtin_add_options,
builtin_add_usage, 0);
+#ifndef NO_PERL
if (patch_interactive)
add_interactive = 1;
if (add_interactive)
exit(interactive_add(argc, argv, prefix));
+#endif
git_config(git_default_config);
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/builtin-commit.c git-1.5.4.4/builtin-commit.c
--- git-1.5.4.4.orig/builtin-commit.c 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/builtin-commit.c 2008-03-22 15:58:41.139317545 -0700
@@ -96,7 +96,9 @@
OPT_GROUP("Commit contents options"),
OPT_BOOLEAN('a', "all", &all, "commit all changed files"),
OPT_BOOLEAN('i', "include", &also, "add specified files to index for commit"),
+#ifndef NO_PERL
OPT_BOOLEAN(0, "interactive", &interactive, "interactively add files"),
+#endif
OPT_BOOLEAN('o', "only", &only, ""),
OPT_BOOLEAN('n', "no-verify", &no_verify, "bypass pre-commit hook"),
OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"),
@@ -213,11 +215,13 @@
struct path_list partial;
const char **pathspec = NULL;
+#ifndef NO_PERL
if (interactive) {
interactive_add(argc, argv, prefix);
commit_style = COMMIT_AS_IS;
return get_index_file();
}
+#endif
if (read_cache() < 0)
die("index file corrupt");
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/t/lib-git-svn.sh git-1.5.4.4/t/lib-git-svn.sh
--- git-1.5.4.4.orig/t/lib-git-svn.sh 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/t/lib-git-svn.sh 2008-03-22 16:02:12.797409374 -0700
@@ -6,6 +6,12 @@
test_done
exit
fi
+if test -n "$NO_PERL"
+then
+ test_expect_success 'skipping git-svn tests, NO_PERL defined' :
+ test_done
+ exit
+fi
GIT_DIR=$PWD/.git
GIT_SVN_DIR=$GIT_DIR/svn/git-svn
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/t/t5505-remote.sh git-1.5.4.4/t/t5505-remote.sh
--- git-1.5.4.4.orig/t/t5505-remote.sh 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/t/t5505-remote.sh 2008-03-22 16:22:58.012694493 -0700
@@ -3,6 +3,12 @@
test_description='git remote porcelain-ish'
. ./test-lib.sh
+if test -n "$NO_PERL"
+then
+ test_expect_success 'skipping git-cvsimport tests, NO_PERL defined' :
+ test_done
+ exit
+fi
setup_repository () {
mkdir "$1" && (
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/t/t7501-commit.sh git-1.5.4.4/t/t7501-commit.sh
--- git-1.5.4.4.orig/t/t7501-commit.sh 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/t/t7501-commit.sh 2008-03-22 16:14:25.513913653 -0700
@@ -38,7 +38,7 @@
"echo King of the bongo >file &&
git-commit -m foo -a file"
-test_expect_failure \
+[ -z "$NO_PERL" ] && test_expect_failure \
"using paths with --interactive" \
"echo bong-o-bong >file &&
echo 7 | git-commit -m foo --interactive file"
@@ -119,7 +119,7 @@
"echo 'gak' >file && \
git-commit -m 'author' --author 'Rubber Duck <rduck@convoy.org>' -a"
-test_expect_success \
+[ -z "$NO_PERL" ] && test_expect_success \
"interactive add" \
"echo 7 | git-commit --interactive | grep 'What now'"
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/t/t9001-send-email.sh git-1.5.4.4/t/t9001-send-email.sh
--- git-1.5.4.4.orig/t/t9001-send-email.sh 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/t/t9001-send-email.sh 2008-03-22 16:03:58.490510442 -0700
@@ -2,6 +2,12 @@
test_description='git-send-email'
. ./test-lib.sh
+if test -n "$NO_PERL"
+then
+ test_expect_success 'skipping git-send-email tests, NO_PERL defined' :
+ test_done
+ exit
+fi
PROG='git send-email'
test_expect_success \
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/t/t9200-git-cvsexportcommit.sh git-1.5.4.4/t/t9200-git-cvsexportcommit.sh
--- git-1.5.4.4.orig/t/t9200-git-cvsexportcommit.sh 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/t/t9200-git-cvsexportcommit.sh 2008-03-22 16:04:12.535965488 -0700
@@ -13,6 +13,12 @@
test_done
exit
fi
+if test -n "$NO_PERL"
+then
+ test_expect_success 'skipping git-cvsexportcommit tests, NO_PERL defined' :
+ test_done
+ exit
+fi
CVSROOT=$(pwd)/cvsroot
CVSWORK=$(pwd)/cvswork
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/t/t9400-git-cvsserver-server.sh git-1.5.4.4/t/t9400-git-cvsserver-server.sh
--- git-1.5.4.4.orig/t/t9400-git-cvsserver-server.sh 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/t/t9400-git-cvsserver-server.sh 2008-03-22 16:04:20.038686248 -0700
@@ -17,6 +17,12 @@
test_done
exit
fi
+if test -n "$NO_PERL"
+then
+ test_expect_success 'skipping git-cvsserver tests, NO_PERL defined' :
+ test_done
+ exit
+fi
perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
test_expect_success 'skipping git-cvsserver tests, Perl SQLite interface unavailable' :
test_done
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/t/t9500-gitweb-standalone-no-errors.sh git-1.5.4.4/t/t9500-gitweb-standalone-no-errors.sh
--- git-1.5.4.4.orig/t/t9500-gitweb-standalone-no-errors.sh 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/t/t9500-gitweb-standalone-no-errors.sh 2008-03-22 16:17:00.350148743 -0700
@@ -67,6 +67,13 @@
}
. ./test-lib.sh
+if test -n "$NO_PERL"
+then
+ test_expect_success 'skipping gitweb-standalone-no-errors tests, NO_PERL defined' :
+ test_done
+ exit
+fi
+
perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
test_expect_success 'skipping gitweb tests, perl version is too old' :
diff -Nuar --exclude gitweb.cgi --exclude config.mak.in --exclude configure.ac git-1.5.4.4.orig/t/t9600-cvsimport.sh git-1.5.4.4/t/t9600-cvsimport.sh
--- git-1.5.4.4.orig/t/t9600-cvsimport.sh 2008-03-09 03:18:13.000000000 -0700
+++ git-1.5.4.4/t/t9600-cvsimport.sh 2008-03-22 16:04:28.501086452 -0700
@@ -9,6 +9,12 @@
test_done
exit
fi
+if test -n "$NO_PERL"
+then
+ test_expect_success 'skipping git-cvsimport tests, NO_PERL defined' :
+ test_done
+ exit
+fi
cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
case "$cvsps_version" in
|