* signify single ops
This commit is contained in:
+1
-1
@@ -133,7 +133,7 @@ class Installer:
|
|||||||
raise InstallError('Package downgrade declined')
|
raise InstallError('Package downgrade declined')
|
||||||
|
|
||||||
# remove old package then
|
# remove old package then
|
||||||
operations.remove(pkg.name)
|
operations.remove_single(pkg.name)
|
||||||
|
|
||||||
def update_databases(self):
|
def update_databases(self):
|
||||||
"update databases"
|
"update databases"
|
||||||
|
|||||||
+6
-4
@@ -10,9 +10,10 @@ import util
|
|||||||
|
|
||||||
# single package operations
|
# single package operations
|
||||||
|
|
||||||
def remove(package_name):
|
def remove_single(package_name):
|
||||||
"""Remove a single package"""
|
"""Remove a single package"""
|
||||||
from installdb import installdb
|
from installdb import installdb
|
||||||
|
from packagedb import inst_packagedb
|
||||||
from comariface import removeScripts
|
from comariface import removeScripts
|
||||||
|
|
||||||
#TODO: check dependencies
|
#TODO: check dependencies
|
||||||
@@ -32,16 +33,17 @@ def remove(package_name):
|
|||||||
else:
|
else:
|
||||||
os.unlink(fpath)
|
os.unlink(fpath)
|
||||||
installdb.remove(package_name)
|
installdb.remove(package_name)
|
||||||
|
inst_packagedb.remove_package(package_name)
|
||||||
removeScripts(package_name)
|
removeScripts(package_name)
|
||||||
|
|
||||||
# TODO: repository'den okuma isi yas burada, bu degisecek
|
# TODO: repository'den okuma isi yas burada, bu degisecek
|
||||||
def install(pkg):
|
def install_single(pkg):
|
||||||
url = PUrl(pkg)
|
url = PUrl(pkg)
|
||||||
# Check if we are dealing with a remote file or a real path of
|
# Check if we are dealing with a remote file or a real path of
|
||||||
# package filename. Otherwise we'll try installing a package from
|
# package filename. Otherwise we'll try installing a package from
|
||||||
# the package repository.
|
# the package repository.
|
||||||
if url.isRemoteFile() or os.path.exists(url.uri):
|
if url.isRemoteFile() or os.path.exists(url.uri):
|
||||||
install_package(pkg)
|
install_single_package(pkg)
|
||||||
else:
|
else:
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
@@ -64,7 +66,7 @@ def install(pkg):
|
|||||||
return
|
return
|
||||||
ui.error("Package %s not found in the index file.\n" %pkg)
|
ui.error("Package %s not found in the index file.\n" %pkg)
|
||||||
|
|
||||||
def install_package(pkg_location):
|
def install_single_package(pkg_location):
|
||||||
from install import Installer
|
from install import Installer
|
||||||
Installer(pkg_location).install()
|
Installer(pkg_location).install()
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -15,12 +15,12 @@ def install(packages):
|
|||||||
"""install a list of packages (either files, urls, or names)"""
|
"""install a list of packages (either files, urls, or names)"""
|
||||||
#TODO: this for loop is just a placeholder
|
#TODO: this for loop is just a placeholder
|
||||||
for x in packages:
|
for x in packages:
|
||||||
operations.install(x)
|
operations.install_single(x)
|
||||||
|
|
||||||
def remove(packages):
|
def remove(packages):
|
||||||
#TODO: this for loop is just a placeholder
|
#TODO: this for loop is just a placeholder
|
||||||
for x in packages:
|
for x in packages:
|
||||||
operations.remove(x)
|
operations.remove_single(x)
|
||||||
|
|
||||||
|
|
||||||
def info(package_name):
|
def info(package_name):
|
||||||
|
|||||||
Reference in New Issue
Block a user