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