當前位置: 首頁>>代碼示例>>Python>>正文


Python SyncPkg.upgrade方法代碼示例

本文整理匯總了Python中synctool_pkgclass.SyncPkg.upgrade方法的典型用法代碼示例。如果您正苦於以下問題:Python SyncPkg.upgrade方法的具體用法?Python SyncPkg.upgrade怎麽用?Python SyncPkg.upgrade使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在synctool_pkgclass.SyncPkg的用法示例。


在下文中一共展示了SyncPkg.upgrade方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: upgrade

# 需要導入模塊: from synctool_pkgclass import SyncPkg [as 別名]
# 或者: from synctool_pkgclass.SyncPkg import upgrade [as 別名]
	def upgrade(self):
		SyncPkg.upgrade(self)
		
		if self.dryrun:
			cmd = 'brew outdated'
		else:
			cmd = 'brew upgrade'
		
		synctool_lib.DRY_RUN = False
		synctool_lib.shell_command(cmd)
		synctool_lib.DRY_RUN = self.dryrun
開發者ID:samuelet,項目名稱:synctool,代碼行數:13,代碼來源:synctool_pkg_brew.py

示例2: upgrade

# 需要導入模塊: from synctool_pkgclass import SyncPkg [as 別名]
# 或者: from synctool_pkgclass.SyncPkg import upgrade [as 別名]
    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,代碼行數:14,代碼來源:synctool_pkg_pacman.py

示例3: upgrade

# 需要導入模塊: from synctool_pkgclass import SyncPkg [as 別名]
# 或者: from synctool_pkgclass.SyncPkg import upgrade [as 別名]
	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,代碼行數:15,代碼來源:synctool_pkg_aptget.py

示例4: upgrade

# 需要導入模塊: from synctool_pkgclass import SyncPkg [as 別名]
# 或者: from synctool_pkgclass.SyncPkg import upgrade [as 別名]
    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,代碼行數:15,代碼來源:synctool_pkg_aptget.py

示例5: upgrade

# 需要導入模塊: from synctool_pkgclass import SyncPkg [as 別名]
# 或者: from synctool_pkgclass.SyncPkg import upgrade [as 別名]
	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,代碼行數:24,代碼來源:synctool_pkg_bsdpkg.py


注:本文中的synctool_pkgclass.SyncPkg.upgrade方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。