YaST2 Developers Documentation: WebpinPackageSearch

WebpinPackageSearch

WebpinPackageSearch.ycp
YaST API to api.opensuse-community.org
  • Lukas Ocilka
  • Katarina Machalkova

This module has an unstable interface.

Imports

  • Arch
  • Directory
  • FileUtils
  • HTTP
  • SuSERelease
  • URL
  • XML

Global Functions

Local Variables

Local Functions

local base_url -> string

Base search URL, default is "http://api.opensuse-community.org/searchservice/"

global SetBaseSearchURL (string new_base_url) -> void

Sets base search URL WARNING: Use this only if you know what you are doing!

Parameters:
new_base_url
global GetBaseSearchURL () -> string

Returns base search URL

local deps -> list <list <string> >

List of architecture dependencies. Every row contains one list of dependencies sortred from left (the newest) to right (the oldest). Architectures are backward-compatible.

global MatchesCurrentArchitecture (list <string> archs_to_check) -> boolean

Returns whether the current architecture matches the list of architectures got as a parameter. The current architecture is backward compatible, so also dependencies are taken into account.

Parameters:
archs_to_check
Return value:
whether they match the current architecture
Example

	// current architecture is "i386"
	MatchesCurrentArchitecture (["noarch", "ppc", "i386"]) -> true
	MatchesCurrentArchitecture (["noarch"]) -> true
	MatchesCurrentArchitecture (["x86_64"]) -> false
	MatchesCurrentArchitecture (["ppc"]) -> false
local GuessCurrentDistribution () -> string

Guesses the current distribution installed

Return value:
distribution (Webpin format) // Installed openSUSE 11.0 GuessCurrentDistribution() -> "openSUSE_110"
local ModifyDistro (string distro) -> string

Changes the Webpin distro format to OneClickInstall format.

Parameters:
distro
Return value:
modified distro
Example

   ModifyDistro ("openSUSE_110") -> "openSUSE 11.0"
global PrepareOneClickInstallDescription (list <map> packages_to_install, string save_to_file) -> boolean

Writes XML configuration file for OnleClickInstall client.

Parameters:
packages_to_install
save_to_file
Return value:
if successful
See
SearchForPackages() for the format of package_to_install
global SearchForPackages (string search_for, string distribution, map <string, boolean> search_in) -> list <map>

Searches for packages using Webpin XML API.

Parameters:
search_for
distribution
search_in
Example

   SearchForPackages (
	"desktop",
	nil,
	$[
	    "name" : true,
	    "description" : true,
	    "contents" : false,
   	]
   )
   ->
   [
     ...
     $[
        "archs":[
            "ppc"
        ],
        "checksum":"e0cbdbf03ce47dfd5c5f885b86706ddfa023d8dc",
        "distro":"openSUSE_110",
        "name":"xfce4-desktop",
        "priority":"5",
        "repoURL":"http://download.opensuse.org/distribution/11.0/repo/oss/suse",
        "summary":"Desktop manager for the Xfce Desktop Environment",
        "version":"4.4.2"
     ],
     ...
   ]