installdb: Parse directory names correctly
parse_package_name cannot parse directory names like "zlib-32bit". Implement a function to split names. Bumped cache version to force update.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2005-2010, TUBITAK/UEKAE
|
# Copyright (C) 2005-2011, TUBITAK/UEKAE
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
# the terms of the GNU General Public License as published by the Free
|
# the terms of the GNU General Public License as published by the Free
|
||||||
@@ -69,7 +69,11 @@ class InstallDB(lazydb.LazyDB):
|
|||||||
self.rev_deps_db = self.__generate_revdeps()
|
self.rev_deps_db = self.__generate_revdeps()
|
||||||
|
|
||||||
def __generate_installed_pkgs(self):
|
def __generate_installed_pkgs(self):
|
||||||
return dict(map(lambda x:pisi.util.parse_package_name(x), os.listdir(ctx.config.packages_dir())))
|
def split_name(dirname):
|
||||||
|
name, version, release = dirname.rsplit("-", 2)
|
||||||
|
return name, version + "-" + release
|
||||||
|
|
||||||
|
return dict(map(split_name, os.listdir(ctx.config.packages_dir())))
|
||||||
|
|
||||||
def __get_marked_packages(self, _type):
|
def __get_marked_packages(self, _type):
|
||||||
info_path = os.path.join(ctx.config.info_dir(), _type)
|
info_path = os.path.join(ctx.config.info_dir(), _type)
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007-2010, TUBITAK/UEKAE
|
# Copyright (C) 2007-2011, TUBITAK/UEKAE
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify it under
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
# the terms of the GNU General Public License as published by the Free
|
# the terms of the GNU General Public License as published by the Free
|
||||||
@@ -36,7 +36,7 @@ class Singleton(object):
|
|||||||
|
|
||||||
class LazyDB(Singleton):
|
class LazyDB(Singleton):
|
||||||
|
|
||||||
cache_version = "2.3"
|
cache_version = "2.4"
|
||||||
|
|
||||||
def __init__(self, cacheable=False, cachedir=None):
|
def __init__(self, cacheable=False, cachedir=None):
|
||||||
if not self.__dict__.has_key("initialized"):
|
if not self.__dict__.has_key("initialized"):
|
||||||
|
|||||||
Reference in New Issue
Block a user