Skip to content

Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.

fix(tools): license notices and string extraction miss less, and the Linux metadata names the real release

Bee649b6d7659d0
diff --git a/desktop/packaging/linux/org.nectarlink.desktop.metainfo.xml b/desktop/packaging/linux/org.nectarlink.desktop.metainfo.xml
index 8cf13b1..08fc7a5 100644
--- a/desktop/packaging/linux/org.nectarlink.desktop.metainfo.xml
+++ b/desktop/packaging/linux/org.nectarlink.desktop.metainfo.xml
@@ -34,6 +34,6 @@
</provides>
<content_rating type="oars-1.1" />
<releases>
- <release version="0.1.5" date="2026-04-17" />
+ <release version="0.1.4" date="2026-10-17" />
</releases>
</component>
diff --git a/tools/xtask/src/notices.rs b/tools/xtask/src/notices.rs
index 55f7038..5d9d57d 100644
--- a/tools/xtask/src/notices.rs
+++ b/tools/xtask/src/notices.rs
@@ -134,6 +134,7 @@ fn shipped_crates(metadata: &Value) -> Result<Vec<Crate>> {
let dir =
Path::new(p["manifest_path"].as_str().unwrap_or_default()).parent().map(Path::to_path_buf);
let mut files: Vec<(String, String)> = dir
+ .as_ref()
.and_then(|d| fs::read_dir(d).ok())
.into_iter()
.flatten()
@@ -143,6 +144,16 @@ fn shipped_crates(metadata: &Value) -> Result<Vec<Crate>> {
Some((e.file_name().to_string_lossy().into_owned(), fs::read_to_string(e.path()).ok()?))
})
.collect();
+ // A license kept elsewhere in the crate, as its `license-file` says.
+ if let (Some(dir), Some(named)) = (dir.as_ref(), p["license_file"].as_str()) {
+ let path = dir.join(named);
+ let name = path.file_name().map(|n| n.to_string_lossy().into_owned()).unwrap_or_default();
+ if !files.iter().any(|(have, _)| *have == name)
+ && let Ok(text) = fs::read_to_string(&path)
+ {
+ files.push((name, text));
+ }
+ }
files.sort();
Crate {
name: p["name"].as_str().unwrap_or_default().to_owned(),
diff --git a/tools/xtask/src/strings.rs b/tools/xtask/src/strings.rs
index fca5f4b..448758d 100644
--- a/tools/xtask/src/strings.rs
+++ b/tools/xtask/src/strings.rs
@@ -73,9 +73,10 @@ fn find(source: &str) -> Result<Vec<(usize, String, String)>> {
if before.is_some_and(|c| c.is_alphanumeric() || c == '_') {
continue;
}
- // Not in a comment (a doc example).
+ // Not in a comment (a doc example). A `//` earlier on the line can be
+ // part of a string ("https://"), so only a line that starts as one counts.
let line_start = source[..start].rfind('\n').map_or(0, |i| i + 1);
- if source[line_start..start].contains("//") {
+ if source[line_start..start].trim_start().starts_with("//") {
continue;
}
let line = source[..start].matches('\n').count() + 1;