/usr/bin/yum

Jmnote (토론 | 기여)님의 2013년 4월 14일 (일) 13:29 판 (새 문서: ;yum의 실체 ;/usr/bin/yum ==소스 코드== 우리가 즐겨쓰는 yum은 실은 파이썬 스크립트이다... <source lang='python'> #!/usr/bin/python import sys try: impor...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
yum의 실체
/usr/bin/yum

소스 코드

우리가 즐겨쓰는 yum은 실은 파이썬 스크립트이다...

Python
Copy
#!/usr/bin/python
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr, """\
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   %s

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
%s

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq
  
""" % (sys.exc_value, sys.version)
    sys.exit(1)

sys.path.insert(0, '/usr/share/yum-cli')
try:
    import yummain
    yummain.user_main(sys.argv[1:], exit_code=True)
except KeyboardInterrupt, e:
    print >> sys.stderr, "\n\nExiting on user cancel."
    sys.exit(1)