Skip to main content

Crate pacwoman

Crate pacwoman 

Source
Expand description

Pacwoman library.

Structs§

Mirror
A mirror to use.
Package
The identifier for a package. Used to locate the package.
PackageDesc
Information provided by a packages desc file.
RepoDescriptor
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.