Skip to content

Commit

Permalink
Use PkgType::is_preview to determine whether to add a rename to the…
Browse files Browse the repository at this point in the history
… manifest

This caught a missing preview rename for `llvm-tools`.
  • Loading branch information
jyn514 committed Oct 27, 2022
1 parent 69a7495 commit a3dd94e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,11 @@ impl Builder {
let mut rename = |from: &str, to: &str| {
manifest.renames.insert(from.to_owned(), Rename { to: to.to_owned() })
};
rename("rls", "rls-preview");
rename("rustfmt", "rustfmt-preview");
rename("clippy", "clippy-preview");
rename("miri", "miri-preview");
rename("rust-docs-json", "rust-docs-json-preview");
rename("rust-analyzer", "rust-analyzer-preview");
for pkg in PkgType::all() {
if pkg.is_preview() {
rename(pkg.tarball_component_name(), &pkg.manifest_component_name());
}
}
}

fn rust_package(&mut self, manifest: &Manifest) -> Package {
Expand Down
4 changes: 2 additions & 2 deletions src/tools/build-manifest/src/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ macro_rules! pkg_type {
}

impl PkgType {
fn is_preview(&self) -> bool {
pub(crate) fn is_preview(&self) -> bool {
match self {
$( $( $($is_preview)? PkgType::$variant => true, )? )+
_ => false,
Expand All @@ -32,7 +32,7 @@ macro_rules! pkg_type {
}

/// First part of the tarball name.
fn tarball_component_name(&self) -> &str {
pub(crate) fn tarball_component_name(&self) -> &str {
match self {
$( PkgType::$variant => $component,)+
PkgType::Other(component) => component,
Expand Down

0 comments on commit a3dd94e

Please sign in to comment.