home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / rescue / usr / lib / rpm / pythondeps.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2006-11-29  |  411b  |  23 lines

  1. #!/bin/bash
  2.  
  3. [ $# -ge 1 ] || {
  4.     cat > /dev/null
  5.     exit 0
  6. }
  7.  
  8. PYVER=`python -c "import sys; v=sys.version_info[:2]; print '%d.%d'%v"`
  9. case $1 in
  10. -P|--provides)
  11.     shift
  12.     grep "/usr/bin/python\*\$" >& /dev/null && echo "python(abi) = ${PYVER}"
  13.     exit 0
  14.     ;;
  15. -R|--requires)
  16.     shift
  17.     grep "/usr/lib[^/]*/python${PYVER}/" >& /dev/null && echo "python(abi) = ${PYVER}"
  18.     exit 0
  19.     ;;
  20. esac
  21.  
  22. exit 0
  23.