本文整理汇总了Python中synctool_pkgclass.SyncPkg类的典型用法代码示例。如果您正苦于以下问题:Python SyncPkg类的具体用法?Python SyncPkg怎么用?Python SyncPkg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SyncPkg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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')
示例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)
示例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)
示例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
示例5: 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
示例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
示例7: 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
示例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
示例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
示例10: 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
示例11: 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
示例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
示例13: install
def install(self, pkgs):
SyncPkg.install(self, pkgs)
cmd = 'zypper --non-interactive install --auto-agree-with-licenses ' + string.join(pkgs)
synctool_lib.shell_command(cmd)
示例14: __init__
def __init__(self):
SyncPkg.__init__(self)
示例15: clean
def clean(self):
SyncPkg.clean(self)
synctool_lib.shell_command('brew cleanup')