@@ -295,8 +295,19 @@ fn parse_published_artifact_tag(line: &str) -> Option<String> {
295
295
if let Some ( date) = date {
296
296
if let Some ( name) = name {
297
297
// Create beta artifact in the form of beta-YYYY-MM-DD
298
- if name. starts_with ( "channel-rust-" ) && name . ends_with ( "- beta.toml") {
298
+ if name == "channel-rust-beta.toml" {
299
299
return Some ( format ! ( "beta-{date}" ) ) ;
300
+ } else if name. contains ( "beta" ) {
301
+ // No other beta releases are recognized as toolchains.
302
+ //
303
+ // We also have names like this:
304
+ //
305
+ // * channel-rust-1.75-beta.toml
306
+ // * channel-rust-1.75.0-beta.toml
307
+ // * channel-rust-1.75.0-beta.1.toml
308
+ //
309
+ // Which should get ignored for now, they're not consumable via rustup yet.
310
+ return None ;
300
311
} else if let Some ( capture) = VERSION_REGEX . captures ( name) {
301
312
if let Some ( version) = capture. get ( 1 ) . map ( |c| c. as_str ( ) ) {
302
313
return Some ( version. to_string ( ) ) ;
@@ -759,4 +770,34 @@ mod tests {
759
770
Some ( "1.63.0" . to_string( ) )
760
771
) ;
761
772
}
773
+
774
+ #[ test]
775
+ fn parse_published_beta_non_rustup_1 ( ) {
776
+ assert_eq ! (
777
+ parse_published_artifact_tag(
778
+ "static.rust-lang.org/dist/2023-11-13/channel-rust-1.75-beta.toml"
779
+ ) ,
780
+ None
781
+ ) ;
782
+ }
783
+
784
+ #[ test]
785
+ fn parse_published_beta_non_rustup_2 ( ) {
786
+ assert_eq ! (
787
+ parse_published_artifact_tag(
788
+ "static.rust-lang.org/dist/2023-11-13/channel-rust-1.75.0-beta.toml"
789
+ ) ,
790
+ None
791
+ ) ;
792
+ }
793
+
794
+ #[ test]
795
+ fn parse_published_beta_non_rustup_3 ( ) {
796
+ assert_eq ! (
797
+ parse_published_artifact_tag(
798
+ "static.rust-lang.org/dist/2023-11-13/channel-rust-1.75.0-beta.1.toml"
799
+ ) ,
800
+ None
801
+ ) ;
802
+ }
762
803
}
0 commit comments