Expand description
Pacwoman library.
Structs§
- Mirror
- A mirror to use.
- Package
- The identifier for a package. Used to locate the package.
- Package
Desc - Information provided by a packages desc file.
- Repo
Descriptor - A descriptor of a repository.
Functions§
- base_
dir - Same as get_base_dir; however, this function will create the directory if it doesn’t exist. If std::fs::create_dir_all returns an error, it will be propagated.
- bin_dir
- Same as get_bin_dir, except it will create the directory if it doesn’t exist. If std::fs::create_dir_all returns an error, it will be propagated.
- config_
directory - Same as get_config_directory; however, this function will create the directory if it doesn’t exist. If std::fs::create_dir_all returns an error, it will be propagated.
- create_
directories - Creates all of the necessary directories, for the system if running as root, and for the current user if not. If std::fs::create_dir_all returns an error, it will be propagated.
- get_
base_ dir - Returns the base dir for pacwoman. Use this instead of hard-coding /pacwoman for the case of debugging in a different directory.
- get_
bin_ dir - Directory for storing binaries. Equivalent to the root directory. Contains directories such as etc, usr, var, and others.
- get_
config_ directory - Get the config directory. If for the entire system, then it will be /pacwoman/config, otherwise it will be /pacwoman/user/{user name from get_current_user}/config.
- get_
current_ user - Get the current user. It will first try the effective username. If the effective user has been
deleted, then it will try the current user. If the current user has also been deleted, then
it will as a last resort create a unique string in the format
deleted_user_e{e}_c{c}where {e} is the effective user uid and {c} is the current user uid. - get_
gpg_ ctx - Gets the gpgme context and sets the appropriate properties.
- get_
gpg_ dir - Directory for storing GPG keys and other miscellaneous GPG stuff.
- get_
index_ directory - Get the index directory. This is always a system-wide directory of /pacwoman/index. This directory is subject to change; because of this, use this method instead of hard-coding the directory.
- get_
repo_ index_ dir - Returns the index directory of a repository. This does not include the hash; this should be assumed to symlink to the correct, hashed directory.
- get_
repo_ store_ directory - Gets the store directory for a repo.
- get_
store_ directory - Get the store directory. If for the entire system, then it will be /pacwoman/store, otherwise it will be /pacwoman/user/{user name from get_current_user}/store.
- gpg_dir
- Same as get_gpg_dir, except it will create the directory if it doesn’t exist. If std::fs::create_dir_all returns an error, it will be propagated.
- index_
directory - Same as get_index_directory; however, this function will create the directory if it doesn’t exist. If std::fs::create_dir_all returns an error, it will be propagated.
- init_
gpg - Initalizes the GPG keyring and other GPG stuff.
- install_
package - Recieves a package and it’s dependencies and installs it.
- locate_
package - Get a list of (Package name and version, repo, path to index directory with the package)
for a certain package name. This function uses read_desc internally after performing
preliminary checks to make sure that only packages that have the exact name of
package_name will be returned. If this was not used, then this would create false
positives of any package that is in the format
(package_name)-.*in a psuedo-regex. - populate_
index - Populates the index with information for a certain repo from a certain mirror. Will overwrite any symlink for the repo.
- read_
desc - Reads the desc file of the package into a PackageDesc. Will return an error if required fields don’t exist. If they have an empty value, it will work. An error will also be returned if any calls such as opening a file fail.
- read_
repos - Get a list of hashes provided by the repo.
- receive_
package - Downloads, verifies, and unpacks a package from the provided mirror. The package value provided should be the file name provided in a PackageDesc.
- recieve_
package_ and_ dependencies - Recieves a package and all of it’s dependencies. Returns a list of paths to each package.
- remove_
package - Remove a package from the store. This WILL lead to dangling symlinks because I don’t feel like fixing that!
- repo_
index_ dir - Same as get_repo_index_dir, except it will create the directory if it doesn’t exist. If std::fs::create_dir_all returns an error, it will be propagated.
- repo_
store_ directory - Same as get_repo_store_directory but creates the directory(s) if they don’t exist.
- store_
directory - Same as get_store_directory; however, this function will create the directory if it doesn’t exist. If std::fs::create_dir_all returns an error, it will be propagated.