免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1879 | 回复: 0
打印 上一主题 下一主题

YUM认识 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-01-18 19:32 |只看该作者 |倒序浏览
这个叫yellowdog Update,Modified.是LINUX@DUKE上的一个项目。
其项目的大体介绍我只复制过来,不作任何的翻译。
um is an automatic updater and package installer/remover for rpm
        systems. It automatically computes dependencies and figures out what
        things should occur to install packages. It makes it easier to
        maintain groups of machines without having to manually update each
        one using rpm.
      
      
        Features include:(特征)
       
  • Multiple Repositories
  • Simple config file
  • Correct dependency calculation
  • Fast operation
  • rpm-consistent behavior
  • comps.xml group support, including multiple repository
                            groups
  • Simple interface

      
     至于我为什么要介绍这样一个软件,而且分类到python世界,并不是放到free&open source software里,那就是它是用python语言编写的一个强大的linux系统工具!
#!/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:
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.main(sys.argv[1:])
except KeyboardInterrupt, e:
    print >> sys.stderr, "\n\nExiting on user cancel."
    sys.exit(1)
这是yum的运行脚本!还有什么是我要介绍的吗?
那就看一下其模块吧:
[root@lee grub]# python
Python 2.4.2 (#1, Feb 12 2006, 03:59:46)
[GCC 4.1.0 20060210 (Red Hat 4.1.0-0.24)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
>>> dir(yum)
['BOOLEAN_STATES', 'Errors', 'LETTERFLAGS', 'ListPackageSack', 'PLUG_OPT_BOOL', 'PLUG_OPT_FLOAT', 'PLUG_OPT_INT', 'PLUG_OPT_STRING', 'PLUG_OPT_WHERE_ALL', 'PLUG_OPT_WHERE_MAIN', 'PLUG_OPT_WHERE_REPO', 'PO_CONFIG', 'PO_DIR', 'PO_DOC', 'PO_FILE', 'PO_GHOST', 'PO_INSTALLEDPKG', 'PO_LOCALPKG', 'PO_REMOTEPKG', 'SYMBOLFLAGS', 'TR_DEPENDS', 'TR_DEPENDSON', 'TR_OBSOLETEDBY', 'TR_OBSOLETES', 'TR_UPDATEDBY', 'TR_UPDATES', 'TS_AVAILABLE', 'TS_ERASE', 'TS_INSTALL', 'TS_INSTALL_STATES', 'TS_OBSOLETED', 'TS_OBSOLETING', 'TS_REMOVE_STATES', 'TS_TRUEINSTALL', 'TS_UPDATE', 'TX_BLACK', 'TX_GREY', 'TX_WHITE', 'URLGrabError', 'YumAvailablePackage', 'YumBase', 'YumInstalledPackage', 'YumLocalPackage', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '__version__', 'comps', 'config', 'constants', 'depsolve', 'errno', 'fnmatch', 'glob', 'mdErrors', 'mdcache', 'misc', 'os', 'packages', 'parsePackages', 'parser', 'pgpmsg', 'plugins', 're', 'repos', 'rpm', 'rpmUtils', 'sre_constants', 'sys', 'time', 'transactioninfo', 'types']
在/usr/lib/python2.4下有更多的。。。。。源数据、递归、对系统硬件信息的调用。。。。。。。值得我们好好研究下。
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/6303/showart_234250.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP