refactor and document some
This commit is contained in:
+21
-10
@@ -378,6 +378,27 @@ def search_file(term):
|
|||||||
term = term[1:]
|
term = term[1:]
|
||||||
return filesdb.search_file(term)
|
return filesdb.search_file(term)
|
||||||
|
|
||||||
|
@locked
|
||||||
|
def upgrade(packages=[], repo=None):
|
||||||
|
"""
|
||||||
|
Upgrades the given packages, if no package given upgrades all the packages
|
||||||
|
@param packages: list of package names -> list_of_strings
|
||||||
|
@param repo: name of the repository that only the packages from that repo going to be upgraded
|
||||||
|
"""
|
||||||
|
pisi.db.historydb.HistoryDB().create_history("upgrade")
|
||||||
|
return pisi.operations.upgrade.upgrade(packages, repo)
|
||||||
|
|
||||||
|
@locked
|
||||||
|
def remove(packages, ignore_dependency=False, ignore_safety=False):
|
||||||
|
"""
|
||||||
|
Removes the given packages from the system
|
||||||
|
@param packages: list of package names -> list_of_strings
|
||||||
|
@param ignore_dependency: removes packages without looking into theirs reverse deps if True
|
||||||
|
@param ignore_safety: system.base packages can also be removed if True
|
||||||
|
"""
|
||||||
|
pisi.db.historydb.HistoryDB().create_history("remove")
|
||||||
|
return pisi.operations.remove.remove(packages, ignore_dependency, ignore_safety)
|
||||||
|
|
||||||
@locked
|
@locked
|
||||||
def install(packages, reinstall=False, ignore_file_conflicts=False, ignore_package_conflicts=False):
|
def install(packages, reinstall=False, ignore_file_conflicts=False, ignore_package_conflicts=False):
|
||||||
"""
|
"""
|
||||||
@@ -771,16 +792,6 @@ def rebuild_db(files=False):
|
|||||||
# from pisi.build import build_until
|
# from pisi.build import build_until
|
||||||
# from pisi.atomicoperations import resurrect_package, build
|
# from pisi.atomicoperations import resurrect_package, build
|
||||||
|
|
||||||
@locked
|
|
||||||
def remove(*args, **kw):
|
|
||||||
pisi.db.historydb.HistoryDB().create_history("remove")
|
|
||||||
return pisi.operations.remove.remove(*args, **kw)
|
|
||||||
|
|
||||||
@locked
|
|
||||||
def upgrade(*args, **kw):
|
|
||||||
pisi.db.historydb.HistoryDB().create_history("upgrade")
|
|
||||||
return pisi.operations.upgrade.upgrade(*args, **kw)
|
|
||||||
|
|
||||||
@locked
|
@locked
|
||||||
def emerge(*args, **kw):
|
def emerge(*args, **kw):
|
||||||
pisi.db.historydb.HistoryDB().create_history("emerge")
|
pisi.db.historydb.HistoryDB().create_history("emerge")
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ import pisi.util as util
|
|||||||
import pisi.dependency as dependency
|
import pisi.dependency as dependency
|
||||||
import pisi.db
|
import pisi.db
|
||||||
|
|
||||||
def upgrade(A, repo=None):
|
|
||||||
upgrade_pkg_names(A, repo)
|
|
||||||
|
|
||||||
def find_upgrades(packages, replaces):
|
def find_upgrades(packages, replaces):
|
||||||
packagedb = pisi.db.packagedb.PackageDB()
|
packagedb = pisi.db.packagedb.PackageDB()
|
||||||
installdb = pisi.db.installdb.InstallDB()
|
installdb = pisi.db.installdb.InstallDB()
|
||||||
@@ -90,7 +87,7 @@ def find_upgrades(packages, replaces):
|
|||||||
|
|
||||||
return Ap
|
return Ap
|
||||||
|
|
||||||
def upgrade_pkg_names(A = [], repo=None):
|
def upgrade(A=[], repo=None):
|
||||||
"""Re-installs packages from the repository, trying to perform
|
"""Re-installs packages from the repository, trying to perform
|
||||||
a minimum or maximum number of upgrades according to options."""
|
a minimum or maximum number of upgrades according to options."""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user