Indexer: Initial support for debian repos
This commit is contained in:
parent
50fe17a604
commit
4bdd91f65e
2 changed files with 141 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ mod man;
|
|||
mod open;
|
||||
mod pkg;
|
||||
mod sys_arch;
|
||||
mod sys_deb;
|
||||
|
||||
|
||||
// Convenience function to get a system id by short-name. Panics if the system doesn't exist.
|
||||
|
|
@ -51,6 +52,13 @@ fn main() {
|
|||
(@arg mirror: --mirror +required +takes_value "Mirror URL")
|
||||
(@arg repo: --repo +required +takes_value "Repository name")
|
||||
)
|
||||
(@subcommand deb =>
|
||||
(about: "Index a Debian repository")
|
||||
(@arg sys: --sys +required +takes_value "System short-name")
|
||||
(@arg mirror: --mirror +required +takes_value "Mirror URL")
|
||||
(@arg contents: --contents +required +takes_value "Contents file")
|
||||
(@arg packages: --packages +required +takes_value "Packages file")
|
||||
)
|
||||
).get_matches();
|
||||
|
||||
let verbose = arg.occurrences_of("v");
|
||||
|
|
@ -94,4 +102,13 @@ fn main() {
|
|||
matches.value_of("repo").unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(matches) = arg.subcommand_matches("deb") {
|
||||
sys_deb::sync(&db,
|
||||
sysbyshort(&db, matches.value_of("sys").unwrap()),
|
||||
matches.value_of("mirror").unwrap(),
|
||||
open::Path{ path: matches.value_of("contents").unwrap(), cache: true, canbelocal: true},
|
||||
open::Path{ path: matches.value_of("packages").unwrap(), cache: true, canbelocal: true},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue