Struct aur_fetch::Handle [−][src]
pub struct Handle {
pub clone_dir: PathBuf,
pub diff_dir: PathBuf,
pub git: PathBuf,
pub git_flags: Vec<String>,
pub aur_url: Url,
}
Expand description
Handle to the current configuration.
This handle is used to configure parts of the fetching process. All the features of this crate must be done through this handle.
Fields
clone_dir: PathBuf
The directory to place AUR packages in.
diff_dir: PathBuf
The directory to place diffs in.
git: PathBuf
The git command to run.
git_flags: Vec<String>
Flags passed to git.
aur_url: Url
The AUR URL.
Implementations
Create a new Handle with working defaults.
This Inializes the clone and diff dir to the current dirrectory. If you want to configure a cache directory you will need to do that yourself.
Create a new handle with a specified cache dir.
clone_dir will be a subdirectory named clone inside of the specified path. diff_dir will be a subdirectory named diff inside of the specified path.
Create a new handle with a specified cache dir.
Both diffs and cloned packages will be places in the provided dir.
Downloads a list of packages to the cache dir.
This downloads packages from the AUR using git. New packages will be cloned, while packages that already exist in cache will be fetched. Merging will need to be done in a separate step.
Each package is downloaded concurrently which givess a major speedup
Depending on how many packages are being downloaded and connection speed this
function may take a little while to complete. See download_cb
if
you wish track the progress of each download.
This also filters the input list to packages that were already in cache. This filtered list
can then be passed on to merge
as freshly cloned packages will
not need to be merged.
The same as download
but calls a Callback after each download.
The callback is called each time a package download is completed.
Filters a list of packages, keep ones that have a diff.
A reoo has a diff if AUR_SEEN is defined and is different to the upstram HEAD.
Filterrs a list of packages, keeping ones that have not yet been seen.
A repo is seen if AUR_SEEN exists and is equal to the upstram HEAD.
Diff a list of packages returning the diffs as strings.
Diffing a package that is already up to date will generate a diff against an empty git tree
Additionally this function gives you the ability to force color. This is useful if you intend to print the diffs to stdout.
Diff a single package.
Relies on git diff
for printing. This means output will likley be coloured and ran through less.
Although this is dependent on the user’s git config
Diff a list of packages and save them to diff_dir.
Diffing a package that is already up to date will generate a diff against an empty git tree
Makes a view of newly downloaded files.
This view is a tmp dir containing the packages downloaded/fetched and diffs for packages that have diffs.
Files are symlinked from the cache dirs so there is no duplication of files.
Merge a list of packages with their upstream.
Merge a list of packages with their upstream, calling callback for each merge.
Marks a list of repos as seen.
This updates AUR_SEEN to the upstream HEAD
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Handle
impl UnwindSafe for Handle
Blanket Implementations
Mutably borrows from an owned value. Read more