Skip to content

Commit

Permalink
fix some more refs
Browse files Browse the repository at this point in the history
  • Loading branch information
examachine committed Feb 22, 2017
1 parent fc4bb3d commit 41ac829
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions pisi/atomicoperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def check_relations(self):
# check if package is in database
# If it is not, put it into 3rd party packagedb
if not ctx.packagedb.has_package(self.pkginfo.name):
ctx.packagedb.add_package(self.pkginfo, pisi.itembyrepodb.thirdparty)
ctx.packagedb.add_package(self.pkginfo, pisi.db.itembyrepo.thirdparty)

# check file conflicts
file_conflicts = []
Expand Down Expand Up @@ -181,7 +181,7 @@ def check_reinstall(self):
if ctx.installdb.is_installed(pkg.name): # is this a reinstallation?

#FIXME: consider REPOSITORY instead of DISTRIBUTION -- exa
#ipackage = ctx.packagedb.get_package(pkg.name, pisi.itembyrepodb.installed)
#ipackage = ctx.packagedb.get_package(pkg.name, pisi.db.itembyrepo.installed)
ipkg = ctx.installdb.get_info(pkg.name)
repomismatch = ipkg.distribution != pkg.distribution

Expand Down Expand Up @@ -356,7 +356,7 @@ def update_databases(self, txn):
ctx.filesdb.add_files(self.metadata.package.name, self.files, txn=txn)

# installed packages
ctx.packagedb.add_package(self.pkginfo, pisi.itembyrepodb.installed, txn=txn)
ctx.packagedb.add_package(self.pkginfo, pisi.db.itembyrepo.installed, txn=txn)


def install_single(pkg, upgrade = False):
Expand Down Expand Up @@ -385,7 +385,7 @@ class Remove(AtomicOperation):
def __init__(self, package_name, ignore_dep = None):
super(Remove, self).__init__(ignore_dep)
self.package_name = package_name
self.package = ctx.packagedb.get_package(self.package_name, pisi.itembyrepodb.installed)
self.package = ctx.packagedb.get_package(self.package_name, pisi.db.itembyrepo.installed)
try:
self.files = ctx.installdb.files(self.package_name)
except pisi.Error, e:
Expand Down Expand Up @@ -510,7 +510,7 @@ def virtual_install(metadata, files, txn):
ctx.filesdb.add_files(metadata.package.name, files, txn=txn)

# installed packages
ctx.packagedb.add_package(metadata.package, pisi.itembyrepodb.installed, txn=txn)
ctx.packagedb.add_package(metadata.package, pisi.db.itembyrepo.installed, txn=txn)

def resurrect_package(package_fn, write_files, txn = None):
"""Resurrect the package from xml files"""
Expand Down
14 changes: 7 additions & 7 deletions pisi/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pisi.uri import URI
import pisi.util as util
import pisi.api as api
import pisi.packagedb as packagedb
import pisi.db.package as packagedb
from colors import colorize

class Error(pisi.Error):
Expand Down Expand Up @@ -310,7 +310,7 @@ def run(self):
repo = ctx.get_option('repository')
ctx.ui.info(_('Plotting packages in repository %s') % repo)
else:
repo = pisi.itembyrepodb.repos
repo = pisi.db.itembyrepo.repos
if self.args:
a = self.args
else:
Expand All @@ -323,7 +323,7 @@ def run(self):
# if A is empty, then graph all packages
ctx.ui.info(_('Plotting a graph of relations among all installed packages'))
a = ctx.installdb.list_installed()
repo = pisi.itembyrepodb.installed
repo = pisi.db.itembyrepo.installed
g = pisi.api.package_graph(a, repo = repo,
ignore_installed = ctx.get_option('ignore_installed'))
g.write_graphviz(file(ctx.get_option('output'), 'w'))
Expand Down Expand Up @@ -714,15 +714,15 @@ def info_package(self, arg):
ctx.ui.info(_('[inst] '), noln=True)
else:
ctx.ui.info(_('Installed package:'))
self.print_pkginfo(metadata, files,pisi.itembyrepodb.installed)
self.print_pkginfo(metadata, files,pisi.db.itembyrepo.installed)

if ctx.packagedb.has_package(arg):
metadata, files = pisi.api.info_name(arg, False)
if self.options.short:
ctx.ui.info(_('[repo] '), noln=True)
else:
ctx.ui.info(_('Package found in repository:'))
self.print_pkginfo(metadata, files, pisi.itembyrepodb.repos)
self.print_pkginfo(metadata, files, pisi.db.itembyrepo.repos)

