• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python synctool_lib.shell_command函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中synctool_lib.shell_command函数的典型用法代码示例。如果您正苦于以下问题:Python shell_command函数的具体用法?Python shell_command怎么用?Python shell_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了shell_command函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: update

	def update(self):
		SyncPkg.update(self)
		
		# yum has no 'update' command, but will fetch a new database
		# next time when it has no metadata
		
		synctool_lib.shell_command('yum -y clean headers')
		synctool_lib.shell_command('yum -y clean metadata')
开发者ID:samuelet,项目名称:synctool,代码行数:8,代码来源:synctool_pkg_yum.py


示例2: remove

	def remove(self, pkgs):
		SyncPkg.remove(self, pkgs)
		
		os.putenv('DEBIAN_FRONTEND', 'noninteractive')
		
		cmd = 'apt-get -y remove ' + string.join(pkgs)
		
		synctool_lib.shell_command(cmd)
开发者ID:samuelet,项目名称:synctool,代码行数:8,代码来源:synctool_pkg_aptget.py


示例3: remove

    def remove(self, pkgs):
        SyncPkg.remove(self, pkgs)

        os.putenv("DEBIAN_FRONTEND", "noninteractive")

        cmd = "apt-get -y remove " + string.join(pkgs)

        synctool_lib.shell_command(cmd)
开发者ID:gyepisam,项目名称:synctool,代码行数:8,代码来源:synctool_pkg_aptget.py


示例4: list

	def list(self, pkgs = None):
		SyncPkg.list(self, pkgs)
		
		cmd = 'rpm -qa'			# zypper has no 'list-installed' ?
		
		if pkgs:
			cmd = cmd + ' ' + string.join(pkgs)
		
		synctool_lib.DRY_RUN = False
		synctool_lib.shell_command(cmd)
		synctool_lib.DRY_RUN = self.dryrun
开发者ID:samuelet,项目名称:synctool,代码行数:11,代码来源:synctool_pkg_zypper.py


示例5: list

    def list(self, pkgs=None):
        SyncPkg.list(self, pkgs)

        cmd = "pacman -Q"

        if pkgs:
            cmd = cmd + "s " + string.join(pkgs)  # use pacman -Qs ...

        synctool_lib.DRY_RUN = False
        synctool_lib.shell_command(cmd)
        synctool_lib.DRY_RUN = self.dryrun
开发者ID:gyepisam,项目名称:synctool,代码行数:11,代码来源:synctool_pkg_pacman.py


示例6: upgrade

	def upgrade(self):
		SyncPkg.upgrade(self)
		
		if self.dryrun:
			cmd = 'zypper list-updates'
		else:
			cmd = 'zypper --non-interactive update --auto-agree-with-licenses'
		
		synctool_lib.DRY_RUN = False
		synctool_lib.shell_command(cmd)
		synctool_lib.DRY_RUN = self.dryrun
开发者ID:samuelet,项目名称:synctool,代码行数:11,代码来源:synctool_pkg_zypper.py


示例7: list

	def list(self, pkgs = None):
		SyncPkg.list(self, pkgs)
		
		cmd = 'dpkg -l'
		
		if pkgs:
			cmd = cmd + ' ' + string.join(pkgs)
		
		synctool_lib.DRY_RUN = False
		synctool_lib.shell_command(cmd)
		synctool_lib.DRY_RUN = self.dryrun
开发者ID:samuelet,项目名称:synctool,代码行数:11,代码来源:synctool_pkg_aptget.py


示例8: upgrade

    def upgrade(self):
        SyncPkg.upgrade(self)

        synctool_lib.DRY_RUN = False

        if self.dryrun:
            cmd = "pacman -Qu --noconfirm"  # query updates
        else:
            cmd = "pacman -Su --noconfirm"  # do upgrade

        synctool_lib.shell_command(cmd)
        synctool_lib.DRY_RUN = self.dryrun
开发者ID:gyepisam,项目名称:synctool,代码行数:12,代码来源:synctool_pkg_pacman.py


示例9: upgrade

    def upgrade(self):
        SyncPkg.upgrade(self)

        os.putenv("DEBIAN_FRONTEND", "noninteractive")

        if self.dryrun:
            cmd = "apt-get -s upgrade"  # --simulate
        else:
            cmd = "apt-get -y upgrade"

        synctool_lib.DRY_RUN = False
        synctool_lib.shell_command(cmd)
        synctool_lib.DRY_RUN = self.dryrun
开发者ID:gyepisam,项目名称:synctool,代码行数:13,代码来源:synctool_pkg_aptget.py


示例10: list

	def list(self, pkgs = None):
		SyncPkg.list(self, pkgs)
		
		cmd = 'pkg_info'
		
		if pkgs:
			cmd = cmd + ' ' + string.join(pkgs)
		else:
			cmd = cmd + ' -a'		# list all installed packages
		
		synctool_lib.DRY_RUN = False
		synctool_lib.shell_command(cmd)
		synctool_lib.DRY_RUN = self.dryrun
