Compare commits

...

10 Commits

Author SHA1 Message Date
Taiki Endo
100e23f1d0 Release 2.40.2 2024-06-21 10:37:33 +09:00
Taiki Endo
ee46a3debe Update zola@latest to 0.19.0 2024-06-21 10:16:25 +09:00
Taiki Endo
5729c89463 Update wasmtime@latest to 22.0.0 2024-06-21 03:27:57 +09:00
Taiki Endo
b572a9de6f Release 2.40.1 2024-06-20 21:59:15 +09:00
Taiki Endo
abf895aa42 Update cargo-zigbuild@latest to 0.19.0 2024-06-20 21:37:06 +09:00
Taiki Endo
f3e04cf24a Update cargo-binstall@latest to 1.7.2 2024-06-20 21:37:06 +09:00
Taiki Endo
bcdb46af7d Update biome@latest to 1.8.2 2024-06-20 21:37:06 +09:00
Taiki Endo
a5ddc5a290 codegen: Cleanup 2024-06-20 04:34:01 +09:00
Taiki Endo
e2ceb8a503 codegen: Unify string conversion style 2024-06-20 04:32:58 +09:00
Taiki Endo
4222c00e29 ci: Test GitHub-hosted ubuntu-24.04 runner 2024-06-20 04:24:39 +09:00
9 changed files with 211 additions and 78 deletions

View File

@@ -42,6 +42,7 @@ jobs:
include: include:
- os: ubuntu-20.04 - os: ubuntu-20.04
- os: ubuntu-22.04 - os: ubuntu-22.04
- os: ubuntu-24.04
- os: ubuntu-22.04 - os: ubuntu-22.04
tool: major.minor.patch tool: major.minor.patch
- os: ubuntu-22.04 - os: ubuntu-22.04

View File

