Blame SOURCES/pythondeps.sh

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