开发者ID:samuelet,项目名称:synctool,代码行数:13,代码来源:synctool_pkg_bsdpkg.py


示例11: upgrade

	def upgrade(self):
		SyncPkg.upgrade(self)
		
		os.putenv('DEBIAN_FRONTEND', 'noninteractive')
		
		if self.dryrun:
			cmd = 'apt-get -s upgrade'		# --simulate
		else:
			cmd = 'apt-get -y upgrade'
		
		synctool_lib.DRY_RUN = False
		synctool_lib.shell_command(cmd)
		synctool_lib.DRY_RUN = self.dryrun
开发者ID:samuelet,项目名称:synctool,代码行数:13,代码来源:synctool_pkg_aptget.py


示例12: upgrade

	def upgrade(self):
		SyncPkg.upgrade(self)
		
		if os.uname()[0] == 'FreeBSD':
			# FreeBSD has no pkg_add -u, but freebsd-update instead
			
			if self.dryrun:
				cmd = 'freebsd-update fetch'
			else:
				cmd = 'freebsd-update fetch install'
		
		else:
			# OpenBSD/NetBSD/other BSD, use pkg_add -u
			
			if self.dryrun:
				cmd = 'pkg_add -uvn'
			else:
				cmd = 'pkg_add -uv'
			
		synctool_lib.DRY_RUN = False
		synctool_lib.shell_command(cmd)
		synctool_lib.DRY_RUN = self.dryrun
开发者ID:samuelet,项目名称:synctool,代码行数:22,代码来源:synctool_pkg_bsdpkg.py


示例13: run_command

def run_command(cmd):
	'''run a shell command'''
	
	if cmd[0] != '/':
		# if relative path, use scriptdir
		cmd = synctool_param.SCRIPT_DIR + '/' + cmd
	
	# a command can have arguments
	arr = shlex.split(cmd)
	cmdfile = arr[0]
	
	stat = synctool_stat.SyncStat(cmdfile)
	
	if not stat.exists():
		stderr('error: command %s not found' % synctool_lib.prettypath(cmdfile))
		return
	
	if not stat.isExec():
		stderr("warning: file '%s' is not executable" % synctool_lib.prettypath(cmdfile))
		return
	
	# run the shell command
	synctool_lib.shell_command(cmd)
开发者ID:gyepisam,项目名称:synctool,代码行数:23,代码来源:synctool.py


示例14: remove

    def remove(self, pkgs):
        SyncPkg.remove(self, pkgs)

        cmd = "pacman -Rs --noconfirm " + string.join(pkgs)

        synctool_lib.shell_command(cmd)
开发者ID:gyepisam,项目名称:synctool,代码行数:6,代码来源:synctool_pkg_pacman.py


示例15: clean

	def clean(self):
		SyncPkg.clean(self)
		
		synctool_lib.shell_command('brew cleanup')
开发者ID:samuelet,项目名称:synctool,代码行数:4,代码来源:synctool_pkg_brew.py


示例16: update

	def update(self):
		SyncPkg.update(self)
		
		synctool_lib.shell_command('zypper --non-interactive refresh')
开发者ID:samuelet,项目名称:synctool,代码行数:4,代码来源:synctool_pkg_zypper.py


示例17: remove

	def remove(self, pkgs):
		SyncPkg.remove(self, pkgs)
		
		cmd = 'brew remove ' + string.join(pkgs)
		
		synctool_lib.shell_command(cmd)
开发者ID:samuelet,项目名称:synctool,代码行数:6,代码来源:synctool_pkg_brew.py


示例18: install

	def install(self, pkgs):
		SyncPkg.install(self, pkgs)

		cmd = 'brew install ' + string.join(pkgs)
		
		synctool_lib.shell_command(cmd)
开发者ID:samuelet,项目名称:synctool,代码行数:6,代码来源:synctool_pkg_brew.py


示例19: clean

    def clean(self):
        SyncPkg.clean(self)

        synctool_lib.shell_command("pacman -Scc --noconfirm")
开发者ID:gyepisam,项目名称:synctool,代码行数:4,代码来源:synctool_pkg_pacman.py


示例20: clean

	def clean(self):
		SyncPkg.clean(self)
		
		synctool_lib.DRY_RUN = False
		synctool_lib.shell_command('zypper clean')
		synctool_lib.DRY_RUN = self.dryrun
开发者ID:samuelet,项目名称:synctool,代码行数:6,代码来源:synctool_pkg_zypper.py



注:本文中的synctool_lib.shell_command函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python synctool_lib.stderr函数代码示例发布时间:2022-05-27
下一篇:
Python lib.verbose函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap