Blame SOURCES/pythondeps.sh

ae2451
#!/bin/bash
ae2451
ae2451
[ $# -ge 1 ] || {
ae2451
    cat > /dev/null
ae2451
    exit 0
ae2451
}
ae2451
ae2451
case $1 in
ae2451
-P|--provides)
ae2451
    shift
ae2451
    # Match buildroot/payload paths of the form
ae2451
    #    /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR
ae2451
    # generating a line of the form
ae2451
    #    python(abi) = MAJOR.MINOR
ae2451
    # (Don't match against -config tools e.g. /usr/bin/python2.6-config)
ae2451
    grep "/usr/bin/python.\..$" \
ae2451
        | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|"
ae2451
    ;;
ae2451
-R|--requires)
ae2451
    shift
ae2451
    # Match buildroot paths of the form
ae2451
    #    /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/  and
ae2451
    #    /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/
ae2451
    # generating (uniqely) lines of the form:
ae2451
    #    python(abi) = MAJOR.MINOR
ae2451
    grep "/usr/lib[^/]*/python.\../.*" \
ae2451
        | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \
ae2451
        | sort | uniq
ae2451
    ;;
ae2451
esac
ae2451
ae2451
exit 0