def print_pkginfo(self, metadata, files, repo = None):
import os.path
Expand Down Expand Up @@ -870,7 +870,7 @@ def run(self):
ctx.ui.info(_('Package Name |St| Version| Rel.| Build| Distro| Date'))
print '========================================================================'
for pkg in list:
package = ctx.packagedb.get_package(pkg, pisi.itembyrepodb.installed)
package = ctx.packagedb.get_package(pkg, pisi.db.itembyrepo.installed)
inst_info = ctx.installdb.get_info(pkg)
if self.options.long:
ctx.ui.info(unicode(package))
Expand Down Expand Up @@ -1208,7 +1208,7 @@ def run(self):
ctx.ui.info(_('Package Name |St| Version| Rel.| Build| Distro| Date'))
print '========================================================================'
for pkg in list:
package = ctx.packagedb.get_package(pkg, pisi.itembyrepodb.installed)
package = ctx.packagedb.get_package(pkg, pisi.db.itembyrepo.installed)
inst_info = ctx.installdb.get_info(pkg)
if self.options.long:
ctx.ui.info(package)
Expand Down
2 changes: 1 addition & 1 deletion pisi/db/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def has_package(self, name, repo=None, txn = None):
def get_package(self, name, repo=None, txn = None):
try:
return self.d.get_item(name, repo, txn=txn)
except pisi.itembyrepodb.NotfoundError, e:
except pisi.db.itembyrepo.NotfoundError, e:
raise Error(_('Package %s not found') % name)

def get_package_repo(self, name, repo=None, txn = None):
Expand Down
4 changes: 2 additions & 2 deletions pisi/db/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ def has_spec(self, name, repo=None, txn=None):
def get_spec(self, name, repo=None, txn = None):
try:
return self.d.get_item(name, repo, txn)
except pisi.itembyrepodb.NotfoundError, e:
except pisi.db.itembyrepo.NotfoundError, e:
raise NotfoundError(_("Source package %s not found") % name)

def get_spec_repo(self, name, repo=None, txn = None):
try:
return self.d.get_item_repo(name, repo, txn)
except pisi.itembyrepodb.NotfoundError, e:
except pisi.db.itembyrepo.NotfoundError, e:
raise NotfoundError(_("Source package %s not found") % name)

def pkgtosrc(self, name, txn = None):
Expand Down
8 changes: 4 additions & 4 deletions pisi/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def plan_remove(A):
# try to construct a pisi graph of packages to
# install / reinstall

G_f = pgraph.PGraph(ctx.packagedb, pisi.itembyrepodb.installed) # construct G_f
G_f = pgraph.PGraph(ctx.packagedb, pisi.db.itembyrepo.installed) # construct G_f

# find the (install closure) graph of G_f by package
# set A using packagedb
Expand All @@ -595,12 +595,12 @@ def plan_remove(A):
while len(B) > 0:
Bp = set()
for x in B:
pkg = ctx.packagedb.get_package(x, pisi.itembyrepodb.installed)
rev_deps = ctx.packagedb.get_rev_deps(x, pisi.itembyrepodb.installed)
pkg = ctx.packagedb.get_package(x, pisi.db.itembyrepo.installed)
rev_deps = ctx.packagedb.get_rev_deps(x, pisi.db.itembyrepo.installed)
for (rev_dep, depinfo) in rev_deps:
# we don't deal with uninstalled rev deps
# and unsatisfied dependencies (this is important, too)
if ctx.packagedb.has_package(rev_dep, pisi.itembyrepodb.installed) and \
if ctx.packagedb.has_package(rev_dep, pisi.db.itembyrepo.installed) and \
dependency.installed_satisfies_dep(depinfo):
if not rev_dep in G_f.vertices():
Bp.add(rev_dep)
Expand Down
4 changes: 2 additions & 2 deletions pisi/xmldoc/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ def has_component(self, name, repo = pisi.db.itembyrepo.repos, txn = None):
def get_component(self, name, repo=None, txn = None):
try:
return self.d.get_item(name, repo, txn=txn)
except pisi.itembyrepodb.NotfoundError, e:
except pisi.db.itembyrepo.NotfoundError, e:
raise Error(_('Component %s not found') % name)

def get_component_repo(self, name, repo=None, txn = None):
#name = shelve.LockedDBShelf.encodekey(name)
try:
return self.d.get_item_repo(name, repo, txn=txn)
except pisi.itembyrepodb.NotfoundError, e:
except pisi.db.itembyrepo.NotfoundError, e:
raise Error(_('Component %s not found') % name)

def get_union_comp(self, name, txn = None, repo = pisi.db.itembyrepo.repos ):
Expand Down
2 changes: 1 addition & 1 deletion pisi/xmldoc/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def installed_satisfies_dep(depinfo):
if not ctx.installdb.is_installed(pkg_name):
return False
else:
pkg = ctx.packagedb.get_package(pkg_name, pisi.itembyrepodb.installed)
pkg = ctx.packagedb.get_package(pkg_name, pisi.db.itembyrepo.installed)
(version, release) = (pkg.version, pkg.release)
return depinfo.satisfies(pkg_name, version, release)

Expand Down

0 comments on commit 41ac829

Please sign in to comment.