@@ -10,6 +10,20 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
## [Unreleased] ## [Unreleased]
## [2.40.2] - 2024-06-21
- Update `zola@latest` to 0.19.0.
- Update `wasmtime@latest` to 22.0.0.
## [2.40.1] - 2024-06-20
- Update `cargo-zigbuild@latest` to 0.19.0.
- Update `cargo-binstall@latest` to 1.7.2.
- Update `biome@latest` to 1.8.2.
## [2.40.0] - 2024-06-19 ## [2.40.0] - 2024-06-19
- Fix an installation issue on some container environments. ([#545](https://github.com/taiki-e/install-action/pull/545)) - Fix an installation issue on some container environments. ([#545](https://github.com/taiki-e/install-action/pull/545))
@@ -2356,7 +2370,9 @@ Note: This release is considered a breaking change because installing on version
Initial release Initial release
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.40.0...HEAD [Unreleased]: https://github.com/taiki-e/install-action/compare/v2.40.2...HEAD
[2.40.2]: https://github.com/taiki-e/install-action/compare/v2.40.1...v2.40.2
[2.40.1]: https://github.com/taiki-e/install-action/compare/v2.40.0...v2.40.1
[2.40.0]: https://github.com/taiki-e/install-action/compare/v2.39.2...v2.40.0 [2.40.0]: https://github.com/taiki-e/install-action/compare/v2.39.2...v2.40.0
[2.39.2]: https://github.com/taiki-e/install-action/compare/v2.39.1...v2.39.2 [2.39.2]: https://github.com/taiki-e/install-action/compare/v2.39.1...v2.39.2
[2.39.1]: https://github.com/taiki-e/install-action/compare/v2.39.0...v2.39.1 [2.39.1]: https://github.com/taiki-e/install-action/compare/v2.39.0...v2.39.1

26
manifests/biome.json generated
View File

@@ -36,13 +36,33 @@
}, },
"license_markdown": "[Apache-2.0](https://github.com/biomejs/biome/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/biomejs/biome/blob/main/LICENSE-MIT)", "license_markdown": "[Apache-2.0](https://github.com/biomejs/biome/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/biomejs/biome/blob/main/LICENSE-MIT)",
"latest": { "latest": {
"version": "1.8.1" "version": "1.8.2"
}, },
"1": { "1": {
"version": "1.8.1" "version": "1.8.2"
}, },
"1.8": { "1.8": {
"version": "1.8.1" "version": "1.8.2"
},
"1.8.2": {
"x86_64_linux_musl": {
"checksum": "0971bc636e1abc6d06ea03b219f6c78488b209f8a623de081a04ce610ae47f10"
},
"x86_64_macos": {
"checksum": "17b1ecae7751c4519135fd4f6d9b7d8cdcf5dbdaa7d586da8776e05ad05209d3"
},
"x86_64_windows": {
"checksum": "cffd0c862eb02b0c574a550ac47c213e0d48121fee23ffcaee4098de08cbdab8"
},
"aarch64_linux_musl": {
"checksum": "4467475395c09442c23efca6bc800f8db14f21791ffc77594f71c11ec9c85aa3"
},
"aarch64_macos": {
"checksum": "659db94f30b4a5ef80995d494c7e7ec9a7fe820d4ef5b07b0684f2a44fe22140"
},
"aarch64_windows": {
"checksum": "ea3c0de73e3f7aa1b95cf5e26694a5427914771e2f47f7b5e5742a16c19088e1"
}
}, },
"1.8.1": { "1.8.1": {
"x86_64_linux_musl": { "x86_64_linux_musl": {

View File

@@ -22,26 +22,26 @@
}, },
"license_markdown": "[GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE)", "license_markdown": "[GPL-3.0](https://github.com/cargo-bins/cargo-binstall/blob/HEAD/crates/bin/LICENSE)",
"latest": { "latest": {
"version": "1.7.1" "version": "1.7.2"
}, },
"1.7.1": { "1.7.2": {
"x86_64_linux_musl": { "x86_64_linux_musl": {
"checksum": "3a2f849becb60f070e416cc30d48f366d040c8db38dd7dda714f26cec15f4e2a" "checksum": "08b6969c86471ecd1b9b6fbbd6508014d22dadda29fdd47ffb871d297ac49a8b"
}, },
"x86_64_macos": { "x86_64_macos": {
"checksum": "e68cd4c7688ee0378f63c2718c3ff982da02f161f1b9d20d7ecefa26fc463abd" "checksum": "7fa85fd3fda3c9e4962f16f8b9400e97ff2773e0481fc63a9cb882fe80115b7f"
}, },
"x86_64_windows": { "x86_64_windows": {
"checksum": "a6abfc2279632c85db91fb49cd11fd3e1cf8bd4bd4e6f64abc6cc22bcef55d4c" "checksum": "ee4da8bfaf25c84f0b67d5fd8e96f1243df4379f8dad64ffe2f82416198b7b35"
}, },
"aarch64_linux_musl": { "aarch64_linux_musl": {
"checksum": "93fbed7fb5ec054fb134a8b31a3d0c6e86dd856b85dce5f63dd4438153a20779" "checksum": "4342cfa8dc1033d2942270e8c4f7a63ef6953632ec3dbfacd7bebd4894e2ece8"
}, },
"aarch64_macos": { "aarch64_macos": {
"checksum": "76a4f22e19111d9a6393fa1c60131951646067bb37093d7103cecad8d4ac7d14" "checksum": "68157004ca95c2c3d4fae16246751317d2d6be32911cbdb04a06580d0c3aa43e"
}, },
"aarch64_windows": { "aarch64_windows": {
"checksum": "46e3050690269ac6b53b8fed4b8828d2acd9ae72da72270b4d1ccb1824b394b4" "checksum": "baf1c6d5729b629015e199e7739a4f76bd40d9c4a90883ecb1d2c33c16240190"
} }
} }
} }

View File

