- correct a few typos, and unicode blurbs
  - don't require that the file exists as a path, we got destdir
This commit is contained in:
Eray Özkural
2005-10-10 11:19:11 +00:00
parent 9cf1b567d8
commit 4a512195f3
3 changed files with 14 additions and 10 deletions
+7 -7
View File
@@ -807,19 +807,19 @@ Finds the installed package which contains the specified file.
self.parser.add_option("-l", "--long", action="store_true",
default=False, help="show in long format")
@staticmethod
def search_exact(path):
path = path.lstrip('/') #FIXME: this shouldn't be necessary :/
if ctx.filesdb.has_file(path):
(pkg_name, file_info) = ctx.filesdb.get_info(path)
(pkg_name, file_info) = ctx.filesdb.get_file(path)
ctx.ui.info(_('Package: %s') % pkg_name)
if ctx.options.long:
if ctx.config.options.long:
ctx.ui.info(_('Type: %s, Hash: %s') % (file_info.type,
file_info.hash) )
else:
ctx.ui.error(_('Path %s does not belong to an installed package') % path)
search_exact = staticmethod(search_exact)
def run(self):
import os.path
self.init(True)
@@ -830,10 +830,10 @@ Finds the installed package which contains the specified file.
# search among existing files
for path in self.args:
ctx.ui.info(_('Searching for %s') % path)
import os.path
if os.path.exists(path):
self.search_exact(os.path.realpath(path))
else:
pisi.api.error(_('%s cannot be found'))
path = os.path.realpath(path)
self.search_exact(path)
self.finalize()
+4 -3
View File
@@ -105,12 +105,13 @@ class FilesDB(shelve.LockedDBShelf):
def add_files(self, pkg_name, files):
for x in files.list:
self[x.path] = (pkg_name, x)
self[str(x.path)] = (pkg_name, x)
def has_file(self, path):
return self.has_key(path)
return self.has_key(str(path))
def get_file_info(self, path):
def get_file(self, path):
path = str(path)
if not self.has_key(path):
return None
else:
+3
View File
@@ -205,5 +205,8 @@ class Installer:
self.metadata.package.build,
self.metadata.package.distribution)
# filesdb
ctx.filesdb.add_files(self.metadata.package.name, self.files)
# installed packages
packagedb.inst_packagedb.add_package(self.pkginfo)