NAME

urpm::orphans - The orphan management code for urpmi

SYNOPSIS

DESCRIPTION

unrequested_list__file($urpm)

Return the path of the unrequested list file.

unrequested_list($urpm)

Returns the list of potentiel files (ake files installed as requires for others)

mark_as_requested($urpm, $state, $test)

Mark some packages as explicitly requested (usually because they were manually installed).

_installed_req_and_unreq($urpm)

Returns :

  • req: list of installed packages that were installed as requires of others

  • unreq: list of installed packages that were not installed as requres of others (ie the ones that were explicitely selected for install)

_installed_and_unrequested_lists($urpm)

Returns :

  • pkgs: list of installed packages

  • unrequested: list of packages that were installed as requires of others (the sum of the previous lists)

_installed_req_and_unreq_and_update_unrequested_list ($urpm)

Returns :

  • req: list of installed packages that were installed as requires of others

  • unreq: list of installed packages that were not installed as requres of others (ie the ones that were explicitely selected for install)

  • unrequested: list of packages that were installed as requires of others (the sum of the previous lists)

_selected_unrequested($urpm, $selected, $rejected)

Returns the new "unrequested" packages. The reason can be "required by xxx" or "recommended"

_renamed_unrequested($urpm, $selected, $rejected)

Returns the packages obsoleting packages marked "unrequested"

check_unrequested_orphans_after_auto_select($urpm)

We don't want to check orphans on every auto-select. We do it only after many packages have been added.

Returns whether we should look for orphans depending on a threshold.

unrequested_orphans_after_remove($urpm, $toremove)

This function computes whether removing $toremove packages will create unrequested orphans.

It does not return the new orphans since "whatrecommends" is not available,

If it detects there are new orphans, _all_unrequested_orphans() must be used to have the list of the orphans

_will_package_be_unneeded($urpm, $db, $toremove, $pkg)

Return true if $pkg will no more be required after removing $toremove

nb: it may wrongly return false for complex loops, but will never wrongly return true

_will_prop_still_be_needed($urpm, $db, $toremove, $fullname, $prop, $required_maybe_loop)

Return true if $prop will still be required after removing $toremove

_get_current_kernel_package()

Return the current kernel's package so that we can filter out current running kernel:

_replace_kernel_by_its_provide($urpm, $pkg)

Take a dep, replace it by the pkg providing it. Eg: Return the current kernel's package so that we can filter out current running kernel:

On mdv & mga[1-8], it's for getting the fullname of the matching pkg. Eg: kernel-desktop-5.15.45-1.mga8 -> kernel-desktop-5.15.45-1.mga8-1-1.x86_64

On mga9+: We've "kernel-desktop[== 5.15.45-1]", we want to find pkg providing that, eg the NVRA of the pkg named 'kernel-desktop' whose version matches.

_kernel_callback ($pkg, $unreq_list)

Returns list of kernels

_fast_ version w/o looking at all non kernel packages requires on kernels (like "urpmi_find_leaves '^kernel'" would)

_all_unrequested_orphans blacklists nearly all kernels b/c of packages like 'ndiswrapper' or 'basesystem' that requires 'kernel' (on mga < 9)

rationale: other packages only require 'kernel' or a sub package we do not care about (eg: kernel-devel, kernel-firmware, kernel-latest) so it's useless to look at them

_get_orphan_kernels()

Returns list of orphan kernels

_all_unrequested_orphans($urpm, $req, $unreq)

Returns the list of "unrequested" orphans.

compute_future_unrequested_orphans($urpm, $state)

Compute the list of packages that will be unrequested and could potently be removed.

get_orphans($urpm)

Returns the list of unrequested packages (aka orphans).

It is quite fast. the slow part is the creation of $installed_packages_packed (using installed_packages_packed())

Used by urpmq --auto_orphans

get_now_orphans_gui_msg($urpm)

Like get_now_orphans_msg() but more suited for GUIes, it return message about orphan packages.

Used by rpmdrake.

get_now_orphans_msg($urpm)

Similar to get_now_orphans_gui_msg() but more suited for CLI, it return message about orphan packages.

add_leading_spaces($string)

Add leading spaces to the string and return it.

COPYRIGHT

Copyright (C) 2008-2010 Mandriva SA

Copyright (C) 2011-2020 Mageia