mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-22 09:42:15 +03:00
bug fix for install/uninstall util methods & remove redundant symbolic link
This commit is contained in:
parent
cda00f2810
commit
890b3ffa41
2 changed files with 19 additions and 11 deletions
|
@ -201,10 +201,26 @@ class Util:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def install_with_apt_get(package_name):
|
def install_with_apt_get(package_name, package_version=None):
|
||||||
try:
|
try:
|
||||||
process = subprocess.Popen('apt-get install --yes --force-yes ' + package_name, shell=True)
|
if package_version is not None:
|
||||||
process.wait()
|
process = subprocess.Popen('apt-get install --yes --force-yes {0}={1}'.format(package_name, package_version), shell=True)
|
||||||
|
process.wait()
|
||||||
|
else:
|
||||||
|
process = subprocess.Popen('apt-get install --yes --force-yes {0}'.format(package_name), shell=True)
|
||||||
|
process.wait()
|
||||||
|
except:
|
||||||
|
raise
|
||||||
|
|
||||||
|
@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()
|
||||||
|
else:
|
||||||
|
process = subprocess.Popen('apt-get purge --yes --force-yes {0}'.format(package_name), shell=True)
|
||||||
|
process.wait()
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@ -255,10 +271,3 @@ class Util:
|
||||||
if attr_name in j:
|
if attr_name in j:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def install_package(package_name, package_version):
|
|
||||||
command = "sudo apt-get --yes --force-yes install {0}={1}".format(package_name, package_version)
|
|
||||||
result_code, p_out, p_err = Util.execute(command)
|
|
||||||
return result_code, p_out, p_err
|
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
/home/cemre/git/lider-ahenk-package-manager-plugin/ahenk-package-manager/package-manager
|
|
Loading…
Reference in a new issue