git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t/lib-cvs: cvsimport no longer works without Python >= 2.7

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2013, 08:40 UTC
Message-ID
<7vip72iykx.fsf_-_@alter.siamese.dyndns.org>
In-Reply-To
<7v62339du4.fsf@alter.siamese.dyndns.org>

The new cvsimport requires at least Python 2.7 to work; do not fail the cvsimport tests on platforms without one.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Junio C Hamano <gitster@pobox.com> writes:
 > http://docs.python.org/2/library/subprocess.html tells me that
 > check_output has first become available in 2.7.
 >
 > So... does this mean that we now set the minimum required version of
 > Python to 2.7?  I dunno.
 Even if we were to rip out the fallback code that uses the 2.7-only
 subprocess.check_output() on "cvsps -V", the function is also used
 for doing the real work interacting with cvsps-3.x, so I think this
 patch will be necessary.  Unless new cvsimport is tweaked not to
 use the method, that is.
 A suggestion for a better alternative is of course very much
 appreciated.
 I do not want to keep pushing integration results that do not pass
 tests even for myself for too many integration cycles, so I'll keep
 this patch at the tip of the topic, at least for now.
 t/lib-cvs.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index b55e861..4e890ea 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -27,6 +27,21 @@ case "$cvsps_version" in
 	;;
 esac
 
+if ! test_have_prereq PYTHON
+then
+	skipall='skipping cvsimport tests, no python'
+	test_done
+fi
+
+python -c '
+import sys
+if sys.hexversion < 0x02070000:
+	sys.exit(1)
+' || {
+	skip_all='skipping cvsimport tests, python too old (< 2.7)'
+	test_done
+}
+
 setup_cvs_test_repository () {
 	CVSROOT="$(pwd)/.cvsroot" &&
 	cp -r "$TEST_DIRECTORY/$1/cvsroot" "$CVSROOT" &&
-- 
1.8.1.421.g6236851
Previous: Chris RorvickNext: Michael Haggerty
Message 10 of 37 in “cvsimport: rewrite to use cvsps 3.x to fix major bugs”
  1. cvsimport: rewrite to use cvsps 3.x to fix major bugsJunio C Hamano, Jan 11, 2013
  2. Junio C HamanoJan 11, 2013
  3. Eric S. RaymondJan 11, 2013
  4. Junio C HamanoJan 11, 2013
  5. Junio C HamanoJan 11, 2013
  6. Eric S. RaymondJan 12, 2013
  7. Junio C HamanoJan 12, 2013
  8. t/t960[123]: remove leftover scriptsJunio C Hamano, Jan 12, 2013
  9. Chris RorvickJan 12, 2013
  10. t/lib-cvs: cvsimport no longer works without Python >= 2.7Junio C Hamano, Jan 12, 2013
  11. Michael HaggertyJan 12, 2013
  12. John KeepingJan 13, 2013
  13. Eric S. RaymondJan 12, 2013
  14. Michael HaggertyJan 12, 2013
  15. Eric S. RaymondJan 12, 2013
  16. Jonathan NiederJan 12, 2013
  17. Jonathan NiederJan 12, 2013
  18. Junio C HamanoJan 13, 2013
  19. Junio C HamanoJan 13, 2013
  20. 0/3 A smoother transition plan for cvsimportJunio C Hamano, Jan 14, 2013
  21. 1/3 cvsimport: allow setting a custom cvsps (2.x) program nameJunio C Hamano, Jan 14, 2013
  22. 2/3 cvsimport: introduce a version-switch wrapperJunio C Hamano, Jan 14, 2013
  23. Junio C HamanoJan 14, 2013
  24. 3/3 cvsimport: start adding cvsps 3.x supportJunio C Hamano, Jan 14, 2013
  25. Chris RorvickJan 15, 2013
  26. Junio C HamanoJan 15, 2013
  27. Michael HaggertyJan 14, 2013
  28. 0/6 A smoother transition plan for cvsimportJunio C Hamano, Jan 14, 2013
  29. 1/6 Makefile: add description on PERL/PYTHON_PATHJunio C Hamano, Jan 14, 2013
  30. 2/6 cvsimport: allow setting a custom cvsps (2.x) program nameJunio C Hamano, Jan 14, 2013
  31. 3/6 cvsimport: introduce a version-switch wrapperJunio C Hamano, Jan 14, 2013
  32. 4/6 cvsimport: start adding cvsps 3.x supportJunio C Hamano, Jan 14, 2013
  33. 5/6 cvsimport: make tests reusable for cvsimport-3Junio C Hamano, Jan 14, 2013
  34. 6/6 cvsimport-3: add a sample testJunio C Hamano, Jan 14, 2013
  35. Jonathan NiederJan 14, 2013
  36. 7/6 t9600: further prepare for sharingJunio C Hamano, Jan 14, 2013
  37. 8/6 t9600: adjust for new cvsimportJunio C Hamano, Jan 14, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.