Blame SOURCES/pythondeps.sh

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