mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-22 02:50:32 +03:00
util.rpm: functions to install and remove packages added
This commit is contained in:
parent
5fed5140f4
commit
85ffc2a301
@ -17,6 +17,7 @@
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import rpm
|
||||
import subprocess
|
||||
|
||||
def is_rpm_installed(rpm_name):
|
||||
'''
|
||||
@ -30,3 +31,22 @@ def is_rpm_installed(rpm_name):
|
||||
|
||||
return False
|
||||
|
||||
def update():
|
||||
'''
|
||||
Update APT-RPM database.
|
||||
'''
|
||||
subprocess.check_call(['/usr/bin/apt-get', 'update'])
|
||||
|
||||
def install_rpm(rpm_name):
|
||||
'''
|
||||
Install RPM from APT-RPM sources.
|
||||
'''
|
||||
update()
|
||||
subprocess.check_call(['/usr/bin/apt-get', '-y', 'install', rpm_name])
|
||||
|
||||
def remove_rpm(rpm_name):
|
||||
'''
|
||||
Remove RPM from file system.
|
||||
'''
|
||||
subprocess.check_call(['/usr/bin/apt-get', '-y', 'remove', rpm_name])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user