@@ -19,7 +19,27 @@
}, },
"license_markdown": "[MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE)", "license_markdown": "[MIT](https://github.com/rust-cross/cargo-zigbuild/blob/main/LICENSE)",
"latest": { "latest": {
"version": "0.18.4" "version": "0.19.0"
},
"0.19": {
"version": "0.19.0"
},
"0.19.0": {
"x86_64_linux_musl": {
"checksum": "ab2e2f3a22409470ec7d71badc22ab89351a6ddaba5c4785a39689856809404c"
},
"x86_64_windows": {
"checksum": "640b03357f568deb976cd0e0732db04f723498a0d4706d71ebaec05f8fc35db2"
},
"aarch64_linux_musl": {
"checksum": "edc3d0966ed8c80056d36ace8998eb75ed2f3a71342e0825960d98c9eb3398a0"
},
"aarch64_macos": {
"checksum": "9173594204eaacadd62e2f26a3c2365887ec24a4fa15f309023b8d4bbbc09dec"
},
"aarch64_windows": {
"checksum": "6affe535f6d37768cc20be30b8b65a1bcc196ae1efdad71d2a5c44049a081b7e"
}
}, },
"0.18": { "0.18": {
"version": "0.18.4" "version": "0.18.4"

View File

@@ -24,7 +24,30 @@
}, },
"license_markdown": "[Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/main/LICENSE)", "license_markdown": "[Apache-2.0 WITH LLVM-exception](https://github.com/bytecodealliance/wasmtime/blob/main/LICENSE)",
"latest": { "latest": {
"version": "21.0.1" "version": "22.0.0"
},
"22": {
"version": "22.0.0"
},
"22.0": {
"version": "22.0.0"
},
"22.0.0": {
"x86_64_linux_gnu": {
"checksum": "415d09d77f5375a6c5f6a1fc102bbaf3fe8e830b438690e6ea59a7d690458dea"
},
"x86_64_macos": {
"checksum": "2d39c488e391c1e18875a0aa22db0f2b3c737002beb83712639ff608666fccea"
},
"x86_64_windows": {
"checksum": "87c9d8dd42cc5506edbe9736fb098f8d960606c85d4608d543dd07f79194f35e"
},
"aarch64_linux_gnu": {
"checksum": "0c4bc38070d856a6cfc4b4ec6344b1f5de8cffdde875550c285010d645f24330"
},
"aarch64_macos": {
"checksum": "891552cd21d08f330b872ef462bd7ac3903b668f4461cf0de0d16a175b40f57f"
}
}, },
"21": { "21": {
"version": "21.0.1" "version": "21.0.1"

19
manifests/zola.json generated
View File

@@ -16,7 +16,24 @@
}, },
"license_markdown": "[MIT](https://github.com/getzola/zola/blob/master/LICENSE)", "license_markdown": "[MIT](https://github.com/getzola/zola/blob/master/LICENSE)",
"latest": { "latest": {
"version": "0.18.0" "version": "0.19.0"
},
"0.19": {
"version": "0.19.0"
},
"0.19.0": {
"x86_64_linux_gnu": {
"checksum": "5d26b7c63d36bcfc42a2db41d35cdd7bbde1762571ee936a89d155d7fd600f77"
},
"x86_64_macos": {
"checksum": "96cc5501541cc220c0e3d234f5c8b869afbba90ff6a10923824dfbb51f87f487"
},
"x86_64_windows": {
"checksum": "831adf641d2c691aa95771285f13fdbff8897d481084b360c49a9d933e81cec8"
},
"aarch64_macos": {
"checksum": "c57d5c6b6ed55fa1eb04ed8bc17432bff9d0ca0d96558c0c476edbef7fc77d95"
}
}, },
"0.18": { "0.18": {
"version": "0.18.0" "version": "0.18.0"

View File

@@ -7,6 +7,7 @@ use std::{
ffi::OsStr, ffi::OsStr,
io::Read, io::Read,
path::Path, path::Path,
sync::{LazyLock, RwLock},
time::Duration, time::Duration,
}; };
@@ -28,6 +29,7 @@ fn main() -> Result<()> {
std::process::exit(1); std::process::exit(1);
} }
let package = &args[0]; let package = &args[0];
let version_req = args.get(1);
let skip_existing_manifest_versions = std::env::var("SKIP_EXISTING_MANIFEST_VERSIONS").is_ok(); let skip_existing_manifest_versions = std::env::var("SKIP_EXISTING_MANIFEST_VERSIONS").is_ok();
let workspace_root = &workspace_root(); let workspace_root = &workspace_root();
@@ -47,22 +49,22 @@ fn main() -> Result<()> {
.strip_prefix("https://github.com/") .strip_prefix("https://github.com/")
.context("repository must start with https://github.com/")?; .context("repository must start with https://github.com/")?;
eprintln!("downloading metadata from https://github.com/{repo}"); eprintln!("downloading metadata from https://api.github.com/repos/{repo}");
let repo_info: github::RepoMetadata = let repo_info: github::RepoMetadata =
download_github(&format!("https://api.github.com/repos/{repo}"))?.into_json()?; download(&format!("https://api.github.com/repos/{repo}"))?.into_json()?;
eprintln!("downloading releases of https://github.com/{repo} from https://api.github.com/repos/{repo}/releases"); eprintln!("downloading releases from https://api.github.com/repos/{repo}/releases");
let mut releases: github::Releases = vec![]; let mut releases: github::Releases = vec![];
// GitHub API returns up to 100 results at a time. If the number of releases // GitHub API returns up to 100 results at a time. If the number of releases
// is greater than 100, multiple fetches are needed. // is greater than 100, multiple fetches are needed.
for page in 1.. { for page in 1.. {
let per_page = 100; let per_page = 100;
let mut r: github::Releases = download_github(&format!( let mut r: github::Releases = download(&format!(
"https://api.github.com/repos/{repo}/releases?per_page={per_page}&page={page}" "https://api.github.com/repos/{repo}/releases?per_page={per_page}&page={page}"
))? ))?
.into_json()?; .into_json()?;
if r.len() < per_page { // If version_req is latest, it is usually sufficient to look at the latest 100 releases.
if r.len() < per_page || version_req.map_or(false, |req| req == "latest") {
releases.append(&mut r); releases.append(&mut r);
break; break;
} }
@@ -172,7 +174,7 @@ fn main() -> Result<()> {
if let Some(license) = detail.license { if let Some(license) = detail.license {
eprintln!("Trying to using license '{license}' from crates.io ..."); eprintln!("Trying to using license '{license}' from crates.io ...");
if let Some(license_markdown) = if let Some(license_markdown) =
get_license_markdown(&license, &repo.to_string(), &repo_info.default_branch) get_license_markdown(&license, repo, &repo_info.default_branch)
{ {
manifests.license_markdown = license_markdown; manifests.license_markdown = license_markdown;
} }
@@ -181,7 +183,7 @@ fn main() -> Result<()> {
if let Some(license) = license.spdx_id { if let Some(license) = license.spdx_id {
eprintln!("Trying to using license '{license}' from github.com ..."); eprintln!("Trying to using license '{license}' from github.com ...");
if let Some(license_markdown) = if let Some(license_markdown) =
get_license_markdown(&license, &repo.to_string(), &repo_info.default_branch) get_license_markdown(&license, repo, &repo_info.default_branch)
{ {
manifests.license_markdown = license_markdown; manifests.license_markdown = license_markdown;
} }
@@ -192,7 +194,7 @@ fn main() -> Result<()> {
panic!("Unable to determine license_markdown; set manually") panic!("Unable to determine license_markdown; set manually")
} }
let version_req: Option<semver::VersionReq> = match args.get(1) { let version_req: Option<semver::VersionReq> = match version_req {
_ if latest_only => { _ if latest_only => {
let req = format!("={}", releases.first_key_value().unwrap().0 .0).parse()?; let req = format!("={}", releases.first_key_value().unwrap().0 .0).parse()?;
eprintln!("update manifest for versions '{req}'"); eprintln!("update manifest for versions '{req}'");
@@ -294,7 +296,7 @@ fn main() -> Result<()> {
eprintln!("already downloaded"); eprintln!("already downloaded");
fs::File::open(download_cache)?.read_to_end(&mut buf)?; fs::File::open(download_cache)?.read_to_end(&mut buf)?;
} else { } else {
download_github(&url)?.into_reader().read_to_end(&mut buf)?; download(&url)?.into_reader().read_to_end(&mut buf)?;
eprintln!("download complete"); eprintln!("download complete");
fs::write(download_cache, &buf)?; fs::write(download_cache, &buf)?;
} }
@@ -316,7 +318,7 @@ fn main() -> Result<()> {
eprintln!("already downloaded"); eprintln!("already downloaded");
minisign_verify::Signature::from_file(sig_download_cache)? minisign_verify::Signature::from_file(sig_download_cache)?
} else { } else {
let buf = download_github(&url)?.into_string()?; let buf = download(&url)?.into_string()?;
eprintln!("download complete"); eprintln!("download complete");
fs::write(sig_download_cache, &buf)?; fs::write(sig_download_cache, &buf)?;
minisign_verify::Signature::decode(&buf)? minisign_verify::Signature::decode(&buf)?
@@ -606,97 +608,131 @@ fn replace_vars(
Ok(s) Ok(s)
} }
/// Download using GITHUB_TOKEN. struct GitHubTokens {
#[allow(clippy::missing_panics_doc)] // In my experience, only api.github.com have severe rate limit.
fn download_github(url: &str) -> Result<ureq::Response> { // https://api.github.com/
let mut token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty()); // Refs: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api
api: RwLock<Option<String>>,
// https://raw.githubusercontent.com/
// Refs: https://stackoverflow.com/questions/66522261/does-github-rate-limit-access-to-public-raw-files
raw: RwLock<Option<String>>,
// https://github.com/*/*/releases/download/
other: RwLock<Option<String>>,
}
impl GitHubTokens {
fn get(&self, url: &str) -> Option<String> {
if url.starts_with("https://raw.githubusercontent.com/") {
self.raw.read().unwrap().clone()
} else if url.starts_with("https://api.github.com/") {
self.api.read().unwrap().clone()
} else if url.starts_with("https://github.com/") {
self.other.read().unwrap().clone()
} else {
None
}
}
fn clear(&self, url: &str) {
if url.starts_with("https://raw.githubusercontent.com/") {
*self.raw.write().unwrap() = None;
} else if url.starts_with("https://api.github.com/") {
*self.api.write().unwrap() = None;
} else if url.starts_with("https://github.com/") {
*self.other.write().unwrap() = None;
}
}
}
static GITHUB_TOKENS: LazyLock<GitHubTokens> = LazyLock::new(|| {
let token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty());
GitHubTokens {
raw: RwLock::new(token.clone()),
api: RwLock::new(token.clone()),
other: RwLock::new(token),
}
});
fn download(url: &str) -> Result<ureq::Response> {
let mut token = GITHUB_TOKENS.get(url);
let mut retry = 0; let mut retry = 0;
let max_retry = 6; let mut retry_time = 0;
let mut max_retry = 6;
if token.is_none() {
max_retry /= 2;
}
let mut last_error; let mut last_error;
loop { loop {
let mut req = ureq::get(url); let mut req = ureq::get(url);
if let Some(token) = &token { if let Some(token) = &token {
req = req.set("Authorization", token); req = req.set("Authorization", &format!("Bearer {token}"));
} }
match req.call() { match req.call() {
Ok(res) => return Ok(res), Ok(res) => return Ok(res),
Err(e) => last_error = Some(e), Err(e) => last_error = Some(e),
} }
if retry == max_retry / 2 && token.is_some() { retry_time += 1;
if token.is_some() && retry == max_retry / 2 {
retry_time = 0;
token = None; token = None;
// rate limit
GITHUB_TOKENS.clear(url);
} }
retry += 1; retry += 1;
if retry > max_retry { if retry > max_retry {
break; break;
} }
eprintln!("download failed; retrying after {}s ({retry}/{max_retry})", retry * 2); eprintln!("download failed; retrying after {}s ({retry}/{max_retry})", retry_time * 2);
std::thread::sleep(Duration::from_secs(retry * 2)); std::thread::sleep(Duration::from_secs(retry_time * 2));
} }
Err(last_error.unwrap().into()) Err(last_error.unwrap().into())
} }
#[allow(clippy::missing_panics_doc)] fn github_head(url: &str) -> Result<()> {
pub fn github_head(url: &str) -> Result<()> {
eprintln!("fetching head of {url} .."); eprintln!("fetching head of {url} ..");
let mut token = env::var("GITHUB_TOKEN").ok().filter(|v| !v.is_empty()); let mut token = GITHUB_TOKENS.get(url);
let mut retry = 0; let mut retry = 0;
let max_retry = 2; let mut retry_time = 0;
let mut max_retry = 2;
if token.is_none() {
max_retry /= 2;
}
let mut last_error; let mut last_error;
loop { loop {
let mut req = ureq::head(url); let mut req = ureq::head(url);
if let Some(token) = &token { if let Some(token) = &token {
req = req.set("Authorization", token); req = req.set("Authorization", &format!("Bearer {token}"));
} }
match req.call() { match req.call() {
Ok(_) => return Ok(()), Ok(_) => return Ok(()),
Err(e) => last_error = Some(e), // rate limit
Err(e @ ureq::Error::Status(403, _)) => last_error = Some(e),
Err(e) => return Err(e.into()),
} }
if retry == max_retry / 2 && token.is_some() { retry_time += 1;
if token.is_some() && retry == max_retry / 2 {
retry_time = 0;
token = None; token = None;
GITHUB_TOKENS.clear(url);
} }
retry += 1; retry += 1;
if retry > max_retry { if retry > max_retry {
break; break;
} }
eprintln!("head of {url} failed; retrying after {}s ({retry}/{max_retry})", retry * 2); eprintln!("head of {url} failed; retrying after {}s ({retry}/{max_retry})", retry_time * 2);
std::thread::sleep(Duration::from_secs(retry * 2)); std::thread::sleep(Duration::from_secs(retry_time * 2));
}
Err(last_error.unwrap().into())
}
/// Download without using GITHUB_TOKEN.
#[allow(clippy::missing_panics_doc)]
pub fn download(url: &str) -> Result<ureq::Response> {
let mut retry = 0;
let max_retry = 6;
let mut last_error;
loop {
let req = ureq::get(url);
match req.call() {
Ok(res) => return Ok(res),
Err(e) => last_error = Some(e),
}
retry += 1;
if retry > max_retry {
break;
}
eprintln!("download of {url} failed; retrying after {}s ({retry}/{max_retry})", retry * 2);
std::thread::sleep(Duration::from_secs(retry * 2));
} }
Err(last_error.unwrap().into()) Err(last_error.unwrap().into())
} }
#[must_use] #[must_use]
fn create_github_raw_link(repository: &String, branch: &String, filename: &String) -> String { fn create_github_raw_link(repository: &str, branch: &str, filename: &str) -> String {
format!("https://raw.githubusercontent.com/{repository}/{branch}/{filename}") format!("https://raw.githubusercontent.com/{repository}/{branch}/{filename}")
} }
#[must_use] #[must_use]
fn create_github_link(repository: &String, branch: &String, filename: &String) -> String { fn create_github_link(repository: &str, branch: &str, filename: &str) -> String {
format!("https://github.com/{repository}/blob/{branch}/{filename}") format!("https://github.com/{repository}/blob/{branch}/{filename}")
} }
#[must_use] #[must_use]
fn get_license_markdown(spdx_expr: &str, repo: &String, default_branch: &String) -> Option<String> { fn get_license_markdown(spdx_expr: &str, repo: &str, default_branch: &str) -> Option<String> {
// TODO: use https://docs.rs/spdx/latest/spdx/expression/struct.Expression.html#method.canonicalize ? // TODO: use https://docs.rs/spdx/latest/spdx/expression/struct.Expression.html#method.canonicalize ?
let expr = spdx::Expression::parse_mode(spdx_expr, spdx::ParseMode::LAX).unwrap(); let expr = spdx::Expression::parse_mode(spdx_expr, spdx::ParseMode::LAX).unwrap();
@@ -740,14 +776,14 @@ fn get_license_markdown(spdx_expr: &str, repo: &String, default_branch: &String)
let license_name = if let Some(exception_id) = exception_id { let license_name = if let Some(exception_id) = exception_id {
format!("{} WITH {}", license_id.name, exception_id.name) format!("{} WITH {}", license_id.name, exception_id.name)
} else { } else {
license_id.name.to_string() license_id.name.to_owned()
}; };
let name = license_id.name.split('-').next().unwrap().to_ascii_uppercase(); let name = license_id.name.split('-').next().unwrap().to_ascii_uppercase();
for filename in [ for filename in [
"LICENSE".to_string(), "LICENSE".to_owned(),
format!("LICENSE-{name}"), format!("LICENSE-{name}"),
"LICENSE.md".to_string(), "LICENSE.md".to_owned(),
"COPYING".to_string(), "COPYING".to_owned(),
] { ] {
let url = create_github_raw_link(repo, default_branch, &filename); let url = create_github_raw_link(repo, default_branch, &filename);
if github_head(&url).is_ok() { if github_head(&url).is_ok() {
@@ -765,7 +801,7 @@ fn get_license_markdown(spdx_expr: &str, repo: &String, default_branch: &String)
let license_name = if let Some(exception_id) = exception_id { let license_name = if let Some(exception_id) = exception_id {
format!("{} WITH {}", license_id.name, exception_id.name) format!("{} WITH {}", license_id.name, exception_id.name)
} else { } else {
license_id.name.to_string() license_id.name.to_owned()
}; };
if github_head(&url).is_ok() { if github_head(&url).is_ok() {
let url = create_github_link(repo, default_branch, &filename); let url = create_github_link(repo, default_branch, &filename);

View File

@@ -46,16 +46,16 @@ fn main() -> Result<()> {
paths.sort_by_key(fs_err::DirEntry::path); paths.sort_by_key(fs_err::DirEntry::path);
let mut tools = vec![MarkdownEntry { let mut tools = vec![MarkdownEntry {
name: "valgrind".to_string(), name: "valgrind".to_owned(),
alias: None, alias: None,
website: "https://valgrind.org/".to_string(), website: "https://valgrind.org/".to_owned(),
installed_to: InstalledTo::Snap, installed_to: InstalledTo::Snap,
installed_from: InstalledFrom::Snap, installed_from: InstalledFrom::Snap,
platforms: Platforms { linux: true, ..Default::default() }, platforms: Platforms { linux: true, ..Default::default() },
repository: "https://sourceware.org/git/valgrind.git".to_string(), repository: "https://sourceware.org/git/valgrind.git".to_owned(),
license_markdown: license_markdown:
"[GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD)" "[GPL-2.0](https://sourceware.org/git/?p=valgrind.git;a=blob;f=COPYING;hb=HEAD)"
.to_string(), .to_owned(),
}]; }];
for path in paths { for path in paths {