pub struct ScanIndex {Show 15 fields
pub pkgname: PkgName,
pub pkg_location: Option<PkgPath>,
pub all_depends: Option<Vec<Depend>>,
pub pkg_skip_reason: Option<String>,
pub pkg_fail_reason: Option<String>,
pub no_bin_on_ftp: Option<String>,
pub restricted: Option<String>,
pub categories: Option<String>,
pub maintainer: Option<String>,
pub use_destdir: Option<String>,
pub bootstrap_pkg: Option<String>,
pub usergroup_phase: Option<String>,
pub scan_depends: Option<Vec<PathBuf>>,
pub pbulk_weight: Option<String>,
pub multi_version: Option<Vec<String>>,
}Expand description
Parse the output of make pbulk-index into individual records.
See pbulk-index.mk and pbulk-build(1).
While the majority of these fields will always be set even if left empty,
they are wrapped in Option to simplify tests as well as handle cases in
the future should they be removed from the default output.
§Example
use pkgsrc::{PkgName, ScanIndex};
use std::io::BufReader;
use std::process::{Command, Stdio};
let cmd = Command::new("make")
.current_dir("/usr/pkgsrc/databases/php-mysql")
.arg("pbulk-index")
.stdout(Stdio::piped())
.spawn()
.expect("Unable to execute make");
let stdout = cmd.stdout.unwrap();
let reader = BufReader::new(stdout);
let index: Vec<_> = ScanIndex::from_reader(reader)
.collect::<Result<_, _>>()
.unwrap();
// Should return 5 results due to MULTI_VERSION
assert_eq!(index.len(), 5);
assert_eq!(index[0].pkgname, PkgName::new("php56-mysql-5.6.40nb1"));Fields§
§pkgname: PkgNameName of the package including the version number.
pkg_location: Option<PkgPath>Path to the package inside pkgsrc. Should really be PKGPATH.
all_depends: Option<Vec<Depend>>All dependencies of the package as DEPENDS matches.
pkg_skip_reason: Option<String>A string containing the reason if the package should be skipped.
pkg_fail_reason: Option<String>A string containing the reason if the package failed or is broken.
no_bin_on_ftp: Option<String>A string containing the reason why its binary package may not be uploaded.
restricted: Option<String>A string containing the reason why its binary package may not be distributed.
categories: Option<String>Categories to which the package belongs.
maintainer: Option<String>Maintainer of the package.
use_destdir: Option<String>DESTDIR method this package supports (almost always user-destdir).
bootstrap_pkg: Option<String>If this package is used during pkgsrc bootstrap.
usergroup_phase: Option<String>The phase of the build process during which the user and/or group needed by this package need to be available.
scan_depends: Option<Vec<PathBuf>>List of files read during the dependency scanning step.
pbulk_weight: Option<String>Numeric build priority of the package. If not set, a value of 100 is assumed.
multi_version: Option<Vec<String>>List of variables to be set when building this specific PKGNAME from
a common PKGPATH.
Implementations§
Source§impl ScanIndex
impl ScanIndex
Sourcepub fn from_reader<R: BufRead>(reader: R) -> ScanIndexIter<R> ⓘ
pub fn from_reader<R: BufRead>(reader: R) -> ScanIndexIter<R> ⓘ
Create an iterator that parses ScanIndex entries from a reader.
Records are delimited by lines starting with PKGNAME=.
Trait Implementations§
impl Eq for ScanIndex
impl StructuralPartialEq for ScanIndex
Auto Trait Implementations§
impl Freeze for ScanIndex
impl RefUnwindSafe for ScanIndex
impl Send for ScanIndex
impl Sync for ScanIndex
impl Unpin for ScanIndex
impl UnwindSafe for ScanIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.