217. PackagesProposal

API for selecting or de-selecting packages for installation

217.1. Authors

  • Lukas Ocilka <locilka@suse.cz>

217.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

    217.3. Global Functions

    217.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 48. 

      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()

    217.3.2. GetAllResolvables

    Returns list of selected resolvables of a given type

    Function parameters

    • symbol type

    Return value

    • list <string> - list of resolvables

    Example 49. 

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


    See also:

    • supported_resolvables

    217.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 50. 

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


    217.3.4. GetResolvables

    Returns all resolvables selected for installation.

    Function parameters

    • string unique_ID

    • symbol type

    Return value

    • list <string> - of resolvables

    Example 51. 

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


    217.3.5. GetSupportedResolvables

    Returns list of resolvables currently supported by this module.

    Return value

    • list <symbol> - of resolvables

    Example 52. 

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


    217.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

    217.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 53. 

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


    See also:

    • supported_resolvables

    • AddResolvables()

    217.3.8. ResetAll

    Resets all resolvables to install. Use carefully.

    Return value

    • void

    217.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

    217.4. Global Variables

    217.5. Module Requirements

    none