Blame SOURCES/pythondeps.sh

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