yet another package check
PATCH 1/1 yet another package check
As before, the file added to tools/check/ must be given exec permission.
tools/Makefile +5 -1
@@ -36,7 +36,7 @@ all: check $(MAKE) ioemu .PHONY: install -install: check +install: check_install @set -e; for subdir in $(SUBDIRS-y); do \ $(MAKE) -C $$subdir $@; \ done
@@ -58,6 +58,10 @@ distclean: clean check: $(MAKE) -C check +.PHONY: check_install +check_install: check + $(MAKE) -C check install + .PHONY: check_clean check_clean: $(MAKE) -C check clean
tools/check/check_python_xml new file +16 -0
@@ -0,0 +1,16 @@ +#!/bin/bash +# CHECK-INSTALL + +function error { + echo + echo " *** Check for python-xml package FAILED" + exit 1 +} + +python -c ' +import os.path, sys +for p in sys.path: + if os.path.exists(p + "/xml/dom/minidom.py"): + sys.exit(0) +sys.exit(1) +' || error
Why do you write non-portable shell scripts?
Some time ago, I made these portable:
check_brctlcheck_iproutecheck_libvncservercheck_pythoncheck_sdlcheck_zlib_develcheck_zlib_lib
For now, the non-portable scripts are:
check_crypto_libcheck_openssl_develcheck_python_develcheck_udevcheck_x11_devel
Can you make them portable (again), please?
Quoted 55 lines · you
As before, the file added to
tools/check/must be given exec permission.Signed-off-by Jan Beulich <[email protected]>Index: 2006-12-11/tools/Makefile
===================================================================tools/Makefile +5
-1@@ -36,7 +36,7 @@ all: check $(MAKE) ioemu .PHONY: install -install: check +install: check_install @set -e; for subdir in $(SUBDIRS-y); do \ $(MAKE) -C $$subdir $@; \ done@@ -58,6 +58,10 @@ distclean: clean check: $(MAKE) -C check +.PHONY: check_install +check_install: check + $(MAKE) -C check install + .PHONY: check_clean check_clean: $(MAKE) -C check cleanIndex: 2006-12-11/tools/check/check_python_xml
===================================================================tools/check/check_python_xml new file +17
-0+0100 @@ -0,0 +1,16 @@ +#!/bin/bash +# CHECK-INSTALL + +function error { + echo + echo " *** Check for python-xml package FAILED" + exit 1 +} + +python -c ' +import os.path, sys +for p in sys.path: + if os.path.exists(p + "/xml/dom/minidom.py"): + sys.exit(0) +sys.exit(1) +' || error_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 8 lines · Christoph Egger
Why do you write non-portable shell scripts?
Some time ago, I made these portable:
check_brctlcheck_iproutecheck_libvncservercheck_python
I don't know if this one has been rewritten since stable version, but here is a patch I recently submited to the user list, to rely on python instead of ugly grep:
diff -Naur xen-3.0.3_0-src/tools/check/check_python xen-3.0.3_0-src.better-python-check/tools/check/check_python
--- xen-3.0.3_0-src/tools/check/check_python 2006-10-15
14:22:03.000000000 +0200
+++ xen-3.0.3_0-src.better-python-check/tools/check/check_python
2006-12-11 16:26:01.000000000 +0100
@@ -7,4 +7,4 @@
exit 1
}
-python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || error +python -c 'import sys; sys.exit(sys.version_info[0] < 2 or sys.version_info[1] < 2);' || error
Quoted 26 lines · Guillaume Rousse
Quoted 8 lines · Christoph Egger
Why do you write non-portable shell scripts?
Some time ago, I made these portable:
check_brctlcheck_iproutecheck_libvncservercheck_pythonI don't know if this one has been rewritten since stable version, but here is a patch I recently submited to the user list, to rely on python instead of ugly grep:
diff -Naur xen-3.0.3_0-src/tools/check/check_python xen-3.0.3_0-src.better-python-check/tools/check/check_python
--- xen-3.0.3_0-src/tools/check/check_python 2006-10-15
14:22:03.000000000 +0200
+++ xen-3.0.3_0-src.better-python-check/tools/check/check_python2006-12-11 16:26:01.000000000 +0100(quoted diff) +1
-1@@ -7,4 +7,4 @@ exit 1 } -python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || error +python -c 'import sys; sys.exit(sys.version_info[0] < 2 or
Quoted 1 line
sys.version_info[1] < 2);' || error
This is the adaption for -unstable:
tools/check/check_python Thu Dec 14 15:31:18 2006 +0100 renamed from tools/check/check_python Wed Dec 13 16:13:26 2006 +0000 +1 -1
@@ -3,7 +3,7 @@ RC=0 -python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || RC=1 +python -c 'import sys; sys.exit(sys.version_info[0] < 2 or
sys.version_info[1] < 2);' || RC=1
if test ${RC} -ne 0; then
echo
Quoted 13 lines
This is the adaption for -unstable:
diff -r
360eb996fa38tools/check/check_pythontools/check/check_python Thu Dec 14 15:31:18 2006 +0100 renamed from tools/check/check_python Wed Dec 13 16:13:26 2006 +0000 +0
-0@@ -3,7 +3,7 @@RC=0
tools/check/check_python Thu Dec 14 15:31:18 2006 +0100 renamed from tools/check/check_python Wed Dec 13 16:13:26 2006 +0000 +1
-1-python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || RC=1 +python -c 'import sys; sys.exit(sys.version_info[0] < 2 orsys.version_info[1] < 2);' || RC=1
Quoted 2 lines
if test ${RC} -ne 0; then
echo
What's wrong with using functions in shell scripts?
Jan
Quoted 8 lines · Jan Beulich
Quoted 8 lines
This is the adaption for -unstable:
diff -r
360eb996fa38tools/check/check_python
+++ b/tools/check/check_python Thu Dec 14 15:31:18 2006 +0100(quoted diff) +0
-0@@ -3,7 +3,7 @@RC=0
Quoted 8 lines
Quoted 6 lines
tools/check/check_python Thu Dec 14 15:31:18 2006 +0100 renamed from tools/check/check_python Wed Dec 13 16:13:26 2006 +0000 +1
-1-python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || RC=1 +python -c 'import sys; sys.exit(sys.version_info[0] < 2 orsys.version_info[1] < 2);' || RC=1
if test ${RC} -ne 0; then
echoWhat's wrong with using functions in shell scripts?
error () {
}
is a lot more portable than
function error {
}
FWIW.