2004-12-07 08:58:50 +08:00
|
|
|
#!/bin/bash
|
2004-12-06 04:05:46 +08:00
|
|
|
|
|
|
|
[ $# -ge 1 ] || {
|
|
|
|
cat > /dev/null
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
-P|--provides)
|
|
|
|
shift
|
2010-01-30 18:12:02 +08:00
|
|
|
# Match buildroot/payload paths of the form
|
|
|
|
# /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR
|
|
|
|
# generating a line of the form
|
|
|
|
# python(abi) = MAJOR.MINOR
|
|
|
|
# (Don't match against -config tools e.g. /usr/bin/python2.6-config)
|
|
|
|
grep "/usr/bin/python.\..$" \
|
|
|
|
| sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|"
|
2004-12-06 04:05:46 +08:00
|
|
|
;;
|
|
|
|
-R|--requires)
|
|
|
|
shift
|
2010-01-30 18:12:02 +08:00
|
|
|
# Match buildroot paths of the form
|
|
|
|
# /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and
|
|
|
|
# /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/
|
|
|
|
# generating (uniqely) lines of the form:
|
|
|
|
# python(abi) = MAJOR.MINOR
|
2010-02-09 15:37:51 +08:00
|
|
|
grep "/usr/lib[^/]*/python.\../.*" \
|
2010-01-30 18:12:02 +08:00
|
|
|
| sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \
|
|
|
|
| sort | uniq
|
2004-12-06 04:05:46 +08:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|