mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 10:52:17 +03:00
Merge branch 'master' of https://github.com/Pardus-Kurumsal/ahenk
This commit is contained in:
commit
3650608a19
1 changed files with 16 additions and 19 deletions
|
@ -123,7 +123,8 @@ class Util:
|
|||
try:
|
||||
if as_user is not None:
|
||||
command = 'su - {0} -c "{1}"'.format(as_user, command)
|
||||
process = subprocess.Popen(command, stdin=stdin, env=env, cwd=cwd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=shell)
|
||||
process = subprocess.Popen(command, stdin=stdin, env=env, cwd=cwd, stderr=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE, shell=shell)
|
||||
|
||||
if result is True:
|
||||
result_code = process.wait()
|
||||
|
@ -202,27 +203,23 @@ class Util:
|
|||
|
||||
@staticmethod
|
||||
def install_with_apt_get(package_name, package_version=None):
|
||||
try:
|
||||
|
||||
if package_version is not None:
|
||||
process = subprocess.Popen('apt-get install --yes --force-yes {0}={1}'.format(package_name, package_version), shell=True)
|
||||
process.wait()
|
||||
command = 'apt-get install --yes --force-yes {0}={1}'.format(package_name, package_version)
|
||||
else:
|
||||
process = subprocess.Popen('apt-get install --yes --force-yes {0}'.format(package_name), shell=True)
|
||||
process.wait()
|
||||
except:
|
||||
raise
|
||||
command = 'apt-get install --yes --force-yes {0}'.format(package_name)
|
||||
|
||||
return Util.execute(command)
|
||||
|
||||
@staticmethod
|
||||
def uninstall_package(package_name, package_version=None):
|
||||
try:
|
||||
|
||||
if package_version is not None:
|
||||
process = subprocess.Popen('apt-get purge --yes --force-yes {0}={1}'.format(package_name, package_version), shell=True)
|
||||
process.wait()
|
||||
command = 'apt-get purge --yes --force-yes {0}={1}'.format(package_name, package_version)
|
||||
else:
|
||||
process = subprocess.Popen('apt-get purge --yes --force-yes {0}'.format(package_name), shell=True)
|
||||
process.wait()
|
||||
except:
|
||||
raise
|
||||
command = 'apt-get purge --yes --force-yes {0}'.format(package_name)
|
||||
|
||||
return Util.execute(command)
|
||||
|
||||
@staticmethod
|
||||
def is_installed(package_name):
|
||||
|
|
Loading…
Reference in a new issue