pkgclient

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintDependencyGraph

func PrintDependencyGraph(packages []*meta.PackageInfo, order []meta.PackageID)

func TopologicalSort

func TopologicalSort(packages []*meta.PackageInfo) ([]meta.PackageID, error)

TopologicalSort performs topological sort on package dependencies.

Types

type BuildNode

type BuildNode struct {
	Info         *meta.PackageInfo
	Dependencies []meta.PackageID
}

BuildNode represents one concrete package version in the build graph.

type Client

type Client struct {
	Config *config.Config
	Cache  string
	DBPath string
	HTTP   *http.Client
}

Client holds runtime info.

func NewClient

func NewClient(cfg *config.Config) *Client

NewClient constructs client with default cache/db paths under config dir.

func (*Client) Install

func (c *Client) Install(pkgNameOrLocalFileList []string, prefix string, noConfirm bool, noResolve bool) error

Install downloads and installs the named package into prefix. @note prefix must be an absolute path

func (*Client) InstallToSdk

func (c *Client) InstallToSdk(pkgNameOrLocalFileList []string, noConfirm bool, noResolve bool) error

Install downloads and installs the named package into OHOS sdk

func (*Client) ListPackages

func (c *Client) ListPackages(arch string) error

ListPackages fetches index.json and prints packages for arch.

func (*Client) PatchLibFiles

func (c *Client) PatchLibFiles(tgtLibdir, installLibdir, installPrefix string) error

PatchLibFiles patches .la and .pc files in libdir similarly to the shell snippet. libdir must be an absolute or relative path. tgtLibdir is the directory that libraries actually in. installLibdir & installPrefix is the libdir/prefix in the configuration files. Returns an error if one or more file operations fail. NOTE: libdir and installPrefix must be absolute paths

func (*Client) ResolveDependencies

func (c *Client) ResolveDependencies(requested []string, arch string) (map[string]meta.IndexEntry, error)

ResolveDependencies takes initial requested package names (each string may be a simple name) and returns a map[name]IndexEntry of chosen versions to install (values order not guaranteed). It uses index.json and package manifests for transitive deps.

func (*Client) Uninstall

func (c *Client) Uninstall(pkgName, prefix string) error

Uninstall removes installed package from prefix.

func (*Client) XCompile

func (c *Client) XCompile(packageNames []string, arch string, jobs int, keepGoing bool) error

XCompile builds packages from source in topological order.

type DB

type DB struct {
	*sql.DB
}

DB wrapper

func OpenDB

func OpenDB(path string) (*DB, error)

OpenDB opens/creates database and ensures schema.

func (*DB) DeleteInstalled

func (db *DB) DeleteInstalled(name, prefix string) error

func (*DB) GetInstalled

func (db *DB) GetInstalled(name, prefix string) (*Installed, error)

func (*DB) InsertInstalled

func (db *DB) InsertInstalled(name, version, arch, prefix, path string) error

type Installed

type Installed struct {
	Name    string
	Version string
	Arch    string
	Prefix  string
	Path    string
	When    time.Time
}

Installed row

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL