198. PackagesProposal

API for selecting or de-selecting packages for installation

198.1. Authors

  • Lukas Ocilka <locilka@suse.cz>

198.2. Summary of Module Globals

List of Global Functions

  • AddResolvables - Adds list of resolvables to pool that is then used by software proposal to propose a selection of resolvables to install.

  • GetAllResolvables - Returns list of selected resolvables of a given type

  • GetAllResolvablesForAllTypes - Returns all selected resolvables for all supported types

  • GetResolvables - Returns all resolvables selected for installation.

  • GetSupportedResolvables - Returns list of resolvables currently supported by this module.

  • IsUniqueID - Return whether a unique ID is already in use.

  • RemoveResolvables - Removes list of packages from pool that is then used by software proposal to propose a selection of resolvables to install.

  • ResetAll - Resets all resolvables to install. Use carefully.

  • SetResolvables - Replaces the current resolvables with new ones. Similar to AddResolvables() but it replaces the list of resolvables instead of adding them to the pool. It always replaces only the part that is identified by the unique_ID.

List of Global Variables

    198.3. Global Functions

    198.3.1. AddResolvables

    Adds list of resolvables to pool that is then used by software proposal to propose a selection of resolvables to install.

    Function parameters

    • string unique_ID

    • symbol type

    • list <string> resolvables

    Return value

    • boolean - whether successful

    Example 46. 

      AddResolvables ("y2_kdump", `package, ["yast2-kdump", "kdump"]) -> true
      // `not_supported is definitely not a supported resolvable
      AddResolvables ("test", `not_supported, ["bash"]) -> false
    


    See also:

    • supported_resolvables

    • RemoveResolvables()

    198.3.2. GetAllResolvables

    Returns list of selected resolvables of a given type

    Function parameters

    • symbol type

    Return value

    • list <string> - list of resolvables

    Example 47. 

       GetAllResolvables (`package) -> ["list", "of", "packages"]
       GetAllResolvables (`pattern) -> ["list", "of", "patterns"]
       // not a supported resolvable type
       GetAllResolvables (`unknown) -> nil
    


    See also:

    • supported_resolvables

    198.3.3. GetAllResolvablesForAllTypes

    Returns all selected resolvables for all supported types

    Return value

    • map <symbol, list <string> > - map of resolvables

    $[
       `resolvable_type : [ "list", "of", "resolvables" ],
       `another_type    : [ "list", "of", "resolvables" ],
     ]
    

    Example 48. 

     // No resolvables selected
     GetAllResolvablesForAllTypes() -> $[]
     // Only patterns selected
     GetAllResolvablesForAllTypes() -> $[`pattern : ["some", "patterns"]]
     // Also packages selected
     GetAllResolvablesForAllTypes() -> $[
       `pattern : ["some", "patterns"],
       `package : ["some", "packages"],
     ]


    198.3.4. GetResolvables

    Returns all resolvables selected for installation.

    Function parameters

    • string unique_ID

    • symbol type

    Return value

    • list <string> - of resolvables

    Example 49. 

       GetResolvables ("y2_kdump", `package) -> ["yast2-kdump", "kdump"]


    198.3.5. GetSupportedResolvables

    Returns list of resolvables currently supported by this module.

    Return value

    • list <symbol> - of resolvables

    Example 50. 

     GetSupportedResolvables() -> [`package, `pattern, ... ]
    


    198.3.6. IsUniqueID

    Return whether a unique ID is already in use.

    Function parameters

    • string unique_ID

    Return value

    • boolean - whether the ID is not in use yet

    198.3.7. RemoveResolvables

    Removes list of packages from pool that is then used by software proposal to propose a selection of resolvables to install.

    Function parameters

    • string unique_ID

    • symbol type

    • list <string> resolvables

    Return value

    • boolean - whether successful

    Example 51. 

      RemoveResolvables ("y2_kdump", `package, ["kdump"]) -> true
    


    See also:

    • supported_resolvables

    • AddResolvables()

    198.3.8. ResetAll

    Resets all resolvables to install. Use carefully.

    Return value

    • void

    198.3.9. SetResolvables

    Replaces the current resolvables with new ones. Similar to AddResolvables() but it replaces the list of resolvables instead of adding them to the pool. It always replaces only the part that is identified by the unique_ID.

    Function parameters

    • string unique_ID

    • symbol type

    • list <string> resolvables

    Return value

    • boolean - whether successful

    198.4. Global Variables

    198.5. Module Requirements

    none